title: With fastapi/SQLModel, how to specify the order the columns/fields are shown in a table/response object?
body: <p>I have the following models/schemas:</p>
  <pre class="lang-py prettyprint-override"><code>class UserBase(SQLModel):
      full_name: str
      email: EmailStr
      is_active: bool = True
      is_superuser: bool = False
  
  
  class UserRead(UserBase):
      id: uuid.UUID
  
  
  class UserCreate(UserBase, extra=Extra.forbid):
      password: str
  
  
  class UserUpdate(UserBase):
      password: Optional[str] = None
  
  
  class User(UserBase, table=True):
      id: uuid.UUID = Field(
          default_factory=uuid.uuid4,
          primary_key=True,
          index=True,
          nullable=False,
      )
      hashed_password: Optional[str] = None
  
  </code></pre>
  <p>In my postgres client the table shows the columns in the order the fields are listed in the models/schemas:</p>
  <p><a href="https://i.stack.imgur.com/ChxzQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ChxzQ.png" alt="postgres client" /></a></p>
  <p>Also, the openapi documentation lists the response object fields in the same order they are specified in the <code>User</code> model (notice the response object on the bottom of the image):</p>
  <p><a href="https://i.stack.imgur.com/mFs8Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mFs8Q.png" alt="openapi docs" /></a></p>
  <p>I would like to have the <code>id</code> to be the first column/field to show in the table/response object. In general, how can I enforce a specific order of the columns/fields?</p>