Database (Advanced)
Migrations, column-naming contract, the back-compat alias map, and where row-level security 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.
Column Naming
Every Postgres column is quoted camelCase. The provisioner enforces this for both your declared columns and the auto-injected createdAt / updatedAt stamps it adds when you do not declare them yourself.
"createdAt") to match what is actually in the database.Back-Compat Aliases
For tables provisioned before 2026-05 (when the camelCase contract landed), and for any caller still emitting snake_case names, an alias map is applied in the DataConnect read path: created_at → createdAt, updated_at → updatedAt. The alias is suppressed when the user's schema declares the snake_case name itself.
Row-Level Security
A Postgres RLS DDL builder ships in the platform but is not on by default. Until it is feature-flagged on, you enforce per-row access in handler code: read the signed-in user from window.genmb.auth and gate on row.userId === user.id or via your RBAC role.
Stuck Schemas
If a schema lands in pending or failed, the DataConnect router auto-recovers on the first SDK request in production by re-running provisioning. Local dev does not auto-recover; use the Cloud SQL Auth Proxy snippet in the backend CLAUDE.md to re-provision manually.
See Database & Schema for the basic workflow.
FAQs
When do I need this page vs /docs/database?▾
Can I run raw SQL?▾
What is the column-naming contract?▾
Is row-level security (RLS) available?▾
Ready to build?
Create your first app for free, no credit card required.