@quickback-dev/cli 0.48.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +13 -2
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/migrations.d.ts +10 -0
- package/dist/commands/migrations.d.ts.map +1 -1
- package/dist/commands/migrations.js +113 -79
- package/dist/commands/migrations.js.map +1 -1
- package/dist/commands/migrations.test.js +96 -1
- package/dist/commands/migrations.test.js.map +1 -1
- package/dist/docs/content.js +9 -9
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/skill/docs/changelog.md +84 -0
- package/dist/skill/docs/compiler/config/providers.md +23 -2
- package/dist/skill/docs/compiler/definitions/actions.md +12 -2
- package/dist/skill/docs/compiler/definitions/encryption.md +2 -0
- package/dist/skill/docs/compiler/definitions/schema.md +2 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +306 -35
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +14 -8
- package/dist/skill/docs/stack/realtime/durable-objects.md +143 -4
- package/dist/skill/docs/stack/webhooks/outbound.md +23 -0
- package/package.json +1 -1
- package/src/skill/docs/changelog.md +84 -0
- package/src/skill/docs/compiler/config/providers.md +23 -2
- package/src/skill/docs/compiler/definitions/actions.md +12 -2
- package/src/skill/docs/compiler/definitions/encryption.md +2 -0
- package/src/skill/docs/compiler/definitions/schema.md +2 -0
- package/src/skill/docs/compiler/targets/hono-api/database/neon.md +306 -35
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +14 -8
- package/src/skill/docs/stack/realtime/durable-objects.md +143 -4
- package/src/skill/docs/stack/webhooks/outbound.md +23 -0
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Neon PostgreSQL reaches deploy parity with D1 (v0.50)
|
|
6
|
+
|
|
7
|
+
A Neon-backed service now compiles, typechecks, migrates, and deploys with the
|
|
8
|
+
same capability surface as a D1 service — over HTTP (`@neondatabase/serverless`),
|
|
9
|
+
the Cloudflare default. There is no Hyperdrive binding and no Neon Authorize /
|
|
10
|
+
JWKS configuration: the Worker verifies each caller, then writes the trusted
|
|
11
|
+
user/org/team context into transaction-local Postgres settings
|
|
12
|
+
(`set_config('request.jwt.claim.sub' | 'org_id' | 'team_id', …, true)`) as the
|
|
13
|
+
first statement of every query batch. RLS reads them through a compiler-defined
|
|
14
|
+
`auth.user_id()` shim and the `get_active_org_id()` helper — **not** a persisted
|
|
15
|
+
`user_sessions` mirror (which never shipped).
|
|
16
|
+
|
|
17
|
+
- **Background contexts run under a service-role handle.** Queue consumers, cron
|
|
18
|
+
schedules, and cross-tenant `unsafe` actions acquire `createServiceDb(env)`,
|
|
19
|
+
which sets `quickback.service_role = 'true'` (all request claims cleared);
|
|
20
|
+
every feature table carries a `<table>_service_role` RLS policy admitting
|
|
21
|
+
exactly that context. Unsafe-action audit events are unchanged.
|
|
22
|
+
- **Webhooks port to a `webhooks` Postgres schema** in the same database (no
|
|
23
|
+
`WEBHOOKS_DB` binding). `webhooksBinding` is a pure enable flag on Neon; the
|
|
24
|
+
D1-only `webhooksDatabaseId` / `webhooksDatabaseName` keys are rejected. The
|
|
25
|
+
store is service-role-only.
|
|
26
|
+
- **`.encrypted()` / `.sealed()` columns are supported** on Neon over HTTP: the
|
|
27
|
+
key/vault tables fold into the journaled migration set with org-scoped and
|
|
28
|
+
service-role-only RLS.
|
|
29
|
+
- **Batch transactions advertise the truth.** Neon HTTP is fail-fast and
|
|
30
|
+
non-transactional (`meta.transactional: false`, like D1) because
|
|
31
|
+
`drizzle-orm/neon-http` has no interactive transactions; Neon WebSocket
|
|
32
|
+
(Node/Bun) gets real rollback (`meta.transactional: true`).
|
|
33
|
+
- **Deploy glue matches D1:** a generated `deploy` script
|
|
34
|
+
(`npm run db:migrate && wrangler deploy`), a boot check asserting
|
|
35
|
+
`DATABASE_URL`, `.dev.vars.example` (wrangler dev reads `.dev.vars`, not
|
|
36
|
+
`.env`) gitignored, and `drizzle.config.ts` preferring
|
|
37
|
+
`DATABASE_MIGRATION_URL ?? DATABASE_URL` for the privileged migration role.
|
|
38
|
+
- **Fail-closed capability gates:** managed file storage (use presign-only R2),
|
|
39
|
+
the Better Auth `subscriptions` plugin, raw `sqliteTable` interop sources on a
|
|
40
|
+
Postgres target, and — under WebSocket mode — webhooks / unsafe actions /
|
|
41
|
+
encrypted columns are all compile-time errors rather than silently-broken
|
|
42
|
+
output. Mixed database providers remain unsupported.
|
|
43
|
+
- **Docs corrected:** the [Neon page](/compiler/targets/hono-api/database/neon)
|
|
44
|
+
no longer describes Neon Authorize, a `user_sessions` table, or Hyperdrive —
|
|
45
|
+
none of which the compiler emits.
|
|
46
|
+
|
|
47
|
+
### Realtime identity tags — one send reaches a person on either auth door (v0.49)
|
|
48
|
+
|
|
49
|
+
WebSocket connections now carry **identity tags**, proven at ticket mint and
|
|
50
|
+
signed into the ws-ticket (never client-supplied): `user:<userId>` for every
|
|
51
|
+
Better Auth caller, plus `scope:<kind>:<subjectId>` whenever a scope subject is
|
|
52
|
+
proven — on **either** door. A sessionless scope principal's claim and a Better
|
|
53
|
+
Auth caller's matched relationship lane stamp the **identical** subject-keyed
|
|
54
|
+
tag (both derive from the same relationship row), so senders no longer
|
|
55
|
+
double-send per recipient to cover `subject: 'both'` roles.
|
|
56
|
+
|
|
57
|
+
- **`targetTags` on every send** (`realtime.broadcast`, `realtime.insert`, …):
|
|
58
|
+
delivery is the deduplicated union of the runtime's indexed
|
|
59
|
+
`getWebSockets(tag)` lookup — no per-frame attachment scan. Replaces the
|
|
60
|
+
`userId` identity arm when present; the scope/org bind and `targetRoles`
|
|
61
|
+
audience still apply.
|
|
62
|
+
- **Fail-closed:** `targetTags: []` delivers to nobody, consistent with the
|
|
63
|
+
empty-audience rule.
|
|
64
|
+
- Tags are immutable for a socket's lifetime (hibernation-tag semantics);
|
|
65
|
+
limits (10/socket, 256 chars) are validated at mint — rejected, never
|
|
66
|
+
truncated.
|
|
67
|
+
|
|
68
|
+
### Realtime authorization lease — hibernated sockets no longer outlive revocation (v0.49)
|
|
69
|
+
|
|
70
|
+
A ws-ticket was verified once at upgrade, and DO hibernation kept the socket
|
|
71
|
+
authorized forever — bans, member removal, and subject revocation never touched
|
|
72
|
+
a live connection. Connections now carry a delivery-time **authorization
|
|
73
|
+
lease** (default **15 minutes**, from ticket `iat`):
|
|
74
|
+
|
|
75
|
+
- The fan-out skips expired connections (they receive nothing) and closes them
|
|
76
|
+
with code **4401**; inbound messages — even pings — are enforced the same way.
|
|
77
|
+
- **In-place renewal:** `{ type: "reauth", ticket: "<fresh ws-ticket>" }`
|
|
78
|
+
extends the lease and refreshes roles without socket churn. Renewal is
|
|
79
|
+
strict — same `userId`, same scope/org, exact same tag set (tags are
|
|
80
|
+
immutable); identity drift closes with 4401 → reconnect fresh.
|
|
81
|
+
- Renewal tickets come from `POST /broadcast/v1/ws-ticket`, which re-runs the
|
|
82
|
+
**full** authorization gate (session, KV revocation, relationship/scope-claim
|
|
83
|
+
probes) — so revocation propagates within one lease period, with no KV reads
|
|
84
|
+
in the Durable Object.
|
|
85
|
+
- Configure via `realtime: { lease: '15m' | seconds | false }` (min 60s;
|
|
86
|
+
`false` disables — discouraged). Clients that never reauth degrade gracefully
|
|
87
|
+
to one forced reconnect per lease.
|
|
88
|
+
|
|
5
89
|
### Realtime broadcasts are fail-closed — explicit per-resource audience (BREAKING)
|
|
6
90
|
|
|
7
91
|
Realtime broadcasting is now opt-in **per resource** with a **mandatory audience**,
|
|
@@ -64,7 +64,13 @@ Two databases are supported, both Cloudflare-native:
|
|
|
64
64
|
| Provider | Description |
|
|
65
65
|
|----------|-------------|
|
|
66
66
|
| `cloudflare-d1` | Cloudflare D1 (SQLite at the edge) |
|
|
67
|
-
| `neon` | Neon
|
|
67
|
+
| `neon` | Neon serverless PostgreSQL (`@neondatabase/serverless` over HTTP) |
|
|
68
|
+
|
|
69
|
+
One database provider per app: auth tables and feature tables always share the
|
|
70
|
+
selected database. On `neon`, Better Auth uses its PostgreSQL/Drizzle adapter
|
|
71
|
+
in the same Postgres database as your features; on `cloudflare-d1`, both use
|
|
72
|
+
D1. A per-service map (`database: { auth: ..., features: ... }`) is rejected at
|
|
73
|
+
compile time — mixed database providers are not supported.
|
|
68
74
|
|
|
69
75
|
```typescript
|
|
70
76
|
import { defineDatabase } from "@quickback/compiler";
|
|
@@ -80,12 +86,16 @@ providers: {
|
|
|
80
86
|
|
|
81
87
|
### Database Options
|
|
82
88
|
|
|
89
|
+
Options from `splitDatabases` down apply to `cloudflare-d1` only — Neon uses a
|
|
90
|
+
single Postgres database with no bindings or split mode (see
|
|
91
|
+
[Neon options](#neon-options) below).
|
|
92
|
+
|
|
83
93
|
| Option | Type | Default (D1) | Description |
|
|
84
94
|
|--------|------|---------|-------------|
|
|
85
95
|
| `generateId` | `string \| false` | `"prefixed"` | ID generation strategy |
|
|
86
96
|
| `namingConvention` | `string` | `"snake_case"` | Column naming convention |
|
|
87
97
|
| `usePlurals` | `boolean` | `false` | Pluralize auth table names (e.g. `user` vs `users`) |
|
|
88
|
-
| `splitDatabases` | `boolean` | `true` | Separate auth and features databases |
|
|
98
|
+
| `splitDatabases` | `boolean` | `true` | Separate auth and features databases (D1 only) |
|
|
89
99
|
| `authBinding` | `string` | `"AUTH_DB"` | Binding name for auth database |
|
|
90
100
|
| `featuresBinding` | `string` | `"DB"` | Binding name for features database |
|
|
91
101
|
| `databaseId` | `string` | — | D1 database ID for the features database (used in generated wrangler.toml) |
|
|
@@ -100,6 +110,17 @@ providers: {
|
|
|
100
110
|
| `realtime` | `boolean \| { enabled?, wsTicket? }` | `false` | Enables the Broadcaster Durable Object and optional resource-scoped ws-ticket auth (see [below](#realtime-broadcast-config)) |
|
|
101
111
|
| `webhookAdminRoles` | `string[]` | `["owner", "admin"]` | Org roles allowed to manage webhook endpoints |
|
|
102
112
|
|
|
113
|
+
#### Neon Options
|
|
114
|
+
|
|
115
|
+
| Option | Type | Default | Description |
|
|
116
|
+
|--------|------|---------|-------------|
|
|
117
|
+
| `connectionMode` | `"auto" \| "http" \| "websocket"` | `"auto"` | How the generated runtime connects (`auto` detects the runtime) |
|
|
118
|
+
| `pooled` | `boolean` | `true` | Use the pooled Neon connection string (recommended for Workers) |
|
|
119
|
+
|
|
120
|
+
The Worker connects through a single `DATABASE_URL` secret — auth and feature
|
|
121
|
+
queries share it. See [Neon](/compiler/targets/hono-api/database/neon) for
|
|
122
|
+
connection modes, RLS, and the migration workflow.
|
|
123
|
+
|
|
103
124
|
#### Audit Database
|
|
104
125
|
|
|
105
126
|
Cross-tenant `unsafe` actions (see [Actions → Unsafe mode](/compiler/definitions/actions#unsafe-mode)) write mandatory audit events. Those events land in a dedicated D1 database — separate from your features DB — so audit history stays isolated from application data and can't be tampered with through a normal CRUD route.
|
|
@@ -309,9 +309,9 @@ land in `success[]` masked the same way the single-record response is.
|
|
|
309
309
|
|
|
310
310
|
| Provider | failFast | transactional | Behavior |
|
|
311
311
|
|---|---|---|---|
|
|
312
|
-
|
|
|
312
|
+
| tx-supporting (postgres, neon over websocket) | `true` | `true` | `db.transaction()` wraps the loop; any throw rolls back all writes |
|
|
313
313
|
| (any) | `false` | `false` | Independent per-record outcomes, partial success |
|
|
314
|
-
| cloudflare-d1 | `true` | `false` | Fail-fast loop without rollback — earlier records stay committed (
|
|
314
|
+
| cloudflare-d1, neon over http (Cloudflare default) | `true` | `false` | Fail-fast loop without rollback — earlier records stay committed (the driver has no `db.transaction`; `drizzle-orm/neon-http` throws at runtime) |
|
|
315
315
|
|
|
316
316
|
**Constraints:**
|
|
317
317
|
|
|
@@ -694,6 +694,16 @@ Unsafe cross-tenant actions are generated with:
|
|
|
694
694
|
- sysadmin gate (`ctx.userRole === "sysadmin"`)
|
|
695
695
|
- mandatory audit logging on deny/success/error
|
|
696
696
|
|
|
697
|
+
**Provider note (Neon):** on Neon the request-scoped db enforces Row Level
|
|
698
|
+
Security with the *caller's* org claims, which would filter out exactly the
|
|
699
|
+
cross-tenant rows unsafe actions exist to reach. Unsafe handlers therefore
|
|
700
|
+
acquire a dedicated service-role handle (`createServiceDb`) that sets the
|
|
701
|
+
`quickback.service_role` transaction marker instead of caller claims; the
|
|
702
|
+
generated RLS grants that context an explicit per-table bypass policy. The
|
|
703
|
+
audit-logging contract is identical to D1. Neon with
|
|
704
|
+
`connectionMode: 'websocket'` does not support unsafe actions yet and fails
|
|
705
|
+
the compile with a descriptive error.
|
|
706
|
+
|
|
697
707
|
`PUBLIC` actions also receive mandatory audit logging (same audit table), since unauthenticated endpoints are high-risk by nature.
|
|
698
708
|
|
|
699
709
|
Without unsafe mode, `unsafeDb` is `undefined` in the executor params.
|
|
@@ -45,6 +45,7 @@ Ciphertext cannot be queried, so encrypted columns are **excluded from every que
|
|
|
45
45
|
- Never an `embeddings.fields` source (embedding a value ships its plaintext to the model)
|
|
46
46
|
- The table must carry a `q.scope('organization')` column — keys are per-organization
|
|
47
47
|
- Text-shaped columns only (v1)
|
|
48
|
+
- Database provider must be **Cloudflare D1** or **Neon over HTTP** (the Cloudflare default). Anything else — including Neon's websocket mode — is a compile error, never silently-plaintext output. On Neon, `org_data_keys` lives in the `app` Postgres schema with org-scoped row-level security: a request-scoped connection can read and lazily create exactly its own organization's wrapped-key row; rotation and crypto-shredding are service-role operations.
|
|
48
49
|
|
|
49
50
|
Encrypted columns **may** appear in view projections and responses — they decrypt through the generated prepare path. Masking composes on top as defense-in-depth.
|
|
50
51
|
|
|
@@ -168,6 +169,7 @@ Sealed values are opaque references at rest, so they're fenced off from every su
|
|
|
168
169
|
- The table **must** carry a `q.scope('organization')` column — keys are per-scope.
|
|
169
170
|
- Reading a sealed column server-side is a **type error**: the column is branded `$type<SealedValue>()`, an opaque non-string, so `db.select()` on it won't typecheck. The server's structural inability to read it is enforced by `tsc`, not convention.
|
|
170
171
|
- Sealed projects **force-enable** KV-backed JWT revocation (so a revoked reader's in-flight reveal token dies); a project with sealed columns and no KV binding **fails to compile**.
|
|
172
|
+
- Database provider must be **Cloudflare D1** or **Neon over HTTP** (the Cloudflare default) — anything else fails to compile. On Neon, the seal/vault tables carry **deny-all row-level security for request connections**: only the worker-internal service-role lane (the generated `/seal/v1` routes, `ctx.seal`, and the sealed write chokepoint) can touch them, and every one of those queries is still explicitly organization-scoped.
|
|
171
173
|
|
|
172
174
|
## What this tier does and doesn't claim
|
|
173
175
|
|
|
@@ -208,6 +208,8 @@ Default to `feature()`. Drop to Drizzle only when:
|
|
|
208
208
|
|
|
209
209
|
Features in the same project may mix freely — Quickback dispatches per feature — so one interop table doesn't force the rest of the project off `feature()`.
|
|
210
210
|
|
|
211
|
+
One dialect rule: interop files **without** a `defineTable(...)` default export (internal child tables) are not dialect-translated — author them in the target database's dialect. On Postgres providers (Neon, Supabase), a `sqliteTable` interop source without `defineTable` is a compile-time error; write it with `pgTable` from `drizzle-orm/pg-core` instead. Sources **with** `defineTable(...)` keep compiling across dialects automatically.
|
|
212
|
+
|
|
211
213
|
### Drizzle Column Types
|
|
212
214
|
|
|
213
215
|
Drizzle supports all standard SQL column types:
|
|
@@ -6,10 +6,25 @@ Neon provides serverless PostgreSQL that works with Cloudflare Workers via HTTP
|
|
|
6
6
|
|
|
7
7
|
- **Full PostgreSQL** — Advanced queries, joins, PostGIS, full-text search
|
|
8
8
|
- **Database-level security** — RLS policies enforce access even if the API is bypassed
|
|
9
|
-
- **Serverless** — HTTP connection mode for Cloudflare Workers
|
|
10
|
-
- **
|
|
9
|
+
- **Serverless** — HTTP connection mode (`@neondatabase/serverless`) for Cloudflare Workers
|
|
10
|
+
- **Worker-scoped RLS** — the Worker verifies each caller, then writes the trusted user/org/team context into transaction-local Postgres settings that RLS policies read (see [How Worker-scoped RLS works](#how-worker-scoped-rls-works))
|
|
11
11
|
- **Better Auth integration** — Works seamlessly with the Quickback auth provider
|
|
12
12
|
|
|
13
|
+
## One database for auth and features
|
|
14
|
+
|
|
15
|
+
Quickback uses a single database provider per app. On Neon, Better Auth tables
|
|
16
|
+
and feature tables live in the same Postgres database: Better Auth runs on its
|
|
17
|
+
PostgreSQL/Drizzle adapter, and everything connects through one `DATABASE_URL`.
|
|
18
|
+
There is no `AUTH_DATABASE_URL`, and split-database mode is a D1-only option.
|
|
19
|
+
|
|
20
|
+
Mixing providers — for example D1 for auth with Neon for features — is not
|
|
21
|
+
supported. The per-service config form is rejected at compile time:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
providers.database service-map form is not supported in v2.
|
|
25
|
+
Configure one database provider; auth and feature data use the same database.
|
|
26
|
+
```
|
|
27
|
+
|
|
13
28
|
## Configuration
|
|
14
29
|
|
|
15
30
|
```typescript title="quickback/quickback.config.ts"
|
|
@@ -33,40 +48,150 @@ export default defineConfig({
|
|
|
33
48
|
| Mode | Best for | How it works |
|
|
34
49
|
|------|----------|--------------|
|
|
35
50
|
| **HTTP** | Cloudflare Workers, edge functions | Stateless HTTP queries via `@neondatabase/serverless` |
|
|
36
|
-
| **WebSocket** | Node.js, Bun | Persistent WebSocket connection
|
|
37
|
-
| **Auto** (default) | Mixed environments | Detects runtime
|
|
51
|
+
| **WebSocket** | Node.js, Bun | Persistent WebSocket connection (`drizzle-orm/neon-serverless`) |
|
|
52
|
+
| **Auto** (default) | Mixed environments | Detects runtime: `http` on `cloudflare`, `websocket` on Node/Bun |
|
|
53
|
+
|
|
54
|
+
On the Cloudflare runtime, `auto` resolves to **HTTP** — this is the mode the
|
|
55
|
+
rest of this page assumes. The generated Worker uses `@neondatabase/serverless`
|
|
56
|
+
over HTTP; there is no Hyperdrive binding.
|
|
57
|
+
|
|
58
|
+
> HTTP mode is the fully-featured path. WebSocket mode gets real interactive
|
|
59
|
+
> transactions (see [Batch transactions](#batch-transactions)), but it does
|
|
60
|
+
> **not** support webhooks, cross-tenant `unsafe` actions, or `.encrypted()` /
|
|
61
|
+
> `.sealed()` columns — each of those is a fail-closed compile error under
|
|
62
|
+
> `connectionMode: 'websocket'` because the WebSocket db client does not emit the
|
|
63
|
+
> service-role handle they depend on. Use HTTP mode (the Cloudflare default) for
|
|
64
|
+
> the full capability surface.
|
|
65
|
+
|
|
38
66
|
|
|
39
67
|
## Environment variables
|
|
40
68
|
|
|
69
|
+
Three connection points, each read by a different tool:
|
|
70
|
+
|
|
71
|
+
| Where | File / store | Read by |
|
|
72
|
+
|-------|--------------|---------|
|
|
73
|
+
| Migrations (local/CI) | `.env` | `drizzle-kit` |
|
|
74
|
+
| `wrangler dev` (local Worker) | `.dev.vars` | Wrangler |
|
|
75
|
+
| Production Worker | `wrangler secret put` | The deployed Worker |
|
|
76
|
+
|
|
77
|
+
The compiler emits `.env.neon.example` and `.dev.vars.example` as templates,
|
|
78
|
+
and gitignores `.dev.vars` so local secrets are never committed.
|
|
79
|
+
|
|
41
80
|
```bash
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
#
|
|
81
|
+
# Migrations read .env — copy the template and fill it in:
|
|
82
|
+
cp .env.neon.example .env
|
|
83
|
+
# .env holds:
|
|
84
|
+
# DATABASE_URL — pooled quickback (runtime) role URL
|
|
85
|
+
# DATABASE_MIGRATION_URL — unpooled quickback_admin role URL (optional)
|
|
86
|
+
|
|
87
|
+
# wrangler dev reads .dev.vars (NOT .env) — copy the template:
|
|
88
|
+
cp .dev.vars.example .dev.vars # gitignored; holds DATABASE_URL + BETTER_AUTH_SECRET
|
|
89
|
+
|
|
90
|
+
# Production: secrets live in Worker secrets, never in files:
|
|
91
|
+
npx wrangler secret put DATABASE_URL # pooled quickback role URL
|
|
92
|
+
npx wrangler secret put BETTER_AUTH_SECRET
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`DATABASE_URL` is the only connection string the Worker needs at runtime — auth
|
|
96
|
+
and feature queries share it. `DATABASE_MIGRATION_URL` is used **only** by
|
|
97
|
+
`drizzle-kit`: the generated `drizzle.config.ts` reads
|
|
98
|
+
`process.env.DATABASE_MIGRATION_URL ?? process.env.DATABASE_URL`, so migrations
|
|
99
|
+
run as the privileged `quickback_admin` role when it is set and fall back to
|
|
100
|
+
`DATABASE_URL` when it is not. Never deploy `DATABASE_MIGRATION_URL` to the
|
|
101
|
+
Worker.
|
|
102
|
+
|
|
103
|
+
<Callout>
|
|
104
|
+
The generated setup uses three Postgres roles: `quickback_owner` (NOLOGIN object
|
|
105
|
+
owner for the app/auth schemas), `quickback_admin` (migration/setup actor — use
|
|
106
|
+
its unpooled URL for `DATABASE_MIGRATION_URL`), and `quickback` (the Worker
|
|
107
|
+
runtime role, the **only** deployed DB role — use its pooled URL for
|
|
108
|
+
`DATABASE_URL`). The first generated migration bootstraps these roles as
|
|
109
|
+
NOLOGIN; enable login and set passwords before use. Full walkthrough in the
|
|
110
|
+
generated `docs/neon-setup.md`.
|
|
111
|
+
</Callout>
|
|
112
|
+
|
|
113
|
+
## Better Auth schema generation
|
|
114
|
+
|
|
115
|
+
`src/auth/schema.ts` is owned by the Better Auth CLI. The generated `build`
|
|
116
|
+
script regenerates it before typechecking:
|
|
45
117
|
|
|
46
|
-
|
|
47
|
-
|
|
118
|
+
```bash
|
|
119
|
+
npm run build # runs auth:schema, then tsc
|
|
48
120
|
```
|
|
49
121
|
|
|
122
|
+
`auth:schema` expands to:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx better-auth generate --config ./src/lib/auth.ts --output ./src/auth/schema.ts --yes \
|
|
126
|
+
&& node scripts/quickback-qualify-auth-schema.mjs
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The qualifier script adjusts the CLI output for Postgres schema placement.
|
|
130
|
+
Don't hand-edit `src/auth/schema.ts` — regenerate it instead.
|
|
131
|
+
|
|
50
132
|
## Migrations
|
|
51
133
|
|
|
52
|
-
Neon uses PostgreSQL migrations, distinct from D1's SQLite migrations
|
|
134
|
+
Neon uses PostgreSQL migrations, distinct from D1's SQLite migrations. One
|
|
135
|
+
Drizzle journal covers auth tables, feature tables, indexes, FK/cascade
|
|
136
|
+
semantics, and the RLS layer:
|
|
53
137
|
|
|
54
138
|
```bash
|
|
55
139
|
quickback compile # generates migrations under quickback/drizzle/
|
|
56
|
-
npm run db:migrate # applies
|
|
140
|
+
npm run db:migrate # applies schema AND the RLS layer, in order
|
|
57
141
|
```
|
|
58
142
|
|
|
59
143
|
The RLS layer (helper functions, policies, triggers) rides the same
|
|
60
|
-
journaled migration set as your schema
|
|
144
|
+
journaled migration set as your schema: the compiler appends a
|
|
61
145
|
content-addressed `<idx>_quickback_rls_<hash>` migration, so one
|
|
62
146
|
`db:migrate` applies everything in order. The RLS migration is idempotent
|
|
63
147
|
(`DROP POLICY IF EXISTS` + re-create) and only a *changed* security config
|
|
64
148
|
appends a new entry — recompiles with unchanged security append nothing. No
|
|
65
|
-
manual SQL application step exists
|
|
149
|
+
manual SQL application step exists.
|
|
150
|
+
|
|
151
|
+
## How Worker-scoped RLS works
|
|
152
|
+
|
|
153
|
+
Quickback does **not** send browser or mobile clients directly to Neon, and it
|
|
154
|
+
does **not** use Neon Authorize / a JWKS endpoint. Clients authenticate with the
|
|
155
|
+
Cloudflare Worker; the Worker verifies the Better Auth session or API key, runs
|
|
156
|
+
the access checks, and then performs the database call as a trusted proxy.
|
|
157
|
+
|
|
158
|
+
For every feature-table query, the generated database client opens a Neon HTTP
|
|
159
|
+
batch (an implicit transaction) whose **first** statement writes the verified
|
|
160
|
+
caller context into transaction-local Postgres settings:
|
|
161
|
+
|
|
162
|
+
```sql
|
|
163
|
+
-- Injected by the Worker as the batch's first statement (is_local = true):
|
|
164
|
+
SELECT
|
|
165
|
+
set_config('quickback.service_role', '', true),
|
|
166
|
+
set_config('request.jwt.claim.sub', 'usr_123', true),
|
|
167
|
+
set_config('request.jwt.claim.org_id', 'org_abc', true),
|
|
168
|
+
set_config('request.jwt.claim.team_id', '', true);
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
RLS policies read those settings through Quickback-defined helper functions —
|
|
172
|
+
there is no external JWT verification and no persisted session state in the
|
|
173
|
+
database. `auth.user_id()` is a compiler-generated shim, not a Neon Authorize
|
|
174
|
+
function:
|
|
175
|
+
|
|
176
|
+
```sql
|
|
177
|
+
-- Generated by Quickback (granted to the quickback runtime role):
|
|
178
|
+
CREATE OR REPLACE FUNCTION auth.user_id()
|
|
179
|
+
RETURNS TEXT AS $$
|
|
180
|
+
SELECT NULLIF(current_setting('request.jwt.claim.sub', true), '')
|
|
181
|
+
$$ LANGUAGE SQL STABLE SET search_path = public;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Because the settings are transaction-local (`set_config(..., true)`), they
|
|
185
|
+
apply only to the current batch and never leak between requests. If the Worker
|
|
186
|
+
never stamps a user id, `auth.user_id()` returns `NULL` and the restrictive
|
|
187
|
+
`deny_anon` policy blocks the query — fail closed.
|
|
66
188
|
|
|
67
189
|
## Row Level Security
|
|
68
190
|
|
|
69
|
-
Quickback emits RLS policies from your `firewall` and `access` config.
|
|
191
|
+
Quickback emits RLS policies from your `firewall` and `access` config. Neon's
|
|
192
|
+
policies read the transaction-local claims described above via `auth.user_id()`
|
|
193
|
+
and the `get_active_org_id()` / `has_any_role()` helpers (the Supabase target
|
|
194
|
+
uses `auth.uid()` instead — same pattern, different function).
|
|
70
195
|
|
|
71
196
|
```typescript
|
|
72
197
|
firewall: [
|
|
@@ -77,11 +202,15 @@ firewall: [
|
|
|
77
202
|
```sql
|
|
78
203
|
CREATE POLICY "documents_select" ON documents FOR SELECT
|
|
79
204
|
USING (
|
|
80
|
-
organization_id = get_active_org_id()
|
|
81
|
-
AND (
|
|
205
|
+
organization_id = public.get_active_org_id()
|
|
206
|
+
AND (public.is_admin() OR user_id = auth.user_id())
|
|
82
207
|
);
|
|
83
208
|
```
|
|
84
209
|
|
|
210
|
+
Every feature table also gets a restrictive `deny_anon` policy (blocks queries
|
|
211
|
+
with no stamped user id) and a `service_role` policy (admits Worker-internal
|
|
212
|
+
contexts — see [Background jobs and cross-tenant actions](#background-jobs-and-cross-tenant-actions)).
|
|
213
|
+
|
|
85
214
|
### Firewall patterns
|
|
86
215
|
|
|
87
216
|
**Organization-scoped:**
|
|
@@ -109,29 +238,140 @@ CREATE POLICY "categories_all" ON categories FOR ALL TO authenticated USING (tru
|
|
|
109
238
|
|
|
110
239
|
| Function | Purpose |
|
|
111
240
|
|----------|---------|
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
241
|
+
| `auth.user_id()` | Reads the verified user id from the transaction-local `request.jwt.claim.sub` setting |
|
|
242
|
+
| `get_active_org_id()` | Reads the request-scoped org from the transaction-local `request.jwt.claim.org_id` setting |
|
|
243
|
+
| `get_active_team_id()` | Reads the request-scoped team from `request.jwt.claim.team_id` (teams mode) |
|
|
244
|
+
| `has_any_role(roles[])` | Checks if the user has any specified role in the request org |
|
|
114
245
|
| `has_org_role(role)` | Checks for a single specific role |
|
|
115
|
-
| `is_org_member()` | Checks org membership |
|
|
116
|
-
| `is_owner(owner_id)` | Checks record ownership |
|
|
246
|
+
| `is_org_member()` | Checks org membership in the request org |
|
|
247
|
+
| `is_owner(owner_id)` | Checks record ownership against `auth.user_id()` |
|
|
248
|
+
| `is_admin()` | Checks the `auth.admins` table (admin mode) |
|
|
249
|
+
|
|
250
|
+
All helpers are TEXT-typed to match Better Auth's prefixed ids (`org_abc123`).
|
|
251
|
+
The request org/team scope is passed by the Worker **per transaction**, not read
|
|
252
|
+
from a persisted mirror. There is no compiler-owned `user_sessions` table and no
|
|
253
|
+
session hook that syncs the active organization into the database — switching to
|
|
254
|
+
"no org" simply means the Worker stamps an empty `request.jwt.claim.org_id`, and
|
|
255
|
+
SQL-side access is revoked immediately. Fail closed.
|
|
256
|
+
|
|
257
|
+
The only compiler-owned support tables the RLS layer reads live in
|
|
258
|
+
`src/db/rls-support.schema.ts`: a `profiles` table (populated by the
|
|
259
|
+
`sync_profile_display_name()` trigger and protected by the `profiles_*`
|
|
260
|
+
policies) and, when admin/sysadmin helpers are emitted, an `admins` table (read
|
|
261
|
+
by `is_admin()` / `is_sysadmin()`). Better Auth's own `sessions` table may still
|
|
262
|
+
carry an `active_organization_id`, but Quickback RLS never reads it.
|
|
263
|
+
|
|
264
|
+
RLS coverage includes Better Auth's own tables — including those the compiler
|
|
265
|
+
force-enables (organization, admin, `apikeys`; plus the OAuth/agent table
|
|
266
|
+
families when those surfaces are on, locked to service-role only).
|
|
267
|
+
|
|
268
|
+
## Background jobs and cross-tenant actions
|
|
269
|
+
|
|
270
|
+
Some code runs with no HTTP request and therefore no caller claims: queue
|
|
271
|
+
consumers, cron schedules, and cross-tenant `unsafe` actions. These acquire the
|
|
272
|
+
**service-role handle** `createServiceDb(env)` from the generated `src/db`
|
|
273
|
+
index. Instead of caller claims, it sets `quickback.service_role = 'true'` (with
|
|
274
|
+
all request claims cleared) — the same marker the Better Auth adapter's
|
|
275
|
+
transactions use. Every feature table carries a `<table>_service_role` RLS
|
|
276
|
+
policy that admits exactly that context, so background work can reach rows
|
|
277
|
+
across tenants while the request-scoped `createDb()` client stays caller-scoped.
|
|
278
|
+
|
|
279
|
+
The service-role marker is only ever set by Worker-internal chokepoints
|
|
280
|
+
(`createServiceDb`, the Better Auth adapter) — it is never derived from request
|
|
281
|
+
input. Unsafe actions keep their mandatory audit contract: cross-tenant writes
|
|
282
|
+
still land audit events (the `audit` Postgres schema), unchanged from D1.
|
|
283
|
+
|
|
284
|
+
## Webhooks on Neon
|
|
285
|
+
|
|
286
|
+
Webhooks are supported on Neon over HTTP. The store (`webhook_events`,
|
|
287
|
+
`webhook_endpoints`, `webhook_deliveries`) lives in a dedicated `webhooks`
|
|
288
|
+
Postgres schema of the **same** database — following the `audit` schema
|
|
289
|
+
precedent — so there is no separate `WEBHOOKS_DB` binding.
|
|
290
|
+
|
|
291
|
+
- Set `webhooksBinding` to enable webhooks. On Neon its value is a pure enable
|
|
292
|
+
flag (no D1 binding is emitted); the queue names stay provider-neutral.
|
|
293
|
+
- The D1-only keys `webhooksDatabaseId` and `webhooksDatabaseName` are rejected
|
|
294
|
+
at compile time — they name a D1 database that cannot exist on Neon.
|
|
295
|
+
- The webhook store is Worker-internal (endpoint signing secrets live there):
|
|
296
|
+
every table in the `webhooks` schema has RLS enabled with a single
|
|
297
|
+
service-role-only policy, so only `createWebhooksDb()` (which wraps
|
|
298
|
+
`createServiceDb`) can touch it. Route handlers gate access at the app layer
|
|
299
|
+
(`requireOrgMember` / endpoint-ownership checks) before querying.
|
|
300
|
+
- Webhooks require `connectionMode: 'http'`.
|
|
301
|
+
|
|
302
|
+
## Encryption on Neon
|
|
303
|
+
|
|
304
|
+
The encryption pillar — `.encrypted()` (envelope) and `.sealed()` /
|
|
305
|
+
`q.vaultRef()` (sealed) columns — is supported on Neon over HTTP. The
|
|
306
|
+
`org_data_keys` and seal-vault tables fold into the single journaled migration
|
|
307
|
+
set, and the encryption RLS section rides the journaled RLS migration:
|
|
308
|
+
`org_data_keys` gets org-scoped RLS (the envelope DEK path needs caller claims),
|
|
309
|
+
and the vault spine is locked to service-role-only. The seal chokepoints
|
|
310
|
+
acquire `createServiceDb`.
|
|
311
|
+
|
|
312
|
+
Both tiers require `connectionMode: 'http'`; under WebSocket mode they are a
|
|
313
|
+
fail-closed compile error.
|
|
314
|
+
|
|
315
|
+
## Batch transactions
|
|
316
|
+
|
|
317
|
+
Whether a batch handler (`PATCH /batch`, `DELETE /batch`, …) is truly atomic
|
|
318
|
+
depends on the connection mode, and the response advertises the guarantee via
|
|
319
|
+
`meta.transactional`:
|
|
320
|
+
|
|
321
|
+
| Mode | `meta.transactional` | Behavior |
|
|
322
|
+
|------|----------------------|----------|
|
|
323
|
+
| Neon HTTP (Cloudflare default) | `false` | Fail-fast per-record loop, no rollback — `drizzle-orm/neon-http` has no interactive transactions, so this matches D1's semantics honestly |
|
|
324
|
+
| Neon WebSocket (Node/Bun) | `true` | `db.transaction()` wraps the loop; any failure rolls back every write in the batch |
|
|
325
|
+
|
|
326
|
+
`drizzle-orm/neon-http` throws "No transactions support in neon-http driver" at
|
|
327
|
+
runtime, so the HTTP path deliberately treats batches like D1 (fail-fast,
|
|
328
|
+
non-transactional) rather than emitting code that would 500 on every failed
|
|
329
|
+
batch. Honest advertisement over runtime surprises.
|
|
330
|
+
|
|
331
|
+
## Capability limits (fail closed)
|
|
332
|
+
|
|
333
|
+
Anything not yet ported to Postgres is a compile-time error on Neon, never
|
|
334
|
+
silently-broken output:
|
|
335
|
+
|
|
336
|
+
- **Managed file storage** (`fileStorage` with `managed: true`) is rejected — its
|
|
337
|
+
metadata store is a D1 database. Use presign-only R2 (the default, without
|
|
338
|
+
`managed`), which is provider-neutral and works on Neon today.
|
|
339
|
+
- **The Better Auth `subscriptions` plugin** is rejected until it gets
|
|
340
|
+
provider-aware db acquisition and a Postgres dialect schema.
|
|
341
|
+
- **Raw `sqliteTable` interop sources** on a Postgres target are rejected — write
|
|
342
|
+
child tables with `pgTable` (see [below](#raw-drizzle-interop-tables-must-use-pg-core)).
|
|
343
|
+
- **WebSocket mode** rejects webhooks, cross-tenant `unsafe` actions, and
|
|
344
|
+
encrypted/sealed columns (see the [connection modes](#connection-modes)
|
|
345
|
+
callout).
|
|
346
|
+
|
|
347
|
+
Mixed database providers (e.g. D1 auth + Neon features) remain unsupported.
|
|
348
|
+
|
|
349
|
+
## Deploying
|
|
350
|
+
|
|
351
|
+
The generated `deploy` script runs migrations, then ships the Worker:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
npm run deploy # runs db:migrate (drizzle-kit) then wrangler deploy
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Before the first deploy, put the runtime secrets in Worker secrets and make sure
|
|
358
|
+
the Worker's KV namespace (used by Better Auth for sessions and JWT revocation)
|
|
359
|
+
is provisioned:
|
|
117
360
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Auth session hooks mirror the session's active organization (and team) into
|
|
123
|
-
it on every session create/update. Switching to "no org" revokes SQL-side
|
|
124
|
-
access — fail closed.
|
|
361
|
+
```bash
|
|
362
|
+
npx wrangler secret put DATABASE_URL # pooled quickback role URL
|
|
363
|
+
npx wrangler secret put BETTER_AUTH_SECRET
|
|
364
|
+
```
|
|
125
365
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
table families when those surfaces are on, locked to service-role only).
|
|
366
|
+
The generated Neon client fails fast at boot if `DATABASE_URL` is missing, so a
|
|
367
|
+
misconfigured deploy surfaces immediately rather than on the first query.
|
|
129
368
|
|
|
130
|
-
|
|
369
|
+
> Live runtime smoke testing against a deployed Neon Worker is still being brought
|
|
370
|
+
> up; the compile/typecheck/migrate path is verified end-to-end (including
|
|
371
|
+
> executing the generated Postgres migrations under pglite), but treat a first
|
|
372
|
+
> production deploy as you would any new stack — exercise auth, a CRUD flow, and a
|
|
373
|
+
> batch write before relying on it.
|
|
131
374
|
|
|
132
|
-
1. Open **Project Settings → Authorize** in the Neon console
|
|
133
|
-
2. Add your JWKS URL: `https://your-api.example.com/auth/v1/.well-known/jwks.json`
|
|
134
|
-
3. The `auth.user_id()` function will return the authenticated user's ID from the JWT
|
|
135
375
|
|
|
136
376
|
## Generated files
|
|
137
377
|
|
|
@@ -141,11 +381,42 @@ quickback/drizzle/
|
|
|
141
381
|
├── 0001_quickback_rls_<hash>.sql # journaled RLS layer (content-addressed)
|
|
142
382
|
└── meta/_journal.json # one journal covers both
|
|
143
383
|
src/
|
|
384
|
+
├── db/index.ts # createDb / createServiceDb (claim-scoped clients)
|
|
144
385
|
├── db/schema.ts # Drizzle schema barrel
|
|
145
|
-
├── db/rls-support.schema.ts #
|
|
386
|
+
├── db/rls-support.schema.ts # profiles (+ admins) — RLS support tables
|
|
146
387
|
└── auth/schema.ts # Better Auth schema (owned by the BA CLI)
|
|
388
|
+
.env.neon.example # migration connection strings (copy to .env)
|
|
389
|
+
.dev.vars.example # wrangler dev secrets (copy to .dev.vars)
|
|
390
|
+
docs/neon-setup.md # role bootstrap + deploy walkthrough
|
|
147
391
|
```
|
|
148
392
|
|
|
393
|
+
## Raw Drizzle interop tables must use `pg-core`
|
|
394
|
+
|
|
395
|
+
Internal child tables authored as raw Drizzle (a table file with **no**
|
|
396
|
+
`export default defineTable(...)`) are not dialect-translated by the
|
|
397
|
+
compiler — on Neon they must be written with `pgTable` from
|
|
398
|
+
`drizzle-orm/pg-core`. A `sqliteTable` interop source on a Postgres target
|
|
399
|
+
is a **compile-time error**: the mechanical sqlite→pg rewrite would leave
|
|
400
|
+
SQLite-shaped audit columns (`text` ISO strings instead of `timestamptz`,
|
|
401
|
+
which the RLS audit triggers stamp) and SQLite-only column options in the
|
|
402
|
+
Postgres schema.
|
|
403
|
+
|
|
404
|
+
```typescript
|
|
405
|
+
// quickback/features/interviews/interview_scores.ts
|
|
406
|
+
// @quickback-internal — child table, no CRUD routes
|
|
407
|
+
import { integer, pgTable, text } from 'drizzle-orm/pg-core';
|
|
408
|
+
|
|
409
|
+
export const interviewScores = pgTable('interview_scores', {
|
|
410
|
+
id: text('id').primaryKey(),
|
|
411
|
+
interviewId: text('interview_id').notNull(),
|
|
412
|
+
rating: integer('rating').notNull(),
|
|
413
|
+
});
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Tables **with** `defineTable(...)` are unaffected — existing `sqliteTable`
|
|
417
|
+
sources with a resource config still compile to the Postgres dialect
|
|
418
|
+
automatically.
|
|
419
|
+
|
|
149
420
|
## When to choose Neon vs D1
|
|
150
421
|
|
|
151
422
|
| Factor | Neon | D1 |
|
|
@@ -255,20 +255,26 @@ Set `"failFast": true` to stop on the first error:
|
|
|
255
255
|
|
|
256
256
|
## Transactional Semantics
|
|
257
257
|
|
|
258
|
-
The behavior of `failFast: true` depends on whether your database provider
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
rollback.
|
|
258
|
+
The behavior of `failFast: true` depends on whether your database provider —
|
|
259
|
+
and, for Neon, its **connection mode** — supports interactive transactions.
|
|
260
|
+
The response's `meta.transactional` flag tells you which guarantee you
|
|
261
|
+
actually got — inspect it in clients that care about rollback.
|
|
262
|
+
|
|
263
|
+
Neon is transactional **only over websocket** (`connectionMode: 'websocket'`,
|
|
264
|
+
the default on Node/Bun runtimes). Over HTTP — the default on Cloudflare
|
|
265
|
+
Workers — the `drizzle-orm/neon-http` driver has no `db.transaction()` (it
|
|
266
|
+
throws at runtime), so Neon-over-HTTP batches behave exactly like D1:
|
|
267
|
+
fail-fast per-record loop, `meta.transactional: false`.
|
|
262
268
|
|
|
263
269
|
### Per-Provider Matrix
|
|
264
270
|
|
|
265
271
|
| Endpoint | Provider | `failFast` | `meta.transactional` | Behavior |
|
|
266
272
|
|----------|----------|-----------|----------------------|----------|
|
|
267
|
-
| `PATCH /batch` (update) |
|
|
273
|
+
| `PATCH /batch` (update) | tx-supporting (postgres, neon over websocket) | `true` | `true` | `db.transaction()` wraps the per-record loop. Any failure rolls back ALL writes in the batch. |
|
|
268
274
|
| `PATCH /batch` (update) | (any) | `false` | `false` | Per-record loop, partial success. Each record commits independently. |
|
|
269
|
-
| `PATCH /batch` (update) | cloudflare-d1 | `true` | `false` | Fail-fast loop without rollback —
|
|
270
|
-
| `PUT /batch` (upsert) | tx-supporting | `true` | `true` | Bulk insert + per-record update share one transaction. Any failure rolls back both. |
|
|
271
|
-
| `PUT /batch` (upsert) | cloudflare-d1 | `true` | `false` | Bulk insert commits; per-record update loop is fail-fast without rollback. |
|
|
275
|
+
| `PATCH /batch` (update) | cloudflare-d1, neon over http (Cloudflare default) | `true` | `false` | Fail-fast loop without rollback — the driver has no `db.transaction`. Records before the failure stay committed. |
|
|
276
|
+
| `PUT /batch` (upsert) | tx-supporting (postgres, neon over websocket) | `true` | `true` | Bulk insert + per-record update share one transaction. Any failure rolls back both. |
|
|
277
|
+
| `PUT /batch` (upsert) | cloudflare-d1, neon over http (Cloudflare default) | `true` | `false` | Bulk insert commits; per-record update loop is fail-fast without rollback. |
|
|
272
278
|
| `POST /batch` (create) | (any) | (any) | `true` | Single bulk `INSERT` — atomic at the DB level. |
|
|
273
279
|
| `DELETE /batch` | (any) | (any) | `true` | Single bulk `UPDATE` (soft) or `DELETE` (hard) — atomic at the DB level. |
|
|
274
280
|
|