Skip to main content

Data

Every project gets its own Postgres database and its own file storage, with no setup and no credentials in app code. Access is decided per signed-in person: Postgres row-level security for rows, and ownership rules plus app roles for files.

How data access works​

You useRuns asRow-level security
tc.db.from(...) in the browser (the Data API)The signed-in person (tc_user)Applies
tc.db.asUser(req) in server codeThe signed-in personApplies
tc.db.sql or DATABASE_URL in server code and jobsThe project's service roleBypassed
The Studio in the consoleThe project's owner roleBypassed (it's for builders)
tc.storage in the browser or with the requestThe signed-in personOwnership rules and app roles apply
tc.storage in jobsThe appManages every file
Was this page helpful?