The data model
What the engine stores in your database, table by table, the roles it creates, and how row-level security ties them together.
On this page
The engine’s tables live in two schemas of your own database. Your tables live wherever you put them; they only meet the engine’s through sypnia_auth.users(id) and the helper functions.
users: one row per person, identity only.sessions: one per signed-in device or machine sign-in, with its policy.oauth_clients: one per machine allowed to ask for tokens.
sypnia_auth
| Table | Holds | Secrets stored as |
|---|---|---|
users | e-mail, phone, password hash, confirmation times, app_metadata (server only), user_metadata (the user’s), banned_until, deleted_at | argon2id |
identities | each way a user signs in: e-mail, Google, GitHub | — |
sessions | user or client, the policy that applied, aal, last refresh, not_after, user agent, IP prefix | — |
refresh_tokens | one row per token, its session and its parent (the rotation chain), revoked_at | SHA-256 |
one_time_tokens | confirmation, recovery, magic link, invite, e-mail change, reauthentication; attempts and expiry | SHA-256 |
flow_state | the PKCE state of provider sign-ins and authorization codes | SHA-256 |
oauth_clients | machines: authentication method, public keys, scopes, resources, DPoP, policy | argon2id (secrets) |
assertion_jti | client assertion ids already used, until they expire | — |
device_codes | pending device-flow approvals | SHA-256 |
personal_access_tokens | owner, name, scopes, expiry, last use | SHA-256 |
api_keys | publishable and secret keys | SHA-256 (secret) |
rate_limits | counters per window and key | — |
audit_log | every auth event | — |
sypnia_data
| Table | Holds |
|---|---|
migrations | applied migrations: version, name, checksum, when, by whom |
sql_audit | statements run through the SQL endpoint |
settings | the project’s settings: session policy, providers, e-mail, templates, limits (credentials encrypted) |
signing_keys | Ed25519 key pairs; the private half encrypted with the project’s data key |
Roles
anon, authenticated, service_role NOLOGIN requests run as one of these
sypnia_authenticator LOGIN the engine's connection: no rights, member of the three above (NOINHERIT)
sypnia_admin owner of your schemas; SQL endpoint and migrationssypnia_authenticator can do nothing until the engine runs set local role for a request; then it has exactly that role’s rights, and your row-level security applies.