PreviewRustaBase OSS is in public preview. Build on managed PostgreSQL with APIs, authentication, storage, realtime, and server-side functions.Read the product direction

Data and users

Tables

Model application data with PostgreSQL tables, typed fields, relations, indexes, validation, and access rules, all from the Project console.

Table types

TypeUse it for
BaseOrdinary application data such as posts, orders, or products
AuthApplication users who sign in, with your own profile fields added
ViewRead-only results of a SQL query, such as reports or summaries

Create a table

  1. Open your Project and select Tables.
  2. Select New table and choose Base, Auth, or View.
  3. Add fields. Each field has a type and options such as required, unique, or a maximum length.
  4. Add relation fields to link records in other tables.
  5. Add indexes for fields you filter, sort, or join on.
  6. Set the API rules for list, view, create, update, and delete before any app uses the table.
  7. Save. The table's REST endpoints are ready at once. Open API Preview to see them.

Field types

  • Text, number, boolean, email, URL, and date
  • Select (one or many fixed options) and JSON
  • File (one or many uploads) and relation (links to other records)
  • Geographic point, password, and automatic created/updated dates

API rules

Each rule is a filter that must match for the request to be allowed. Leave a rule empty to allow everyone, or lock it to allow only superusers and API keys.

RuleExampleMeaning
List / View@request.auth.id != ""Only signed-in users
Update / Deleteowner = @request.auth.idOnly the record's owner
Create@request.body.owner = @request.auth.idUsers can only create records for themselves

Changing a table later

Renaming or deleting a field changes live data and can break apps that use it. Take a backup and update your app before changing tables that are already in production.

Add authentication

Found something wrong on this page?

Fix it yourself. The link below opens this file in GitHub's editor and forks the repository for you if you need one, and your change becomes a pull request without leaving the browser.