@quickback-dev/cli 0.66.10 → 0.66.11
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/index.js +1 -1
- package/dist/lib/migrations/drizzle-wrapper.d.ts.map +1 -1
- package/dist/lib/migrations/drizzle-wrapper.js +11 -1
- package/dist/lib/migrations/drizzle-wrapper.js.map +1 -1
- package/dist/lib/migrations/drizzle-wrapper.test.d.ts +2 -0
- package/dist/lib/migrations/drizzle-wrapper.test.d.ts.map +1 -0
- package/dist/lib/migrations/drizzle-wrapper.test.js +64 -0
- package/dist/lib/migrations/drizzle-wrapper.test.js.map +1 -0
- package/dist/lib/migrations/drizzle.d.ts.map +1 -1
- package/dist/lib/migrations/drizzle.js +6 -2
- package/dist/lib/migrations/drizzle.js.map +1 -1
- package/dist/lib/migrations/prompt-runner.test.js +8 -1
- package/dist/lib/migrations/prompt-runner.test.js.map +1 -1
- package/dist/skill/docs/define/schema.md +9 -0
- package/dist/skill/docs/platform/database/neon.md +18 -0
- package/dist/skill/docs/platform/database/planetscale-postgres.md +57 -23
- package/package.json +1 -1
- package/src/skill/docs/define/schema.md +9 -0
- package/src/skill/docs/platform/database/neon.md +18 -0
- package/src/skill/docs/platform/database/planetscale-postgres.md +57 -23
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle-wrapper.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,iCAAiC,8BAA8B,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"drizzle-wrapper.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,iCAAiC,8BAA8B,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA6CvE"}
|
|
@@ -28,12 +28,22 @@ export function buildDrizzleGenerateWrapper(projectRoot) {
|
|
|
28
28
|
return `// Quickback drizzle-generate wrapper. Generated; do not edit.
|
|
29
29
|
import { Readable } from 'node:stream';
|
|
30
30
|
import { createRequire } from 'node:module';
|
|
31
|
+
import { dirname, join } from 'node:path';
|
|
31
32
|
|
|
32
33
|
// Anchored at the project root so we resolve the PINNED drizzle-kit that
|
|
33
34
|
// assertSupportedDrizzleVersion approved. No fallback: running a different
|
|
34
35
|
// copy against real migration history is worse than failing.
|
|
35
36
|
const require = createRequire(${JSON.stringify(`${projectRoot.replace(/\/+$/, '')}/package.json`)});
|
|
36
|
-
|
|
37
|
+
// drizzle-kit 0.31.10 ships an exports map listing only "." and "./api", so
|
|
38
|
+
// resolving './package.json' throws ERR_PACKAGE_PATH_NOT_EXPORTED under Node's
|
|
39
|
+
// strict exports (older releases had no map and resolved it fine). Try the
|
|
40
|
+
// package.json first, then fall back to the directory of the main export;
|
|
41
|
+
// bin.cjs sits at the package root either way.
|
|
42
|
+
function drizzleKitDir() {
|
|
43
|
+
try { return dirname(require.resolve('drizzle-kit/package.json')); } catch {}
|
|
44
|
+
return dirname(require.resolve('drizzle-kit'));
|
|
45
|
+
}
|
|
46
|
+
const binPath = join(drizzleKitDir(), 'bin.cjs');
|
|
37
47
|
|
|
38
48
|
// Present a fake TTY and bridge the real (piped) stdin into it, so the parent
|
|
39
49
|
// runner's injected keystrokes ('\\r' = create, arrow-downs = rename hint)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle-wrapper.js","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,2BAA2B,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAmB;IAC7D,OAAO
|
|
1
|
+
{"version":3,"file":"drizzle-wrapper.js","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,iCAAiC,GAAG,2BAA2B,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAmB;IAC7D,OAAO;;;;;;;;gCAQuB,IAAI,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmChG,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-wrapper.test.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { buildDrizzleGenerateWrapper } from './drizzle-wrapper.js';
|
|
6
|
+
/**
|
|
7
|
+
* drizzle-kit 0.31.10 ships an exports map listing only "." and "./api". Under
|
|
8
|
+
* Node's strict exports, `require.resolve('drizzle-kit/package.json')` throws
|
|
9
|
+
* ERR_PACKAGE_PATH_NOT_EXPORTED — which took down local migration generation
|
|
10
|
+
* for every Postgres project on Node 22 (2026-09-07). Bun is lenient about
|
|
11
|
+
* exports maps, so the prompt-runner tests (which spawn the wrapper with Bun)
|
|
12
|
+
* cannot see this. This test runs the generated wrapper under `node` against
|
|
13
|
+
* a fixture that mirrors the real package layout.
|
|
14
|
+
*/
|
|
15
|
+
async function nodeAvailable() {
|
|
16
|
+
try {
|
|
17
|
+
const proc = Bun.spawn(['node', '--version'], { stdout: 'pipe', stderr: 'pipe' });
|
|
18
|
+
return (await proc.exited) === 0;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
describe('drizzle generate wrapper', () => {
|
|
25
|
+
test('resolves bin.cjs under node when ./package.json is not exported', async () => {
|
|
26
|
+
if (!(await nodeAvailable()))
|
|
27
|
+
return; // node is the runtime the wrapper targets; skip where absent
|
|
28
|
+
const root = await mkdtemp(join(tmpdir(), 'qb-wrapper-'));
|
|
29
|
+
try {
|
|
30
|
+
const pkgDir = join(root, 'node_modules', 'drizzle-kit');
|
|
31
|
+
await mkdir(pkgDir, { recursive: true });
|
|
32
|
+
await writeFile(join(pkgDir, 'package.json'), JSON.stringify({
|
|
33
|
+
name: 'drizzle-kit',
|
|
34
|
+
version: '0.31.10',
|
|
35
|
+
main: './index.js',
|
|
36
|
+
exports: { '.': './index.js', './api': './api.js' },
|
|
37
|
+
}));
|
|
38
|
+
await writeFile(join(pkgDir, 'index.js'), 'module.exports = {};\n');
|
|
39
|
+
await writeFile(join(pkgDir, 'bin.cjs'), 'process.stdout.write("FAKE_DRIZZLE_OK " + process.argv.slice(2).join(" "));\n');
|
|
40
|
+
await writeFile(join(root, 'package.json'), JSON.stringify({ name: 'proj' }));
|
|
41
|
+
const wrapper = join(root, '__qb_drizzle_generate.mjs');
|
|
42
|
+
await writeFile(wrapper, buildDrizzleGenerateWrapper(root));
|
|
43
|
+
const proc = Bun.spawn(['node', wrapper, 'generate', '--config', 'drizzle.config.ts'], {
|
|
44
|
+
cwd: root,
|
|
45
|
+
stdin: 'pipe',
|
|
46
|
+
stdout: 'pipe',
|
|
47
|
+
stderr: 'pipe',
|
|
48
|
+
});
|
|
49
|
+
proc.stdin.end();
|
|
50
|
+
const [code, out, err] = await Promise.all([
|
|
51
|
+
proc.exited,
|
|
52
|
+
new Response(proc.stdout).text(),
|
|
53
|
+
new Response(proc.stderr).text(),
|
|
54
|
+
]);
|
|
55
|
+
expect(err).not.toContain('ERR_PACKAGE_PATH_NOT_EXPORTED');
|
|
56
|
+
expect(code).toBe(0);
|
|
57
|
+
expect(out).toContain('FAKE_DRIZZLE_OK generate --config drizzle.config.ts');
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await rm(root, { recursive: true, force: true });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=drizzle-wrapper.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drizzle-wrapper.test.js","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle-wrapper.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;;;;GAQG;AACH,KAAK,UAAU,aAAa;IAC1B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAClF,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,IAAI,CAAC,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AC,MAAM,CAAC,CA2BjB;AAED,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAOzE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUjE;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"drizzle.d.ts","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CA2BjB;AAED,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAOzE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUjE;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAkCf"}
|
|
@@ -47,8 +47,12 @@ export function detectDrizzleCommandFailure(stdout, stderr) {
|
|
|
47
47
|
if (/Interactive prompts require a TTY/i.test(output) ||
|
|
48
48
|
(lastPrompt >= 0 && lastSuccess < lastPrompt) ||
|
|
49
49
|
/\bCommand aborted\b/i.test(output)) {
|
|
50
|
-
return 'drizzle-kit requested interactive rename input. ' +
|
|
51
|
-
'
|
|
50
|
+
return 'drizzle-kit requested interactive rename input: it asked whether a table or column was created or renamed. ' +
|
|
51
|
+
'If it is a rename, add a compiler.migrations.renames hint (new name -> old name). ' +
|
|
52
|
+
'If it is a new object, check for tables that disappeared from the schema in the same ' +
|
|
53
|
+
'compile (turning a subsystem off, such as removing webhooksBinding, drops its tables and ' +
|
|
54
|
+
'makes every new table look like a rename candidate). autoCreateRenames is a sqlite-only ' +
|
|
55
|
+
'migration-target option; it is refused for postgresql.';
|
|
52
56
|
}
|
|
53
57
|
if (/\b(?:ReferenceError|TypeError|SyntaxError|RangeError):\s+/.test(output) ||
|
|
54
58
|
/\bError:\s+/.test(output) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.js","sourceRoot":"","sources":["../../../src/lib/migrations/drizzle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACL,yBAAyB,GAG1B,MAAM,YAAY,CAAC;AASpB,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAAiC;IAEjC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,6BAA6B,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5F,MAAM,sBAAsB,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,mBAAmB,CAAC;IACrD,MAAM,UAAU,GAAsB;QACpC,UAAU;QACV,IAAI,EAAE,CAAC,WAAW,CAAC;QACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;QACjC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,QAAQ,KAAK,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= await mkdtemp(join(tmpdir(), 'qb-prompt-runner-'));
|
|
47
47
|
const pkgDir = join(projectRoot, 'node_modules', 'drizzle-kit');
|
|
48
|
-
|
|
48
|
+
// Mirror drizzle-kit 0.31.10's exports map: "./package.json" is NOT exported,
|
|
49
|
+
// so the wrapper must find bin.cjs via the main export instead.
|
|
50
|
+
await Bun.write(join(pkgDir, 'package.json'), JSON.stringify({
|
|
51
|
+
name: 'drizzle-kit',
|
|
52
|
+
main: './index.js',
|
|
53
|
+
exports: { '.': './index.js', './api': './api.js' },
|
|
54
|
+
}));
|
|
55
|
+
await Bun.write(join(pkgDir, 'index.js'), 'module.exports = {};\n');
|
|
49
56
|
await Bun.write(join(pkgDir, 'bin.cjs'), FAKE_DRIZZLE);
|
|
50
57
|
await Bun.write(join(projectRoot, 'package.json'), JSON.stringify({ name: 'proj' }));
|
|
51
58
|
const binDir = join(projectRoot, 'node_modules', '.bin');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-runner.test.js","sourceRoot":"","sources":["../../../src/lib/migrations/prompt-runner.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE;;;;;;;;;GASG;AACH,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BpB,CAAC;AAEF,+EAA+E;AAC/E,KAAK,UAAU,OAAO;IACpB,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACv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table column excerpt; the complete table forms appear at the top of this page. */}
|
|
749
749
|
```typescript
|
|
750
|
+
// features/applications/applications.ts
|
|
751
|
+
import candidates from "../candidates/candidates";
|
|
752
|
+
import jobs from "../jobs/jobs";
|
|
753
|
+
|
|
750
754
|
const applications = q.table("applications", {
|
|
751
755
|
id: q.id(),
|
|
752
756
|
candidateId: q.text().required().references(() => candidates.id),
|
|
@@ -754,6 +758,11 @@ const applications = q.table("applications", {
|
|
|
754
758
|
});
|
|
755
759
|
```
|
|
756
760
|
|
|
761
|
+
When the target table lives in **another feature**, import it in the table
|
|
762
|
+
file — `import <table> from "../<feature>/<table>"`, one `../`, since table
|
|
763
|
+
files sit at `features/<feature>/`. The thunk names a real binding; without
|
|
764
|
+
the import the generated schema fails migration generation.
|
|
765
|
+
|
|
757
766
|
Do this even when a column name appears obvious, such as `sessionId` beside a
|
|
758
767
|
`sessions` table. A matching `*Id` name is a useful compiler suggestion when a
|
|
759
768
|
relationship might be missing; it is not enough evidence to silently invent
|
|
@@ -1086,6 +1086,24 @@ Mixed database providers (e.g. D1 auth + Neon features) remain unsupported.
|
|
|
1086
1086
|
|
|
1087
1087
|
## Deploying
|
|
1088
1088
|
|
|
1089
|
+
### Projects with no custom domain
|
|
1090
|
+
|
|
1091
|
+
A Worker that lives only on `workers.dev` (no `providers.runtime.config.routes`,
|
|
1092
|
+
no `domains`) must tell the generated auth layer its own host. Without it the
|
|
1093
|
+
JWT issuer defaults to the local dev URL and cookie-backed browser mutations are
|
|
1094
|
+
refused as cross-site:
|
|
1095
|
+
|
|
1096
|
+
```sh
|
|
1097
|
+
npx wrangler deploy \
|
|
1098
|
+
--var EXTRA_APP_HOSTS:<name>.<account>.workers.dev \
|
|
1099
|
+
--var BETTER_AUTH_URL:https://<name>.<account>.workers.dev
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
Named environments set `BETTER_AUTH_URL` in `worker.vars` (see above);
|
|
1103
|
+
`EXTRA_APP_HOSTS` is documented under
|
|
1104
|
+
[Multi-domain architecture](/configure/domains#one-bundle-several-hostnames).
|
|
1105
|
+
|
|
1106
|
+
|
|
1089
1107
|
For an unnamed target, the generated `deploy` script runs migrations, then
|
|
1090
1108
|
ships the Worker:
|
|
1091
1109
|
|
|
@@ -7,12 +7,20 @@ schema, the same Better Auth wiring, the same
|
|
|
7
7
|
migrations. For identical definitions the generated schema and security
|
|
8
8
|
migrations are byte-identical between the two providers.
|
|
9
9
|
|
|
10
|
-
> **
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
>
|
|
15
|
-
>
|
|
10
|
+
> **Proven live end to end (2026-09-07).** The direct-connection contract, the
|
|
11
|
+
> Hyperdrive transport, and a generated project's Worker were each run against a
|
|
12
|
+
> real PlanetScale Postgres 18 branch. Against a real PlanetScale Postgres 18 branch, the
|
|
13
|
+
> generated journal applied unchanged: role bootstrap with `CREATE ROLE`
|
|
14
|
+
> verbatim, ownership transfer to `quickback_owner`, the RLS backstop through
|
|
15
|
+
> the emitted client as the restricted role, interactive transaction commit and
|
|
16
|
+
> rollback, incremental migration as `quickback_admin`, and a migration ledger
|
|
17
|
+
> the runtime cannot read. The `recruitment` example, compiled with this provider,
|
|
18
|
+
> applied its four-file upgrade journal, then served sign-up, sessions, organization
|
|
19
|
+
> activation, tenant CRUD, a named view and an action through a cache-disabled
|
|
20
|
+
> Hyperdrive config connected as `quickback.<branch_id>`, with every security
|
|
21
|
+
> layer answering correctly. Not yet exercised there: outbound webhook delivery,
|
|
22
|
+
> realtime traffic and the automated acceptance manifest. Sanitized record in the
|
|
23
|
+
> repository's `plans/postgres-acceptance-results.md`.
|
|
16
24
|
|
|
17
25
|
|
|
18
26
|
## Configuration
|
|
@@ -179,24 +187,50 @@ never silently-broken output:
|
|
|
179
187
|
| `webhooksDatabaseId` / `webhooksDatabaseName` | rejected — D1-only keys; webhook tables live in the `webhooks` schema of the same database |
|
|
180
188
|
| `connectionMode` of `'http'` or `'websocket'` | rejected — no such driver for this provider |
|
|
181
189
|
|
|
182
|
-
##
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
## Live acceptance findings
|
|
191
|
+
|
|
192
|
+
Answered by the direct-connection spike on 2026-09-07 (PostgreSQL 18.6,
|
|
193
|
+
postgres.js 3.4.9, drizzle-orm 0.45.2; sanitized record in the repository's
|
|
194
|
+
`plans/postgres-acceptance-results.md`):
|
|
195
|
+
|
|
196
|
+
- **`CREATE ROLE … NOLOGIN NOBYPASSRLS`** runs verbatim from the generated
|
|
197
|
+
journal as the vendor default role. No vendor role API is needed.
|
|
198
|
+
- **Ownership transfer** with `ALTER … OWNER TO quickback_owner` works,
|
|
199
|
+
including `ALTER SCHEMA public`.
|
|
200
|
+
- **`SECURITY DEFINER` with a pinned `search_path`**, `GRANT … WITH SET TRUE`
|
|
201
|
+
and `REVOKE CREATE ON SCHEMA public FROM PUBLIC` are all accepted.
|
|
202
|
+
- **`SET LOCAL ROLE quickback` from the vendor default role is refused**
|
|
203
|
+
(SQLSTATE 42501). PostgreSQL 16+ gives a role's creator ADMIN OPTION but not
|
|
204
|
+
SET. This does not affect the shipped design: the Worker connects directly as
|
|
205
|
+
the restricted role through Hyperdrive, and `quickback_admin` holds SET on it
|
|
206
|
+
for routine migrations. Do not work around it by granting the default role
|
|
207
|
+
more; it is the setup actor only and carries `BYPASSRLS`.
|
|
208
|
+
- **Connection username** is `<role>.<branch_id>`; SQL role names stay bare.
|
|
209
|
+
Create the Hyperdrive origin credential as `quickback.<branch_id>`.
|
|
210
|
+
- **Extensions:** the journal needs only `plpgsql`. `pgcrypto`, `uuid-ossp`,
|
|
211
|
+
`vector`, `pg_trgm`, `citext` and `pg_cron` are available if a project
|
|
212
|
+
declares them.
|
|
213
|
+
|
|
214
|
+
Still to prove, and the reason this page keeps a qualifier: the deployed
|
|
215
|
+
Hyperdrive run, and one provider-independent item — the generated RLS helper
|
|
216
|
+
functions end up owned by the migrating actor rather than `quickback_owner`,
|
|
217
|
+
which is why a changed security migration currently needs the setup-owner
|
|
218
|
+
credential (see [Neon](/platform/database/neon#upgrading-an-existing-database)).
|
|
219
|
+
|
|
220
|
+
## Deploying to workers.dev only
|
|
221
|
+
|
|
222
|
+
A project with no custom domain must tell the generated auth layer its own
|
|
223
|
+
host, or the JWT issuer defaults to the local dev URL and browser mutations
|
|
224
|
+
fail the origin check:
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
npx wrangler deploy \
|
|
228
|
+
--var EXTRA_APP_HOSTS:<name>.<account>.workers.dev \
|
|
229
|
+
--var BETTER_AUTH_URL:https://<name>.<account>.workers.dev
|
|
230
|
+
```
|
|
197
231
|
|
|
198
|
-
|
|
199
|
-
|
|
232
|
+
Projects with `providers.runtime.config.routes` or `domains` get both from
|
|
233
|
+
the configured hostnames automatically.
|
|
200
234
|
|
|
201
235
|
## See also
|
|
202
236
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quickback-dev/cli",
|
|
3
|
-
"version": "0.66.
|
|
3
|
+
"version": "0.66.11",
|
|
4
4
|
"description": "CLI for Quickback — define your backend in TypeScript, compile to a fully wired Cloudflare Worker (or Bun / Node) with auth, database, migrations, security, CMS, and Account UI.",
|
|
5
5
|
"author": "Kardoe Incorporated <paul@kardoe.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -747,6 +747,10 @@ selector/typeahead controls:
|
|
|
747
747
|
|
|
748
748
|
{/* doc-compile: skip — cross-table column excerpt; the complete table forms appear at the top of this page. */}
|
|
749
749
|
```typescript
|
|
750
|
+
// features/applications/applications.ts
|
|
751
|
+
import candidates from "../candidates/candidates";
|
|
752
|
+
import jobs from "../jobs/jobs";
|
|
753
|
+
|
|
750
754
|
const applications = q.table("applications", {
|
|
751
755
|
id: q.id(),
|
|
752
756
|
candidateId: q.text().required().references(() => candidates.id),
|
|
@@ -754,6 +758,11 @@ const applications = q.table("applications", {
|
|
|
754
758
|
});
|
|
755
759
|
```
|
|
756
760
|
|
|
761
|
+
When the target table lives in **another feature**, import it in the table
|
|
762
|
+
file — `import <table> from "../<feature>/<table>"`, one `../`, since table
|
|
763
|
+
files sit at `features/<feature>/`. The thunk names a real binding; without
|
|
764
|
+
the import the generated schema fails migration generation.
|
|
765
|
+
|
|
757
766
|
Do this even when a column name appears obvious, such as `sessionId` beside a
|
|
758
767
|
`sessions` table. A matching `*Id` name is a useful compiler suggestion when a
|
|
759
768
|
relationship might be missing; it is not enough evidence to silently invent
|
|
@@ -1086,6 +1086,24 @@ Mixed database providers (e.g. D1 auth + Neon features) remain unsupported.
|
|
|
1086
1086
|
|
|
1087
1087
|
## Deploying
|
|
1088
1088
|
|
|
1089
|
+
### Projects with no custom domain
|
|
1090
|
+
|
|
1091
|
+
A Worker that lives only on `workers.dev` (no `providers.runtime.config.routes`,
|
|
1092
|
+
no `domains`) must tell the generated auth layer its own host. Without it the
|
|
1093
|
+
JWT issuer defaults to the local dev URL and cookie-backed browser mutations are
|
|
1094
|
+
refused as cross-site:
|
|
1095
|
+
|
|
1096
|
+
```sh
|
|
1097
|
+
npx wrangler deploy \
|
|
1098
|
+
--var EXTRA_APP_HOSTS:<name>.<account>.workers.dev \
|
|
1099
|
+
--var BETTER_AUTH_URL:https://<name>.<account>.workers.dev
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
Named environments set `BETTER_AUTH_URL` in `worker.vars` (see above);
|
|
1103
|
+
`EXTRA_APP_HOSTS` is documented under
|
|
1104
|
+
[Multi-domain architecture](/configure/domains#one-bundle-several-hostnames).
|
|
1105
|
+
|
|
1106
|
+
|
|
1089
1107
|
For an unnamed target, the generated `deploy` script runs migrations, then
|
|
1090
1108
|
ships the Worker:
|
|
1091
1109
|
|
|
@@ -7,12 +7,20 @@ schema, the same Better Auth wiring, the same
|
|
|
7
7
|
migrations. For identical definitions the generated schema and security
|
|
8
8
|
migrations are byte-identical between the two providers.
|
|
9
9
|
|
|
10
|
-
> **
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
>
|
|
15
|
-
>
|
|
10
|
+
> **Proven live end to end (2026-09-07).** The direct-connection contract, the
|
|
11
|
+
> Hyperdrive transport, and a generated project's Worker were each run against a
|
|
12
|
+
> real PlanetScale Postgres 18 branch. Against a real PlanetScale Postgres 18 branch, the
|
|
13
|
+
> generated journal applied unchanged: role bootstrap with `CREATE ROLE`
|
|
14
|
+
> verbatim, ownership transfer to `quickback_owner`, the RLS backstop through
|
|
15
|
+
> the emitted client as the restricted role, interactive transaction commit and
|
|
16
|
+
> rollback, incremental migration as `quickback_admin`, and a migration ledger
|
|
17
|
+
> the runtime cannot read. The `recruitment` example, compiled with this provider,
|
|
18
|
+
> applied its four-file upgrade journal, then served sign-up, sessions, organization
|
|
19
|
+
> activation, tenant CRUD, a named view and an action through a cache-disabled
|
|
20
|
+
> Hyperdrive config connected as `quickback.<branch_id>`, with every security
|
|
21
|
+
> layer answering correctly. Not yet exercised there: outbound webhook delivery,
|
|
22
|
+
> realtime traffic and the automated acceptance manifest. Sanitized record in the
|
|
23
|
+
> repository's `plans/postgres-acceptance-results.md`.
|
|
16
24
|
|
|
17
25
|
|
|
18
26
|
## Configuration
|
|
@@ -179,24 +187,50 @@ never silently-broken output:
|
|
|
179
187
|
| `webhooksDatabaseId` / `webhooksDatabaseName` | rejected — D1-only keys; webhook tables live in the `webhooks` schema of the same database |
|
|
180
188
|
| `connectionMode` of `'http'` or `'websocket'` | rejected — no such driver for this provider |
|
|
181
189
|
|
|
182
|
-
##
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
## Live acceptance findings
|
|
191
|
+
|
|
192
|
+
Answered by the direct-connection spike on 2026-09-07 (PostgreSQL 18.6,
|
|
193
|
+
postgres.js 3.4.9, drizzle-orm 0.45.2; sanitized record in the repository's
|
|
194
|
+
`plans/postgres-acceptance-results.md`):
|
|
195
|
+
|
|
196
|
+
- **`CREATE ROLE … NOLOGIN NOBYPASSRLS`** runs verbatim from the generated
|
|
197
|
+
journal as the vendor default role. No vendor role API is needed.
|
|
198
|
+
- **Ownership transfer** with `ALTER … OWNER TO quickback_owner` works,
|
|
199
|
+
including `ALTER SCHEMA public`.
|
|
200
|
+
- **`SECURITY DEFINER` with a pinned `search_path`**, `GRANT … WITH SET TRUE`
|
|
201
|
+
and `REVOKE CREATE ON SCHEMA public FROM PUBLIC` are all accepted.
|
|
202
|
+
- **`SET LOCAL ROLE quickback` from the vendor default role is refused**
|
|
203
|
+
(SQLSTATE 42501). PostgreSQL 16+ gives a role's creator ADMIN OPTION but not
|
|
204
|
+
SET. This does not affect the shipped design: the Worker connects directly as
|
|
205
|
+
the restricted role through Hyperdrive, and `quickback_admin` holds SET on it
|
|
206
|
+
for routine migrations. Do not work around it by granting the default role
|
|
207
|
+
more; it is the setup actor only and carries `BYPASSRLS`.
|
|
208
|
+
- **Connection username** is `<role>.<branch_id>`; SQL role names stay bare.
|
|
209
|
+
Create the Hyperdrive origin credential as `quickback.<branch_id>`.
|
|
210
|
+
- **Extensions:** the journal needs only `plpgsql`. `pgcrypto`, `uuid-ossp`,
|
|
211
|
+
`vector`, `pg_trgm`, `citext` and `pg_cron` are available if a project
|
|
212
|
+
declares them.
|
|
213
|
+
|
|
214
|
+
Still to prove, and the reason this page keeps a qualifier: the deployed
|
|
215
|
+
Hyperdrive run, and one provider-independent item — the generated RLS helper
|
|
216
|
+
functions end up owned by the migrating actor rather than `quickback_owner`,
|
|
217
|
+
which is why a changed security migration currently needs the setup-owner
|
|
218
|
+
credential (see [Neon](/platform/database/neon#upgrading-an-existing-database)).
|
|
219
|
+
|
|
220
|
+
## Deploying to workers.dev only
|
|
221
|
+
|
|
222
|
+
A project with no custom domain must tell the generated auth layer its own
|
|
223
|
+
host, or the JWT issuer defaults to the local dev URL and browser mutations
|
|
224
|
+
fail the origin check:
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
npx wrangler deploy \
|
|
228
|
+
--var EXTRA_APP_HOSTS:<name>.<account>.workers.dev \
|
|
229
|
+
--var BETTER_AUTH_URL:https://<name>.<account>.workers.dev
|
|
230
|
+
```
|
|
197
231
|
|
|
198
|
-
|
|
199
|
-
|
|
232
|
+
Projects with `providers.runtime.config.routes` or `domains` get both from
|
|
233
|
+
the configured hostnames automatically.
|
|
200
234
|
|
|
201
235
|
## See also
|
|
202
236
|
|