Dokwe DB
On this page
Dokwe DB gives you a Postgres database with a ready-made backend in front of it. Dokwe runs PostgREST to turn your tables into a REST API, and can add GoTrue for user sign-up and login, plus Realtime for live change events.
What you get#
Each Dokwe DB project bundles:
- Postgres 16. Created as a normal managed service named
<slug>-pg. - PostgREST. Serves a REST API for the
publicschema, with a connection pool you can resize. - API keys. An
anonkey and aservice_rolekey, both JWTs signed with a secret for that project. - Realtime (
supabase/realtime). Started when the project comes up. It streams row changes for the tables you subscribe. - Authentication (
supabase/gotrue). Off by default. Turn it on from the Authentication tab.
In the dashboard, the project page has these tabs: Table Editor, SQL Editor, API, Authentication, Realtime, Storage, Policies, Performance, Types, and Settings.
Dokwe DB or a plain Postgres service#
Choose a managed Postgres service when your own backend talks to the database through a driver or ORM. You get a connection string and nothing else.
Choose Dokwe DB when you want to call the database over HTTP without writing a backend, from a frontend or mobile app for example, with row-level security and user auth.
Create a project#
Open Dokwe DB#
In the dashboard, open Dokwe DB and start a new database.
Name it#
Enter a name. The slug is filled in for you, and you can edit it. Optionally set the database name. If you leave it empty, Dokwe uses the slug with hyphens replaced by underscores.
Choose a deploy target#
Pick Dokwe Platform or one of your connected servers. See Bring your own server.
Wait for provisioning#
The project starts in
provisioning. Dokwe creates Postgres and theanon,service_role, andauthenticatorroles, then starts PostgREST. When it's done, the status changes torunning.
API keys and JWTs#
| Key | Postgres role | Where to use it |
|---|---|---|
anon key | anon | Client-side. Limited by row-level security. |
service_role key | service_role | Server-side only. Bypasses row-level security. |
| JWT secret | none | Signs both keys. Server-side only. |
Find the keys on the API tab. Rotating the keys creates a new JWT secret and signs both keys again. The old keys stop working right away, so update your clients before you rotate.
New tables in public are readable by the anon role by default. Anyone with the anon key can read them until you turn on row-level security and add policies. Do this from the Policies tab or the table editor before you go live.
Quick start#
Create a table#
In the SQL Editor, run:
sqlcreate table todos ( id bigint generated always as identity primary key, title text not null, done boolean not null default false );Copy the API URL and key#
Open the API tab and copy the API URL and the
anonkey.Each project gets its own HTTPS addresses, on Dokwe's servers or yours:
Service Address REST API https://<slug>-api.dokwe.comSign-in (once turned on) https://<slug>-auth.dokwe.comRealtime wss://<slug>-rt.dokwe.com/socketCall the API#
PostgREST serves each table at
/<table>. Send the key as a bearer token:bashcurl "$POSTGREST_URL/todos?select=*" \ -H "Authorization: Bearer $ANON_KEY"To insert rows, use the
service_rolekey from your server. Or turn on row-level security and add a policy that allows theanonrole to insert.
Authentication#
Turn on auth from the Authentication tab. Dokwe starts a GoTrue container and runs its migrations in your database. From there you can set the site URL, configure email (SMTP), SMS (Twilio), and OAuth providers, adjust security settings, and manage users and sessions.
Turning auth off stops the container. Users in auth.users stay in the database. Your policies can call the helpers auth.uid(), auth.role(), and auth.email(), which read the request's JWT claims.
Realtime#
On the Realtime tab, choose which public tables send change events. Dokwe adds or removes each table from the supabase_realtime publication without restarting anything. Turning Realtime on sets Postgres to stream changes (wal_level=logical), which restarts the database once. Connect with @supabase/realtime-js to the Realtime address, passing the anon key as apikey. If a project has no running Realtime container, choose Provision Realtime (or Retry provision after an error) to start one.
Full API reference#
Every platform endpoint is listed in the Dokwe DB API reference. That includes tables, rows, CSV import and export, raw SQL, policies, auth, realtime, storage, and insights. For file storage, see Storage.