Database credentials and permissions
MyAppBuilder uses up to three separate database users per environment, so each job only has the permissions it needs. Credentials are encrypted on the server, never stored in your app definition and never sent back to the browser. This feature is in beta .
Beta — ready to use, but some details may still change.
MyAppBuilder uses up to three separate database users per environment, so each job only has the permissions it needs. Credentials are encrypted on the server, never stored in your app definition and never sent back to the browser. This feature is in beta.
The three users
| Credential | Used for | Needs |
|---|---|---|
| Inspection (read-only) | Reading the structure: schemas, tables, columns, keys, approximate row counts | Read access to the catalog. No access to business rows is required for inspection |
| Migration | Applying the migrations you approve, and copying data during an import | Create and alter objects in the managed namespace only; read the source tables you import |
| Runtime | The published app reading and writing records | Read and write rows in the managed namespace (and in existing tables you mapped); no permission to change structure |
Start with the inspection user alone. You only need the migration user when you let MyAppBuilder apply migrations, and the runtime user before you publish.
PostgreSQL example
The wizard's Show setup instructions generates this SQL for your project's namespace. The example below uses mab_7f3a2c; replace the passwords with strong values of your own.
-- Inspection: read-only CREATE ROLE mab_inspect LOGIN PASSWORD 'change-me'; GRANT CONNECT ON DATABASE production TO mab_inspect; GRANT USAGE ON SCHEMA public TO mab_inspect; -- Migration: owns the managed namespace, reads the tables you import CREATE ROLE mab_migrate LOGIN PASSWORD 'change-me'; GRANT CONNECT ON DATABASE production TO mab_migrate; CREATE SCHEMA IF NOT EXISTS mab_7f3a2c AUTHORIZATION mab_migrate; GRANT USAGE ON SCHEMA public TO mab_migrate; GRANT SELECT ON public.customers, public.orders TO mab_migrate; -- Runtime: rows only, no structure changes CREATE ROLE mab_app LOGIN PASSWORD 'change-me'; GRANT CONNECT ON DATABASE production TO mab_app; GRANT USAGE ON SCHEMA mab_7f3a2c TO mab_app; ALTER DEFAULT PRIVILEGES FOR ROLE mab_migrate IN SCHEMA mab_7f3a2c GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO mab_app; ALTER DEFAULT PRIVILEGES FOR ROLE mab_migrate IN SCHEMA mab_7f3a2c GRANT USAGE, SELECT ON SEQUENCES TO mab_app;
If you use existing tables, also grant the runtime user SELECT, INSERT, UPDATE, DELETE on exactly those tables.
On Supabase, run the same statements in the SQL editor. See Connect Supabase for pooling notes.
Other databases
MySQL, MariaDB and SQL Server are planned. There are no setup instructions for them yet; see Other databases.
Rotating a password
Change the password in your database, then open Data → Data sources → Production database → Manage credentials, enter the new value for that credential, test and save. The old value is replaced on the server.