title: How to use JSON columns with SQLModel
body: <p>I'm trying to define a JSON column via SQLModel:</p>
  <pre><code>from typing import Optional
  from sqlmodel import Field, Session, SQLModel, create_engine, JSON
  
  
  class Hero(SQLModel, table=True):
      id: Optional[int] = Field(default=None, primary_key=True)
      name: str
      secret_name: str
      age: Optional[int] = None
      meta: JSON
  </code></pre>
  <p>Code is from <a href="https://sqlmodel.tiangolo.com/#write-to-the-database" rel="noreferrer">SQLModel</a>, but extended by &quot;meta&quot; attribute.</p>
  <p>Using the above code with the rest of the <a href="https://sqlmodel.tiangolo.com/#write-to-the-database" rel="noreferrer">example code</a> (setting up sqlite, adding data), I get the following error:</p>
  <pre><code>RuntimeError: no validator found for &lt;class 'sqlalchemy.sql.sqltypes.JSON'&gt;, see `arbitrary_types_allowed` in Config
  </code></pre>
  <p>I tried to extend the code by</p>
  <pre><code>class Hero(SQLModel, table=True):
      [...]
      meta: JSON
  
      @validator('meta')
      def validate_json(v):
          return v
  
      class Config:
          arbitrary_types_allowed = True 
  </code></pre>
  <p>But this leads to another error:</p>
  <pre><code>sqlalchemy.exc.CompileError: (in table 'hero', column 'meta'): Can't generate DDL for NullType(); did you forget to specify a type on this Column?
  </code></pre>
  <p>I tried it with using SQLAlchemy only and it has worked.</p>
  <p>So any ideas how can I get the &quot;connection&quot; done between SQLModel and SQLAlchemy for the JSON field?</p>
  <p><strong>Update</strong>: I also have tested to set it optional and give it a default value. No success (2. error again):</p>
  <pre><code>class Hero(SQLModel, table=True):
      [...]
      meta: Optional[JSON] = {}
  
      class Config:
          arbitrary_types_allowed = True 
  </code></pre>
  <p>Small hint: Even if <code>JSON</code> is imported from <code>SQLModel</code>, it gets finally imported from <code>SQLAlchemy.sqltypes</code> without any changes.</p>