Preserve columns order when searching (querying) a table

It should list all of the columns.

Will it always list them in the displayed order? I don’t know. Probably not.

If you need to know the order in which the IDE displays the columns, there is a reliable place to look: your local Git repository’s anvil.yaml file. An excerpt from one of mine:

allow_embedding: false
correct_dependency_ids: {dep_gmbim1gr96hup: J4EL2HK23CGRRZOC}
db_schema:
  admin_users:
    client: none
    columns:
    - admin_ui: {order: 0, width: 200}
      name: email
      type: string
    - admin_ui: {order: 1, width: 131}
      name: enabled
      type: bool
    - admin_ui: {order: 2, width: 200}
      name: last_login
      type: datetime
    - admin_ui: {order: 3, width: 200}
      name: password_hash
      type: string
...

The admin_ui entries tell you what order the columns are in, and the visual width (in pixels) of the column.

I get a local copy of my apps’ anvil.yaml file via Git:

1 Like