Skip to main content
Docs/Database (Advanced)
DocsDatabase (Advanced)
Free

Database (Advanced)

Schema changes on a live app, how columns are named, support for older tables, and where per-user data access stands. Sibling to /docs/database for power users.

Migrations

When you change a schema after the table has been provisioned, GenMB applies the diff: new columns added with their defaults, removed columns dropped, type changes applied where Postgres permits. The migration runs on save; the Database Browser reflects the new state immediately.

Type changes are best-effort. Dropping a column is permanent. For destructive changes on a live app with real data, back up via Export first or use a transient workspace to validate.

Column Naming

GenMB names every column in your PostgreSQL tables in camelCase (for example createdAt and updatedAt). This includes the created and updated timestamps GenMB adds for you when you do not define them yourself. You do not have to manage this by hand - describe the columns you want in chat and GenMB sets the names up consistently.

If you ever look at your data in the Database Browser, column names like createdAt are what you will see. Use that exact spelling when you ask GenMB to filter or sort by a column.

Older Tables

Some apps created before mid-2026 have older-style column names like created_at and updated_at instead of the camelCase form. You do not need to do anything: GenMB automatically maps the old names to the new ones when it reads your data, so existing apps keep working and you can refer to either name.

This is fully automatic. You will not see a difference in your app or in the Database Browser, and there is nothing to migrate or clean up.

Per-User Data Access

A common need is that each person only sees their own rows - their own orders, notes, or bookings, never someone else's. Just ask in chat - for example, "only let each user see their own tasks" - and GenMB writes your app so it tags each record with its owner and filters every read by the signed-in user, using your app's sign-in and, if you use them, your access roles. This scoping lives in your app's own code, so keep it in place if you edit those queries by hand.

A deeper, database-level version of this protection - enforced by the server no matter what your app code does - is built into the platform but is not switched on yet. Until then, the per-user filtering in your app's code is what keeps data separated, so leave it in place.

Stuck Schemas

If a schema gets stuck in a pending or failed state, GenMB recovers it automatically the next time your app reads or writes data - it re-runs the setup behind the scenes. In most cases the table is ready again within seconds without any action from you. If a schema stays stuck, reprovision it from the Schema panel, or ask in chat and we will sort it out.

See Database & Schema for the basic workflow.

FAQs

When do I need this page vs /docs/database?
Most people only need /docs/database (Schema Designer, the Database Browser, viewing and editing records). Read this page when you are changing a schema on a live app with real data, want to understand how columns are named, or are wondering whether each user can be limited to their own rows.
Can I run raw SQL?
Through the Database Browser, yes (read queries). Production writes happen through the DataConnect SDK with parameterized queries; arbitrary SQL writes are intentionally not exposed to avoid bypassing the safety nets.
How are columns named?
GenMB names every PostgreSQL column in camelCase (for example createdAt and updatedAt), including the created and updated timestamps it adds for you. If you describe columns in plain English in chat, GenMB handles the exact naming so your app and its data stay in sync.
Can each user see only their own rows?
Yes - ask for it in chat (for example, "only let each user see their own tasks") and GenMB writes your app so it tags each record with its owner and filters every read by the signed-in user. This scoping lives in your app's code, so keep it in mind if you edit those queries by hand. Database-level row-level security (enforced by the server regardless of app code) is built into the platform but not switched on yet.

Ready to build?

Create your first app for free, no credit card required.