Banca dati
Cosa offre il prodotto Database a un progetto, come il tuo codice lo raggiunge e dove andare poi: primi passi, concetti e guide.
What you get#
Each project has its own PostgreSQL 18 database. Your tables live in one schema of that database, named after the project, and the platform keeps its own data (users, files, settings) in separate schemas that your code does not reach.
aura db raw "select current_setting('server_version_num')::int / 10000 as postgres_major" postgres_major
──────────────
18
ℹ 1 row(s).- Row level security by default. Every table created through Aurabase (SDK table API,
aura db raw, migrations, the Studio) gets row level security enabled. Until you add a policy, the public key reads no row. - Plain PostgreSQL. Views, functions, triggers, indexes and policies are standard PostgreSQL objects. Thirteen extensions are installed when a project is created on the cluster of its organization, and
pg_graphqlis installed when you enable GraphQL. - Isolated by role. Each kind of caller reaches PostgreSQL as a different role:
aura_anonfor the public key,aura_authenticatedfor a signed-in user, a role that bypasses RLS for theservice_rolekey. Policies read the user fromauth.uid(). - Branches.
aura branch createcopies a project, schema and rows, into a new project with its own URL and keys. It is a copy made at creation time, not a live replica.
Three ways in#
Browser, server ──▶ SDK or REST ──▶ gateway ──▶ PostgREST of the project ──▶ PostgreSQL
CLI, backend, CI ──▶ aura db raw ──▶ gateway ──▶ aura-db (SQL check) ──▶ PostgreSQL
psql, ORM, BI ──▶ TLS :5432 ──▶ router ──▶ pooler of the cluster ──▶ PostgreSQLThe first path is the one your application uses. The second runs SQL with the service_role key, after a check that refuses a list of statements. The third is a plain PostgreSQL connection with a role of its own. How a request reaches Postgres follows each path step by step.
Start here#
- Quickstart
A table, a policy, and rows written and read by a signed-in user, in ten minutes.
- Connect to your database
SDK, REST, psql or an ORM: which one fits where your code runs.
- Example schema
The tables, view and function every Database page uses in its examples.
- Run SQL from the CLI or a server
aura db raw, the /raw endpoint, db.sql(), and the statements they refuse.
Concepts#
- Project isolation
One database per project, schemas, and what keeps projects apart.
- How a request reaches Postgres
Gateway, PostgREST, aura-db and the pooler, and where the claims come from.
- Roles, keys and RLS bypass
What each key becomes inside PostgreSQL, and which roles bypass RLS.
- Connection pooling and limits
Who pools connections, and the limits of each plan.
- Shared and dedicated clusters
The cluster of your organization, and the dedicated cluster of Team and Enterprise.
- How extensions are installed
Installed at creation, allowed on request, and why CREATE EXTENSION is refused.
Guides and reference#
- Row-level security
Owner, multi-tenant and organization policies.
- Query with the SDK
Filters, joins, inserts and updates from JavaScript.
- Generate TypeScript types
Types for tables, views and functions from the live schema.
- Performance audit
Slow queries and indexes.
- Database CLI reference
Every aura db command with its options.
- NoSQL document store
The MongoDB engine for projects that need it.
- REST API
The HTTP surface behind the SDK, for Database, Auth and Storage.
- Conventions
Naming of schemas, columns and policies, and the auth helpers.
- Architecture
How aura-db fits among the services of the platform.
- Migrate from Supabase
Move a Supabase project, schema, data and policies.
In the Studio#
The Database section of a project opens the table editor of a PostgreSQL project, or the collections of a MongoDB project. Its pages:
/<project-id>/database opens the table editor (PostgreSQL) or the collections (MongoDB)
/<project-id>/database/sql/table-editor browse and edit rows, create tables and columns
/<project-id>/database/sql/editor SQL editor (the same endpoint as aura db raw)
/<project-id>/database/sql/schema tables, views and functions of the project schema
/<project-id>/database/extensions installed extensions
/<project-id>/database/backups backups and restoresThe direct connection card (host, role, password) is under Settings › Connection, and the API keys under Settings › API keys.