@fuzdev/fuz_app 0.133.0 → 0.134.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/db/CLAUDE.md +10 -7
- package/dist/db/create_db.d.ts +8 -6
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +11 -10
- package/dist/db/db.d.ts +9 -7
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db.js +5 -4
- package/dist/db/db_pglet.d.ts +43 -0
- package/dist/db/db_pglet.d.ts.map +1 -0
- package/dist/db/db_pglet.js +55 -0
- package/dist/testing/CLAUDE.md +17 -18
- package/dist/testing/app_server.d.ts +5 -5
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +21 -20
- package/dist/testing/cross_backend/default_backend_configs.d.ts +5 -5
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +1 -1
- package/dist/testing/cross_backend/in_process_setup.d.ts +2 -2
- package/dist/testing/cross_backend/in_process_setup.js +3 -3
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +2 -2
- package/dist/testing/cross_backend/testing_reset_actions.js +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +2 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/db.d.ts +49 -60
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +104 -101
- package/dist/testing/rate_limiting.d.ts +2 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +2 -2
- package/dist/testing/sse_round_trip.d.ts +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.js +1 -1
- package/package.json +6 -1
package/dist/db/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# db/
|
|
2
2
|
|
|
3
|
-
> Database layer: the `Db` abstraction over pg
|
|
3
|
+
> Database layer: the `Db` abstraction over pg, PGlite and pglet, the migration
|
|
4
4
|
> runner, and the cell content-primitive schema + queries.
|
|
5
5
|
|
|
6
6
|
For server assembly, `QueryDeps`, and migration-runner contract see the
|
|
@@ -12,20 +12,23 @@ the code.
|
|
|
12
12
|
|
|
13
13
|
## Generic db infrastructure
|
|
14
14
|
|
|
15
|
-
- `db.ts` — `Db` abstraction over pg
|
|
15
|
+
- `db.ts` — `Db` abstraction over pg, PGlite and pglet, `query` / `query_one` /
|
|
16
16
|
`transaction`, `no_nested_transaction` guard.
|
|
17
17
|
- `create_db.ts` — URL-based driver auto-detection (`postgres` /
|
|
18
|
-
`pglite-file` / `
|
|
19
|
-
-
|
|
20
|
-
|
|
18
|
+
`pglite-file` for `file://` / `pglet-memory` for `memory://`, over
|
|
19
|
+
`@fuzdev/pglet-wasm`). An in-memory PGlite is `create_pglite_db(new PGlite())`.
|
|
20
|
+
- `db_pg.ts` / `db_pglite.ts` / `db_pglet.ts` — driver adapters. `db_pg.ts` also
|
|
21
|
+
exports `register_pg_type_parsers`, the shared int8→number coercion (so
|
|
21
22
|
`BIGSERIAL` columns read as JS numbers, matching PGlite) — called by both
|
|
22
23
|
`create_db` and the test pg factory (`testing/db.ts`) so prod and tests
|
|
23
|
-
read the same wire shape from one registration site.
|
|
24
|
+
read the same wire shape from one registration site. `db_pglet.ts`'s
|
|
25
|
+
`PGLET_COERCION` is pglet's half of the same convention, which every pglet
|
|
26
|
+
instance fuz_app creates is given.
|
|
24
27
|
- `migrate.ts` — advisory-lock migration runner (`run_migrations`,
|
|
25
28
|
`baseline`), `Migration` / `MigrationNamespace` / `MigrationError`.
|
|
26
29
|
- `query_deps.ts` — `QueryDeps = {db}`, the first param to every `query_*`.
|
|
27
30
|
- `assert_row.ts` — `assert_row(row, context)` for INSERT … RETURNING.
|
|
28
|
-
- `pg_error.ts` — `pg_error_code` (SQLSTATE extractor for `pg`/PGlite errors), `is_pg_unique_violation` (Postgres `23505`).
|
|
31
|
+
- `pg_error.ts` — `pg_error_code` (SQLSTATE extractor for `pg`/PGlite/pglet errors), `is_pg_unique_violation` (Postgres `23505`).
|
|
29
32
|
- `sql_identifier.ts` — `assert_valid_sql_identifier`.
|
|
30
33
|
- `sql_columns.ts` — `columns_sql` / `qualify_columns` / `omit_columns`,
|
|
31
34
|
the derivation helpers every `*_COLUMNS` projection const's variants
|
package/dist/db/create_db.d.ts
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* Selects the appropriate database driver based on `database_url`:
|
|
5
5
|
* - `postgres://` or `postgresql://` — uses `pg` (PostgreSQL)
|
|
6
6
|
* - `file://` — uses `@electric-sql/pglite` (file-based)
|
|
7
|
-
* - `memory://` — uses `@
|
|
7
|
+
* - `memory://` — uses `@fuzdev/pglet-wasm` (in-memory)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* dynamically imported only when needed. For direct driver
|
|
11
|
-
* without auto-detection, use `db/db_pg.ts
|
|
9
|
+
* `pg`, `@electric-sql/pglite` and `@fuzdev/pglet-wasm` are optional peer
|
|
10
|
+
* dependencies, dynamically imported only when needed. For direct driver
|
|
11
|
+
* construction without auto-detection, use `db/db_pg.ts`, `db/db_pglite.ts`
|
|
12
|
+
* or `db/db_pglet.ts` — an in-memory PGlite is `create_pglite_db(new PGlite())`.
|
|
12
13
|
*
|
|
13
14
|
* @module
|
|
14
15
|
*/
|
|
@@ -28,12 +29,13 @@ export interface CreateDbResult {
|
|
|
28
29
|
* know which driver is in use.
|
|
29
30
|
*
|
|
30
31
|
* For direct driver construction without URL routing, import
|
|
31
|
-
* `create_pg_db` from `db/db_pg.ts
|
|
32
|
+
* `create_pg_db` from `db/db_pg.ts`, `create_pglite_db` from `db/db_pglite.ts`
|
|
33
|
+
* or `create_pglet_db_driver` from `db/db_pglet.ts`.
|
|
32
34
|
*
|
|
33
35
|
* @param database_url - connection URL (`postgres://`, `postgresql://`, `file://`, or `memory://`)
|
|
34
36
|
* @returns database instance, close callback, type, and display name
|
|
35
37
|
* @throws Error if `database_url` uses an unsupported scheme. Driver
|
|
36
|
-
* construction (`pg.Pool` or
|
|
38
|
+
* construction (`pg.Pool`, `PGlite` or pglet) may also throw on bad connection
|
|
37
39
|
* parameters or missing peer-dependency packages.
|
|
38
40
|
*/
|
|
39
41
|
export declare const create_db: (database_url: string) => Promise<CreateDbResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_db.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/create_db.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"create_db.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/create_db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAK1C,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,EAAE,CAAC;IACP,iFAAiF;IACjF,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,SAAS,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,cAAc,CAiC5E,CAAC"}
|
package/dist/db/create_db.js
CHANGED
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
* Selects the appropriate database driver based on `database_url`:
|
|
5
5
|
* - `postgres://` or `postgresql://` — uses `pg` (PostgreSQL)
|
|
6
6
|
* - `file://` — uses `@electric-sql/pglite` (file-based)
|
|
7
|
-
* - `memory://` — uses `@
|
|
7
|
+
* - `memory://` — uses `@fuzdev/pglet-wasm` (in-memory)
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* dynamically imported only when needed. For direct driver
|
|
11
|
-
* without auto-detection, use `db/db_pg.ts
|
|
9
|
+
* `pg`, `@electric-sql/pglite` and `@fuzdev/pglet-wasm` are optional peer
|
|
10
|
+
* dependencies, dynamically imported only when needed. For direct driver
|
|
11
|
+
* construction without auto-detection, use `db/db_pg.ts`, `db/db_pglite.ts`
|
|
12
|
+
* or `db/db_pglet.ts` — an in-memory PGlite is `create_pglite_db(new PGlite())`.
|
|
12
13
|
*
|
|
13
14
|
* @module
|
|
14
15
|
*/
|
|
15
16
|
import { create_pg_db, register_pg_type_parsers } from './db_pg.js';
|
|
16
17
|
import { create_pglite_db } from './db_pglite.js';
|
|
18
|
+
import { create_pglet_db_driver, create_pglet_instance } from './db_pglet.js';
|
|
17
19
|
/**
|
|
18
20
|
* Create a database connection based on a URL.
|
|
19
21
|
*
|
|
@@ -21,12 +23,13 @@ import { create_pglite_db } from './db_pglite.js';
|
|
|
21
23
|
* know which driver is in use.
|
|
22
24
|
*
|
|
23
25
|
* For direct driver construction without URL routing, import
|
|
24
|
-
* `create_pg_db` from `db/db_pg.ts
|
|
26
|
+
* `create_pg_db` from `db/db_pg.ts`, `create_pglite_db` from `db/db_pglite.ts`
|
|
27
|
+
* or `create_pglet_db_driver` from `db/db_pglet.ts`.
|
|
25
28
|
*
|
|
26
29
|
* @param database_url - connection URL (`postgres://`, `postgresql://`, `file://`, or `memory://`)
|
|
27
30
|
* @returns database instance, close callback, type, and display name
|
|
28
31
|
* @throws Error if `database_url` uses an unsupported scheme. Driver
|
|
29
|
-
* construction (`pg.Pool` or
|
|
32
|
+
* construction (`pg.Pool`, `PGlite` or pglet) may also throw on bad connection
|
|
30
33
|
* parameters or missing peer-dependency packages.
|
|
31
34
|
*/
|
|
32
35
|
export const create_db = async (database_url) => {
|
|
@@ -43,10 +46,8 @@ export const create_db = async (database_url) => {
|
|
|
43
46
|
};
|
|
44
47
|
}
|
|
45
48
|
if (database_url.startsWith('memory://')) {
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
const { db, close } = create_pglite_db(pglite);
|
|
49
|
-
return { db, close, db_type: 'pglite-memory', db_name: '(memory)' };
|
|
49
|
+
const { db, close } = create_pglet_db_driver(await create_pglet_instance());
|
|
50
|
+
return { db, close, db_type: 'pglet-memory', db_name: '(memory)' };
|
|
50
51
|
}
|
|
51
52
|
if (database_url.startsWith('file://')) {
|
|
52
53
|
const path = new URL(database_url).pathname;
|
package/dist/db/db.d.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
* Database wrapper with duck-typed interface.
|
|
3
3
|
*
|
|
4
4
|
* Accepts any client with a query(text, values) method.
|
|
5
|
-
*
|
|
5
|
+
* `pg.Pool`, `@electric-sql/pglite` and `@fuzdev/pglet-wasm` all satisfy this interface.
|
|
6
6
|
*
|
|
7
7
|
* Transaction safety is provided by an injected `transaction` callback —
|
|
8
|
-
* the driver adapters (`db/db_pg.ts`, `db/db_pglite.ts`) supply the driver-appropriate
|
|
8
|
+
* the driver adapters (`db/db_pg.ts`, `db/db_pglite.ts`, `db/db_pglet.ts`) supply the driver-appropriate
|
|
9
9
|
* implementation. Close is handled externally (returned alongside the `Db`
|
|
10
10
|
* as `DbDriverResult`), not as a method on this class.
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
|
-
* Minimal interface that
|
|
15
|
+
* Minimal interface that pg, pglite and pglet satisfy.
|
|
16
16
|
*/
|
|
17
17
|
export interface DbClient {
|
|
18
18
|
query: <T = unknown>(text: string, values?: Array<unknown>) => Promise<{
|
|
@@ -25,6 +25,7 @@ export interface DbClient {
|
|
|
25
25
|
* `transaction` is injected by `create_db` which knows the driver.
|
|
26
26
|
* For `pg`: acquires a dedicated pool client per transaction.
|
|
27
27
|
* For PGlite: delegates to `pglite.transaction()`.
|
|
28
|
+
* For pglet: delegates to the adapter's `transaction()`.
|
|
28
29
|
*/
|
|
29
30
|
export interface DbDeps {
|
|
30
31
|
client: DbClient;
|
|
@@ -33,7 +34,7 @@ export interface DbDeps {
|
|
|
33
34
|
/**
|
|
34
35
|
* Result of constructing a driver-specific `Db`.
|
|
35
36
|
*
|
|
36
|
-
* Returned by `create_pg_db()` and `
|
|
37
|
+
* Returned by `create_pg_db()`, `create_pglite_db()` and `create_pglet_db_driver()`.
|
|
37
38
|
* The `close` callback is bound to the actual driver — callers
|
|
38
39
|
* never need to know which driver is in use.
|
|
39
40
|
*/
|
|
@@ -43,7 +44,7 @@ export interface DbDriverResult {
|
|
|
43
44
|
close: () => Promise<void>;
|
|
44
45
|
}
|
|
45
46
|
/** Database driver type. */
|
|
46
|
-
export type DbType = 'postgres' | 'pglite-file' | '
|
|
47
|
+
export type DbType = 'postgres' | 'pglite-file' | 'pglet-memory';
|
|
47
48
|
/**
|
|
48
49
|
* Sentinel transaction function for transaction-scoped `Db` instances.
|
|
49
50
|
*
|
|
@@ -56,8 +57,9 @@ export declare const no_nested_transaction: DbDeps['transaction'];
|
|
|
56
57
|
/**
|
|
57
58
|
* Database wrapper providing a consistent query and transaction interface.
|
|
58
59
|
*
|
|
59
|
-
* Construct via `create_pg_db()` from `db/db_pg.ts
|
|
60
|
-
* `db/db_pglite.ts`
|
|
60
|
+
* Construct via `create_pg_db()` from `db/db_pg.ts`, `create_pglite_db()` from
|
|
61
|
+
* `db/db_pglite.ts` or `create_pglet_db_driver()` from `db/db_pglet.ts` for proper
|
|
62
|
+
* transaction support, or via `create_db()` for
|
|
61
63
|
* URL-based auto-detection.
|
|
62
64
|
*
|
|
63
65
|
* @example
|
package/dist/db/db.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/db.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM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CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAKxE;;;;;;OAMG;IACG,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKjF;;;;;;;;;;;OAWG;IACG,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAG/D"}
|
package/dist/db/db.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Database wrapper with duck-typed interface.
|
|
3
3
|
*
|
|
4
4
|
* Accepts any client with a query(text, values) method.
|
|
5
|
-
*
|
|
5
|
+
* `pg.Pool`, `@electric-sql/pglite` and `@fuzdev/pglet-wasm` all satisfy this interface.
|
|
6
6
|
*
|
|
7
7
|
* Transaction safety is provided by an injected `transaction` callback —
|
|
8
|
-
* the driver adapters (`db/db_pg.ts`, `db/db_pglite.ts`) supply the driver-appropriate
|
|
8
|
+
* the driver adapters (`db/db_pg.ts`, `db/db_pglite.ts`, `db/db_pglet.ts`) supply the driver-appropriate
|
|
9
9
|
* implementation. Close is handled externally (returned alongside the `Db`
|
|
10
10
|
* as `DbDriverResult`), not as a method on this class.
|
|
11
11
|
*
|
|
@@ -25,8 +25,9 @@ export const no_nested_transaction = () => {
|
|
|
25
25
|
/**
|
|
26
26
|
* Database wrapper providing a consistent query and transaction interface.
|
|
27
27
|
*
|
|
28
|
-
* Construct via `create_pg_db()` from `db/db_pg.ts
|
|
29
|
-
* `db/db_pglite.ts`
|
|
28
|
+
* Construct via `create_pg_db()` from `db/db_pg.ts`, `create_pglite_db()` from
|
|
29
|
+
* `db/db_pglite.ts` or `create_pglet_db_driver()` from `db/db_pglet.ts` for proper
|
|
30
|
+
* transaction support, or via `create_db()` for
|
|
30
31
|
* URL-based auto-detection.
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pglet driver adapter for `Db`.
|
|
3
|
+
*
|
|
4
|
+
* Provides `create_pglet_instance()`, which loads `@fuzdev/pglet-wasm` on
|
|
5
|
+
* demand and creates an in-memory instance with `PGLET_COERCION`, the value
|
|
6
|
+
* coercion every fuz_app pglet instance is created with, and
|
|
7
|
+
* `create_pglet_db_driver()` to construct a `Db` backed by one. The package is
|
|
8
|
+
* imported dynamically, so it stays an optional peer.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import type { CoercionOptions, PgletDb } from '@fuzdev/pglet-wasm';
|
|
13
|
+
import { type DbDriverResult } from './db.js';
|
|
14
|
+
/**
|
|
15
|
+
* The value coercion fuz_app creates every pglet instance with.
|
|
16
|
+
*
|
|
17
|
+
* The adapter defaults int8 to `bigint`; fuz_app reads int8 as a JS number on
|
|
18
|
+
* every driver (`register_pg_type_parsers` for `pg`, PGlite's own default), so
|
|
19
|
+
* `AuditLogEvent.seq` and friends validate identically across drivers.
|
|
20
|
+
*/
|
|
21
|
+
export declare const PGLET_COERCION: CoercionOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Create an in-memory pglet instance with `PGLET_COERCION`.
|
|
24
|
+
*
|
|
25
|
+
* Loads `@fuzdev/pglet-wasm` on demand and awaits its `init()` — a no-op on the
|
|
26
|
+
* package's Node entry, where the wasm loads at import; the browser entry loads
|
|
27
|
+
* it here.
|
|
28
|
+
*
|
|
29
|
+
* @returns a fresh, empty instance; wrap it with `create_pglet_db_driver`
|
|
30
|
+
*/
|
|
31
|
+
export declare const create_pglet_instance: () => Promise<PgletDb>;
|
|
32
|
+
/**
|
|
33
|
+
* Create a `Db` backed by a pglet instance.
|
|
34
|
+
*
|
|
35
|
+
Named `_driver` to stay clear of `@fuzdev/pglet-wasm`'s own `create_pglet_db`,
|
|
36
|
+
* which creates the instance this wraps. Create it with `create_pglet_instance`
|
|
37
|
+
* (or with `PGLET_COERCION`) so it reads values as the other drivers do.
|
|
38
|
+
*
|
|
39
|
+
* @param pglet - a `@fuzdev/pglet-wasm` instance
|
|
40
|
+
* @returns the `Db` instance and a `close` callback bound to `pglet.close()`
|
|
41
|
+
*/
|
|
42
|
+
export declare const create_pglet_db_driver: (pglet: PgletDb) => DbDriverResult;
|
|
43
|
+
//# sourceMappingURL=db_pglet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db_pglet.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/db_pglet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,eAAoC,CAAC;AAElE;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,OAAO,CAI7D,CAAC;AAaF;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,cAGtD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pglet driver adapter for `Db`.
|
|
3
|
+
*
|
|
4
|
+
* Provides `create_pglet_instance()`, which loads `@fuzdev/pglet-wasm` on
|
|
5
|
+
* demand and creates an in-memory instance with `PGLET_COERCION`, the value
|
|
6
|
+
* coercion every fuz_app pglet instance is created with, and
|
|
7
|
+
* `create_pglet_db_driver()` to construct a `Db` backed by one. The package is
|
|
8
|
+
* imported dynamically, so it stays an optional peer.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { Db, no_nested_transaction } from './db.js';
|
|
13
|
+
/**
|
|
14
|
+
* The value coercion fuz_app creates every pglet instance with.
|
|
15
|
+
*
|
|
16
|
+
* The adapter defaults int8 to `bigint`; fuz_app reads int8 as a JS number on
|
|
17
|
+
* every driver (`register_pg_type_parsers` for `pg`, PGlite's own default), so
|
|
18
|
+
* `AuditLogEvent.seq` and friends validate identically across drivers.
|
|
19
|
+
*/
|
|
20
|
+
export const PGLET_COERCION = { int8: 'number' };
|
|
21
|
+
/**
|
|
22
|
+
* Create an in-memory pglet instance with `PGLET_COERCION`.
|
|
23
|
+
*
|
|
24
|
+
* Loads `@fuzdev/pglet-wasm` on demand and awaits its `init()` — a no-op on the
|
|
25
|
+
* package's Node entry, where the wasm loads at import; the browser entry loads
|
|
26
|
+
* it here.
|
|
27
|
+
*
|
|
28
|
+
* @returns a fresh, empty instance; wrap it with `create_pglet_db_driver`
|
|
29
|
+
*/
|
|
30
|
+
export const create_pglet_instance = async () => {
|
|
31
|
+
const pglet_wasm = await import('@fuzdev/pglet-wasm');
|
|
32
|
+
await pglet_wasm.init();
|
|
33
|
+
return pglet_wasm.create_pglet_db({ coercion: PGLET_COERCION });
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Create a transaction implementation for pglet.
|
|
37
|
+
*
|
|
38
|
+
* Delegates to the adapter's single-flight `transaction()` (`BEGIN` / `COMMIT`,
|
|
39
|
+
* `ROLLBACK` on throw).
|
|
40
|
+
*/
|
|
41
|
+
const create_pglet_transaction = (pglet) => async (fn) => pglet.transaction(async (tx) => fn(new Db({ client: tx, transaction: no_nested_transaction })));
|
|
42
|
+
/**
|
|
43
|
+
* Create a `Db` backed by a pglet instance.
|
|
44
|
+
*
|
|
45
|
+
Named `_driver` to stay clear of `@fuzdev/pglet-wasm`'s own `create_pglet_db`,
|
|
46
|
+
* which creates the instance this wraps. Create it with `create_pglet_instance`
|
|
47
|
+
* (or with `PGLET_COERCION`) so it reads values as the other drivers do.
|
|
48
|
+
*
|
|
49
|
+
* @param pglet - a `@fuzdev/pglet-wasm` instance
|
|
50
|
+
* @returns the `Db` instance and a `close` callback bound to `pglet.close()`
|
|
51
|
+
*/
|
|
52
|
+
export const create_pglet_db_driver = (pglet) => ({
|
|
53
|
+
db: new Db({ client: pglet, transaction: create_pglet_transaction(pglet) }),
|
|
54
|
+
close: () => pglet.close()
|
|
55
|
+
});
|
package/dist/testing/CLAUDE.md
CHANGED
|
@@ -116,24 +116,23 @@ Factory builders for parameterized DB tests. Consumer projects pass their
|
|
|
116
116
|
`init_schema` callback (which calls `run_migrations(db, [auth_migration_ns, ...app_migrations])`);
|
|
117
117
|
factories accept any migration namespace set.
|
|
118
118
|
|
|
119
|
-
- `IS_CI` — `process.env.CI === 'true'`.
|
|
120
119
|
- `DbFactory` — `{name, create, close, skip, skip_reason?}`.
|
|
121
|
-
- `
|
|
122
|
-
- `
|
|
123
|
-
- `
|
|
124
|
-
- `
|
|
120
|
+
- `reset_public_schema(db)` — `DROP SCHEMA public CASCADE; CREATE SCHEMA public`, in plain SQL, so it resets every driver. Every factory calls it per `create()`, so `init_schema` only migrates. Drift-proof — no drop list to maintain.
|
|
121
|
+
- `create_default_db_factory(init_schema)` — the default in-memory factory: pglet-wasm, or the builder `set_default_db_factory` installed before it was built. What fuz_app's own helpers fall back to (`create_test_app_server`, `describe_rate_limiting_tests`, `describe_sse_route_tests`).
|
|
122
|
+
- `create_pglet_wasm_factory(init_schema)` / `create_pglite_factory(init_schema)` — pin pglet-wasm (`@fuzdev/pglet-wasm`, created with `PGLET_COERCION`) or PGlite; each needs its optional peer installed; `skip: false`. See WASM caching below.
|
|
123
|
+
- `set_default_db_factory(create_factory | null)` — install a `DbFactoryBuilder` for `create_default_db_factory`, so suites written against the default run on another driver without being edited (`create_pglite_factory` to run them on PGlite); returns the builder it replaced, so a caller can put it back. Install from a `db`-project `setupFiles` entry, before any factory is built (../../../docs/testing.md §Switching the default driver). Injected rather than selected here: a driver it can wrap may live in test-side code this shipped module can't import (fuz_app's `pglet-server`). fuz_app's own switch is `src/test/db_default.ts` (`FUZ_TEST_DB_DEFAULT`).
|
|
124
|
+
- `create_pg_factory(init_schema, test_url?)` — PostgreSQL; `skip: true` when `test_url` missing. Each `create()` opens a pool and resets the `public` schema before `init_schema`, like every other factory, so a persistent test database carries no stale DDL; a missing database (`3D000`) gets a `createdb` hint. Pool reused + cleaned up across `create()` calls.
|
|
125
125
|
- `auth_truncate_tables` — `['invite', 'api_token', 'auth_session', 'role_grant', 'role_grant_offer', 'actor', 'account']` in FK-safe order. Excludes `audit_log` — unit DB tests don't need to truncate it.
|
|
126
126
|
- `auth_integration_truncate_tables` — `auth_truncate_tables + ['audit_log']` for integration suites that exercise the audit path.
|
|
127
|
-
- `drop_auth_schema(db)` — `DROP SCHEMA public CASCADE; CREATE SCHEMA public`; call at the top of `init_schema` on persistent pg databases that may hold stale DDL from previous fuz_app versions. Drift-proof full-schema reset (despite the name, not auth-scoped) — same mechanism as `reset_pglite`.
|
|
128
127
|
- `create_describe_db(factories, truncate_tables)` — returns `describe_db(name, fn)` running `fn(get_db)` once per factory inside a `describe` with shared `beforeAll(create)` + `beforeEach(TRUNCATE)` + `afterAll(close)`. Skipped factories use `describe.skip`.
|
|
129
128
|
- `log_db_factory_status(factories)` — console summary of enabled / skipped factories.
|
|
130
129
|
- `assert_columns_match_live(db, table, columns)` — the named-projection drift guard: asserts a `*_COLUMNS` const (`ACCOUNT_COLUMNS`, `CELL_COLUMNS`, a consumer's own) names exactly the live `public`-schema columns of `table`, via `query_public_columns(db, {table})`. Per module, or iterated from a table → const registry (fuz_app's own: `src/test/db/column_projections.db.test.ts`).
|
|
131
130
|
|
|
132
|
-
**
|
|
133
|
-
instance in a module-level
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
reset. The `db` vitest project (opted into by the `.db.test.ts` suffix) runs
|
|
131
|
+
**WASM caching.** `create_pglite_factory` and `create_pglet_wasm_factory` each
|
|
132
|
+
share a single instance of their driver, held in a module-level promise, across the
|
|
133
|
+
factories they build. Every `create()` calls `DROP SCHEMA public CASCADE` and
|
|
134
|
+
re-runs its `init_schema` instead of paying the WASM cold start again, so suites
|
|
135
|
+
share state until the next reset. The `db` vitest project (opted into by the `.db.test.ts` suffix) runs
|
|
137
136
|
with `isolate: false` + `fileParallelism: false` to amortize WASM boot across
|
|
138
137
|
every DB test file — which also makes that one instance the whole run's; a
|
|
139
138
|
project that isolates its files gets one per worker instead.
|
|
@@ -152,7 +151,7 @@ Key module-scope values:
|
|
|
152
151
|
- `stub_password_deps` — `PasswordHashDeps` hashing via `stub_hash_${password}` and verifying by equality. Deterministic, no Argon2 cost — use for every test not specifically exercising password hashing.
|
|
153
152
|
- `create_loopback_app_server_options()` — the loopback `create_app_server` options an in-process test server takes (`localhost` origins, the loopback proxy trusted, an empty env schema), fresh per call; `create_test_app` and `create_test_app_for_bootstrap` spread it under their own defaults (`rate_limiters: 'disabled_for_testing'`, `await_pending_effects: true`).
|
|
154
153
|
- `TEST_COOKIE_SECRET` — 64-hex-char deterministic cookie secret. Produces a valid `Keyring` via `create_validated_keyring`. Never used in production — the stub guard plus fixed value is the contract.
|
|
155
|
-
- `
|
|
154
|
+
- `fallback_db_factory` — module-level auth-only default factory (`create_default_db_factory`) `create_test_app_server` uses when no `db` is passed, reusing its driver's WASM cache. When `migration_namespaces` is supplied, a memoized sibling factory (keyed by namespace set) migrating `[auth_migration_ns, ...migration_namespaces]` is used instead — same shared WASM, extra tables.
|
|
156
155
|
|
|
157
156
|
Two helpers share the "insert account + actor + roles + API token + session +
|
|
158
157
|
cookie" flow, split by intent:
|
|
@@ -170,7 +169,7 @@ pre-keeper, lock unflipped), use `create_test_app_for_bootstrap` — pair with
|
|
|
170
169
|
Types:
|
|
171
170
|
|
|
172
171
|
- `TestAppServer extends AppBackend` — adds `account`, `actor`, `api_token`, `session_cookie`, `keyring`, `cleanup()`.
|
|
173
|
-
- `TestAppServerOptions` — `session_options` (required), optional `db`, `db_type`, `migration_namespaces`, `password`, `username`, `password_value`, `roles`, `audit_factory`. `migration_namespaces` runs extra namespaces after auth in the auto-created
|
|
172
|
+
- `TestAppServerOptions` — `session_options` (required), optional `db`, `db_type`, `migration_namespaces`, `password`, `username`, `password_value`, `roles`, `audit_factory`. `migration_namespaces` runs extra namespaces after auth in the auto-created in-memory database (mirrors `create_app_backend`); mutually exclusive with `db` (caller-migrated) — passing both throws. The optional `audit_factory` defaults to `default_audit_factory` (no-listener `create_audit_emitter` over the test backend's `{db, log}`); pass a custom factory to compose `on_audit_event` / `audit_log_config`, instrument `emit` with `emit_decorator`, or otherwise replace the emitter. Mirrors `CreateAppBackendOptions` end-to-end — the previous `on_audit_event` / `audit_log_config` sugar was removed alongside the production rename.
|
|
174
173
|
- `CreateTestAppOptions extends TestAppServerOptions` — adds `create_route_specs` (required), `rpc_endpoints?: RpcEndpointsSuiteOption` (top-level only — single source of truth, symmetric with the suite-level option), `bootstrap?: BootstrapServerOptions` (top-level only — same precedent as `rpc_endpoints`), and `app_options?: SuiteAppOptions` (`Partial<AppServerOptions>` excluding the five fields the helper manages: `backend`, `session_options`, `create_route_specs`, `rpc_endpoints`, `bootstrap`).
|
|
175
174
|
- `TestAccount` — `{account, actor, session_cookie, api_token, create_session_headers, create_bearer_headers}`.
|
|
176
175
|
- `TestApp` — `{app, backend, server, surface_spec, surface, route_specs, create_session_headers, create_bearer_headers, create_daemon_token_headers, create_account, cleanup}`. `server` is the assembled `AppServer`, for what `create_app_server` built beyond the lifted fields — `require_audit_sse(test_app.server)` with `audit_log_sse` in `app_options`, `test_app.server.ws_endpoints[path]` — instead of capturing them from a `create_route_specs` closure.
|
|
@@ -199,7 +198,7 @@ schedule stopped by `cleanup()`, which is the assembled server's `close`.
|
|
|
199
198
|
|
|
200
199
|
A fresh Hono app is created on every call because middleware closures bind
|
|
201
200
|
to the server's deps (db, keyring). Hono assembly is cheap (~10–50ms);
|
|
202
|
-
|
|
201
|
+
the WASM caching in `db.ts` is where the real savings are.
|
|
203
202
|
|
|
204
203
|
### `auth_apps.ts` — adversarial-auth app factories
|
|
205
204
|
|
|
@@ -624,7 +623,7 @@ the spread are ignored by the suite.
|
|
|
624
623
|
|
|
625
624
|
### `integration.ts` — `describe_standard_integration_tests`
|
|
626
625
|
|
|
627
|
-
Exercises the full stack against real
|
|
626
|
+
Exercises the full stack against a real in-memory database + auth middleware + session
|
|
628
627
|
cookies + bearer tokens. The suite has ~19 `describe` blocks grouped under
|
|
629
628
|
these thematic areas:
|
|
630
629
|
|
|
@@ -1469,7 +1468,7 @@ are `src/test/auth/cell_crud_parity.db.test.ts`
|
|
|
1469
1468
|
passed the **transactional** `Db` the auth wipe ran on, so DB-domain
|
|
1470
1469
|
consumers (e.g. fuz_forge truncating its cell / fact / file tables) reset
|
|
1471
1470
|
on the same connection rather than a separately-pooled one that would
|
|
1472
|
-
deadlock against this open transaction under
|
|
1471
|
+
deadlock against this open transaction under the in-memory drivers. Auth
|
|
1473
1472
|
gates on `credential_types: ['daemon_token']` — effectively keeper-only
|
|
1474
1473
|
without forcing the `actor: 'required'` ⟺ `acting?: ActingActor`
|
|
1475
1474
|
biconditional. No free-form runtime grant action exists — see the
|
|
@@ -1857,7 +1856,7 @@ re-roll the serve / daemon-info / WS-attach / drain boilerplate:
|
|
|
1857
1856
|
- `testing/cross_backend/testing_server_bun.ts` — `create_bun_testing_adapter()` (`Bun.serve` + `@hono/bun`'s module-level `getConnInfo`, `upgradeWebSocket`, and `websocket`; `Bun.serve` declared locally so it typechecks under the Node toolchain). Needs the optional `@hono/bun` peer dep (the counterpart to Node's `@hono/node-server` + `@hono/node-ws`; `Bun.serve` is built in), and Bun resolves `.js`→`.ts` natively (no flag, unlike Deno). Reuses `create_node_runtime` (Bun implements the `node:fs`/`node:process` surface). WS is module-level + stateless (like Deno) — the `websocket` handler is threaded into `serve`, where `Bun.serve` wants it, so no post-serve attach. It carries `maxPayloadLength` at twice `max_message_bytes` rather than Bun's 16 MiB default: past its cap Bun drops the socket without a close frame (1006), so the headroom leaves a message just over the limit to the per-message check (`WS_CLOSE_MESSAGE_TOO_BIG`, as on Node), while a grossly oversized one is refused before Bun buffers it whole.
|
|
1858
1857
|
- `testing/cross_backend/default_spine_surface.ts` — the canonical no-domain spine surface (account/admin/audit/signup + bootstrap): `spine_session_options`, `spine_roles`, `create_spine_route_specs`, `spine_rpc_endpoints`, `create_spine_surface_spec`. This is the **declared** surface — the `create_standard_rpc_actions` bundle the spec-derived suites auto-enumerate. It passes `daemon_token: true` (both spine binaries mount the daemon-token layer) and leaves `GET /api/surface` at its default, off — the TS spine binary does too, and the Rust `testing_spine_stub` serves none. Shared by the spine_stub cross test, the TS cross tests, and the binary.
|
|
1859
1858
|
- `testing/cross_backend/full_spine_mount.ts` — `build_full_spine_rpc_actions(deps, options)` — the **full** live RPC mount: the declared bundle **plus** the off-declared-surface families the binary live-mounts (`_testing_*` backdoors, the cell verb set, the opt-in `actor_lookup` / `actor_search` resolvers). `build_full_spine_mount(deps, options)` builds it once for both of the binary's endpoints, returning `FullSpineMount` (`{rpc_actions, ws_actions}`): the WS list is `protocol_actions` plus every RPC action not already among them, twinning the Rust `testing_spine_stub`, which serves one registry on RPC and WS (the one difference is `cancel` — a registered protocol action on TS, owned by the read loop on Rust). Single-sources the mount so the binary and the `spine_method_coverage` reconciliation test build the same list.
|
|
1860
|
-
- `testing/cross_backend/ts_spine_backend_config.ts` — `ts_spine_node_backend_config()` / `ts_spine_deno_backend_config()` / `ts_spine_bun_backend_config()` presets (in-memory
|
|
1859
|
+
- `testing/cross_backend/ts_spine_backend_config.ts` — `ts_spine_node_backend_config()` / `ts_spine_deno_backend_config()` / `ts_spine_bun_backend_config()` presets (in-memory pglet, no external infra), the TS analog of `rust_spine_stub_backend_config()`.
|
|
1861
1860
|
|
|
1862
1861
|
fuz_app's own binary wiring (`src/test/cross_backend/testing_spine_server{,_node,_deno,_bun}.ts`) is the worked example: ~one `build_app` over `create_app_backend` + `create_app_server` (`rate_limiters: 'disabled_for_testing'` plus whichever login / action limiters its env toggles built, `build_full_spine_mount`'s two lists on one `rpc_endpoints` entry and one `ws_endpoints` entry, whose `transport` is also the role-grant-offer `notification_sender`), reusing `default_spine_surface`. `src/test/cross_backend/testing_spine_server.db.test.ts` builds it with the Node adapter in-process and asserts its surface lists `/api/ws` and passes the surface invariants. The `_node`/`_deno`/`_bun` entries differ only in which adapter they wire — `build_spine_app` is runtime-agnostic. It leaves `create_app_server`'s `auth_cleanup` off, as the Rust `testing_spine_stub` leaves its twin unscheduled: a background pass would delete rows and write audit rows under a running suite. A consumer's cross-process test binary may schedule it when nothing its suites seed is already expired (the conformance table's `expired_session` principal seeds a backdated session row); an in-process harness leaves it off.
|
|
1863
1862
|
|
|
@@ -1925,7 +1924,7 @@ fuz_app also ships its **own** `npm run benchmark:cross-impl`
|
|
|
1925
1924
|
(`src/benchmarks/cross_impl.bench.ts`) on the back of its TS spine binary —
|
|
1926
1925
|
ts-node + ts-deno + ts-bun (+ the Rust `spine_stub` when `FUZ_TESTING_RUST_SPINE_STUB_BIN`
|
|
1927
1926
|
is set). The three TS runtimes are apples-to-apples with each other (same
|
|
1928
|
-
|
|
1927
|
+
in-memory pglet driver); TS-vs-Rust carries the pglet-vs-Postgres DB-layer caveat
|
|
1929
1928
|
(documented in the run). The artifact (`*.latest.json`) is gitignored.
|
|
1930
1929
|
|
|
1931
1930
|
- `bench/scenario.ts` — `BenchScenario` (`{name, requires?, run}`) +
|
|
@@ -3,7 +3,7 @@ import './assert_dev_env.js';
|
|
|
3
3
|
* Bootstrapped app server factory for integration tests.
|
|
4
4
|
*
|
|
5
5
|
* Creates a keeper account, API token, and signed session cookie on a
|
|
6
|
-
* database. By default uses a cached in-memory
|
|
6
|
+
* database. By default uses a cached in-memory pglet (one shared WASM instance
|
|
7
7
|
* per loaded copy of `testing/db.ts` — once per run under the `db` project's
|
|
8
8
|
* `isolate: false` + `fileParallelism: false`); pass `db` to use
|
|
9
9
|
* an existing database (any driver) instead.
|
|
@@ -168,11 +168,11 @@ export interface TestAppServerOptions {
|
|
|
168
168
|
session_options: SessionOptions<string>;
|
|
169
169
|
/** Existing database — skips internal DB creation when provided. Caller owns the DB lifecycle. */
|
|
170
170
|
db?: Db;
|
|
171
|
-
/** Database driver type — only used when `db` is provided. Default: `'
|
|
171
|
+
/** Database driver type — only used when `db` is provided. Default: `'pglet-memory'`. */
|
|
172
172
|
db_type?: DbType;
|
|
173
173
|
/**
|
|
174
174
|
* Extra migration namespaces run after the builtin auth namespace in the
|
|
175
|
-
* auto-created in-memory
|
|
175
|
+
* auto-created in-memory database, mirroring `create_app_backend`'s
|
|
176
176
|
* `migration_namespaces`. For suites whose backend needs tables beyond
|
|
177
177
|
* auth — the cell parity suite passes `[CELL_MIGRATION_NS]`. The harness
|
|
178
178
|
* builds + caches a fresh-per-test factory migrating
|
|
@@ -209,7 +209,7 @@ export interface TestAppServerOptions {
|
|
|
209
209
|
* Create an app server with a bootstrapped account for testing.
|
|
210
210
|
*
|
|
211
211
|
* Sets up:
|
|
212
|
-
* - Auth tables (via cached
|
|
212
|
+
* - Auth tables (via the cached default factory, or reuses existing `db`)
|
|
213
213
|
* - A keeper account with hashed password
|
|
214
214
|
* - Role role_grants for each role in `options.roles`
|
|
215
215
|
* - An API token for Bearer auth
|
|
@@ -348,7 +348,7 @@ export declare const create_loopback_app_server_options: () => Pick<AppServerOpt
|
|
|
348
348
|
*
|
|
349
349
|
* A fresh Hono app is created each call — middleware closures bind to the
|
|
350
350
|
* server's deps (db, keyring), so reuse across servers is unsafe.
|
|
351
|
-
* The expensive resource (
|
|
351
|
+
* The expensive resource (the WASM database) is cached separately in `testing/db.ts`.
|
|
352
352
|
*
|
|
353
353
|
* @param options - test app configuration
|
|
354
354
|
* @returns a `TestApp` ready for HTTP testing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/app_server.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE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