joist-orm 2.3.0-next.41 → 2.3.0-next.43
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/build/_virtual/_rolldown/runtime.cjs +23 -0
- package/build/_virtual/_rolldown/runtime.js +5 -0
- package/build/codegen.cjs +19 -0
- package/build/codegen.cjs.map +1 -0
- package/build/codegen.d.cts +1 -0
- package/build/codegen.d.mts +1 -0
- package/build/codegen.js +11 -28
- package/build/codegen.js.map +1 -1
- package/build/drivers/PostgresDriver.cjs +290 -0
- package/build/drivers/PostgresDriver.cjs.map +1 -0
- package/build/drivers/PostgresDriver.d.cts +77 -0
- package/build/drivers/PostgresDriver.d.cts.map +1 -0
- package/build/drivers/PostgresDriver.d.mts +77 -0
- package/build/drivers/PostgresDriver.d.mts.map +1 -0
- package/build/drivers/PostgresDriver.js +249 -325
- package/build/drivers/PostgresDriver.js.map +1 -1
- package/build/drivers/WireRowData.cjs +374 -0
- package/build/drivers/WireRowData.cjs.map +1 -0
- package/build/drivers/WireRowData.d.cts +111 -0
- package/build/drivers/WireRowData.d.cts.map +1 -0
- package/build/drivers/WireRowData.d.mts +111 -0
- package/build/drivers/WireRowData.d.mts.map +1 -0
- package/build/drivers/WireRowData.js +352 -412
- package/build/drivers/WireRowData.js.map +1 -1
- package/build/drivers/binaryParsers.cjs +422 -0
- package/build/drivers/binaryParsers.cjs.map +1 -0
- package/build/drivers/{binaryParsers.d.ts → binaryParsers.d.cts} +18 -14
- package/build/drivers/binaryParsers.d.cts.map +1 -0
- package/build/drivers/binaryParsers.d.mts +80 -0
- package/build/drivers/binaryParsers.d.mts.map +1 -0
- package/build/drivers/binaryParsers.js +315 -385
- package/build/drivers/binaryParsers.js.map +1 -1
- package/build/drivers/patchPgProtocol.cjs +255 -0
- package/build/drivers/patchPgProtocol.cjs.map +1 -0
- package/build/drivers/{patchPgProtocol.d.ts → patchPgProtocol.d.cts} +18 -14
- package/build/drivers/patchPgProtocol.d.cts.map +1 -0
- package/build/drivers/patchPgProtocol.d.mts +47 -0
- package/build/drivers/patchPgProtocol.d.mts.map +1 -0
- package/build/drivers/patchPgProtocol.js +211 -232
- package/build/drivers/patchPgProtocol.js.map +1 -1
- package/build/graphql-codegen-export.cjs +10 -0
- package/build/graphql-codegen-export.d.cts +1 -0
- package/build/graphql-codegen-export.d.mts +1 -0
- package/build/graphql-codegen-export.js +2 -19
- package/build/graphql-export.cjs +10 -0
- package/build/graphql-export.d.cts +1 -0
- package/build/graphql-export.d.mts +1 -0
- package/build/graphql-export.js +2 -19
- package/build/index.cjs +41 -0
- package/build/index.d.cts +3 -0
- package/build/index.d.mts +3 -0
- package/build/index.js +3 -27
- package/build/knex-export.cjs +10 -0
- package/build/knex-export.d.cts +1 -0
- package/build/knex-export.d.mts +1 -0
- package/build/knex-export.js +2 -19
- package/build/pg-export.cjs +13 -0
- package/build/pg-export.d.cts +4 -0
- package/build/pg-export.d.mts +4 -0
- package/build/pg-export.js +4 -20
- package/build/pg-migrate.cjs +22 -0
- package/build/pg-migrate.cjs.map +1 -0
- package/build/pg-migrate.d.cts +1 -0
- package/build/pg-migrate.d.mts +1 -0
- package/build/pg-migrate.js +13 -28
- package/build/pg-migrate.js.map +1 -1
- package/build/seed.cjs +49 -0
- package/build/seed.cjs.map +1 -0
- package/build/{seed.d.ts → seed.d.cts} +5 -1
- package/build/seed.d.cts.map +1 -0
- package/build/seed.d.mts +24 -0
- package/build/seed.d.mts.map +1 -0
- package/build/seed.js +39 -45
- package/build/seed.js.map +1 -1
- package/build/tests-export.cjs +10 -0
- package/build/tests-export.d.cts +1 -0
- package/build/tests-export.d.mts +1 -0
- package/build/tests-export.js +2 -19
- package/package.json +150 -28
- package/build/codegen.d.ts +0 -2
- package/build/drivers/PostgresDriver.d.ts +0 -73
- package/build/drivers/WireRowData.d.ts +0 -107
- package/build/graphql-codegen-export.d.ts +0 -1
- package/build/graphql-codegen-export.js.map +0 -1
- package/build/graphql-export.d.ts +0 -1
- package/build/graphql-export.js.map +0 -1
- package/build/index.d.ts +0 -3
- package/build/index.js.map +0 -1
- package/build/knex-export.d.ts +0 -1
- package/build/knex-export.js.map +0 -1
- package/build/pg-export.d.ts +0 -3
- package/build/pg-export.js.map +0 -1
- package/build/pg-migrate.d.ts +0 -2
- package/build/tests-export.d.ts +0 -1
- package/build/tests-export.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/drivers/binaryParsers.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Joist's registry of PostgreSQL *binary-format* cell parsers, used by `WireRowData` for lazy
|
|
3
4
|
* `em.find`/`em.load` results (which request binary output; see `executeRowDataQuery`).
|
|
@@ -22,11 +23,11 @@
|
|
|
22
23
|
* `Temporal.PlainDate`/`ZonedDateTime`/etc. directly, and the temporal mappers pass
|
|
23
24
|
* already-constructed instances through.
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
declare function setBinaryTypeParser(oid: number, parse: BinaryParse): void;
|
|
26
27
|
/** Returns the registered binary parser for `oid`, i.e. for tests to save/restore. */
|
|
27
|
-
|
|
28
|
+
declare function getBinaryTypeParser(oid: number): BinaryParse | undefined;
|
|
28
29
|
/** Decodes one binary cell directly from the payload chunk; `length` is the cell's byte length. */
|
|
29
|
-
|
|
30
|
+
type BinaryParse = (chunk: Buffer, start: number, length: number) => any;
|
|
30
31
|
/**
|
|
31
32
|
* Auto-registers binary parsers for the database's text-like dynamic-oid types — native enums
|
|
32
33
|
* and citext, plus their array types — so apps get those for free.
|
|
@@ -35,19 +36,19 @@ export type BinaryParse = (chunk: Buffer, start: number, length: number) => any;
|
|
|
35
36
|
* directly (i.e. at boot) if they want the registrations eagerly. Explicit
|
|
36
37
|
* `setBinaryTypeParser` registrations are never overwritten.
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
declare function registerDatabaseBinaryParsers(pool: {
|
|
40
|
+
query(sql: string): Promise<{
|
|
41
|
+
rows: any[];
|
|
42
|
+
}>;
|
|
42
43
|
}): Promise<void>;
|
|
43
44
|
/**
|
|
44
45
|
* Sets the session `TimeZone` used to zone temporal-mode `timestamptz` loads; normally captured
|
|
45
46
|
* automatically by {@link registerDatabaseBinaryParsers}. One zone per process — pools with
|
|
46
47
|
* differing session TimeZones are not supported by the binary path.
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
declare function setSessionTimeZone(timeZone: string): void;
|
|
49
50
|
/** Decodes a cell's bytes as utf8 text, i.e. for text-like custom types (enums, citext, domains). */
|
|
50
|
-
|
|
51
|
+
declare function binaryTextParser(chunk: Buffer, start: number, length: number): string;
|
|
51
52
|
/**
|
|
52
53
|
* Decodes a binary array cell into a JS array of element values.
|
|
53
54
|
*
|
|
@@ -56,13 +57,13 @@ export declare function binaryTextParser(chunk: Buffer, start: number, length: n
|
|
|
56
57
|
* mode-appropriate temporal types) work without separate element wiring. Registered for the
|
|
57
58
|
* standard `_type` oids below; register it for custom array oids as needed.
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
declare function binaryArrayParser(chunk: Buffer, start: number, length: number): any[];
|
|
60
61
|
/** Decodes binary `date` cells to `Date`s, matching postgres-date's text semantics; Date mode. */
|
|
61
|
-
|
|
62
|
+
declare function binaryDateToDate(chunk: Buffer, start: number): any;
|
|
62
63
|
/** Decodes binary `timestamp` (without zone) cells to local-time `Date`s; Date mode. */
|
|
63
|
-
|
|
64
|
+
declare function binaryTimestampToDate(chunk: Buffer, start: number): any;
|
|
64
65
|
/** Decodes binary `timestamptz` cells to `Date`s (µs floor to ms, like the text parse); Date mode. */
|
|
65
|
-
|
|
66
|
+
declare function binaryTimestamptzToDate(chunk: Buffer, start: number): any;
|
|
66
67
|
/**
|
|
67
68
|
* Registers the Temporal-mode binary parsers: date/time/timestamp/timestamptz cells construct
|
|
68
69
|
* `Temporal` values *directly* from the wire µs/days — no intermediate strings, no
|
|
@@ -73,4 +74,7 @@ export declare function binaryTimestamptzToDate(chunk: Buffer, start: number): a
|
|
|
73
74
|
* session zone's offset at each instant (see `setSessionTimeZone`; the configured
|
|
74
75
|
* `temporal.timeZone` only governs `now`-conversions, not loads).
|
|
75
76
|
*/
|
|
76
|
-
|
|
77
|
+
declare function registerTemporalBinaryParsers(): void;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { BinaryParse, binaryArrayParser, binaryDateToDate, binaryTextParser, binaryTimestampToDate, binaryTimestamptzToDate, getBinaryTypeParser, registerDatabaseBinaryParsers, registerTemporalBinaryParsers, setBinaryTypeParser, setSessionTimeZone };
|
|
80
|
+
//# sourceMappingURL=binaryParsers.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binaryParsers.d.cts","names":[],"sources":["../../src/drivers/binaryParsers.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBA0BgB,oBAAoB,aAAa,OAAO;;iBAKxC,oBAAoB,cAAc;;KAKtC,eAAe,OAAO,QAAQ,eAAe;;;;;;;;;iBAUnC,8BAA8B;EAClD,MAAM,cAAc;IAAU;;IAC5B;;;;;;iBA6BY,mBAAmB;;iBAOnB,iBAAiB,OAAO,QAAQ,eAAe;;;;;;;;;iBAY/C,kBAAkB,OAAO,QAAQ,eAAe;;iBAgChD,iBAAiB,OAAO,QAAQ;;iBAYhC,sBAAsB,OAAO,QAAQ;;iBAqBrC,wBAAwB,OAAO,QAAQ;;;;;;;;;;;iBAoBvC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//#region src/drivers/binaryParsers.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Joist's registry of PostgreSQL *binary-format* cell parsers, used by `WireRowData` for lazy
|
|
4
|
+
* `em.find`/`em.load` results (which request binary output; see `executeRowDataQuery`).
|
|
5
|
+
*
|
|
6
|
+
* This registry is deliberately **separate from `pg.types`**: `pg.types.setTypeParser` and
|
|
7
|
+
* pool/client `TypeOverrides` continue to govern classic *text* results (knex, `pool.query`,
|
|
8
|
+
* non-lazy drivers), while binary cells decode wire-bytes -> values directly — ints via
|
|
9
|
+
* `readInt32BE`, timestamps via µs arithmetic, Temporal values constructed without ever
|
|
10
|
+
* materializing a string. There is no fallback from one registry to the other:
|
|
11
|
+
*
|
|
12
|
+
* - Built-in parsers cover the standard scalar/array types below; `setupLatestPgTypes`
|
|
13
|
+
* registers the date/time parsers appropriate to Date-vs-Temporal mode.
|
|
14
|
+
* - Custom/extension types (native enums, citext, domains, hstore, ...) must be registered
|
|
15
|
+
* explicitly with {@link setBinaryTypeParser} — text-like types can use
|
|
16
|
+
* {@link binaryTextParser}, arrays of registered elements can use {@link binaryArrayParser}.
|
|
17
|
+
* - A query selecting a column whose oid has no registered parser **fails** with a descriptive
|
|
18
|
+
* error (see `WireRowData.setRowDescription`), rather than guessing at a lossy decoding.
|
|
19
|
+
*
|
|
20
|
+
* Values produced here should match what the classic text path produces for the same column
|
|
21
|
+
* (i.e. `numeric` stays a string, `int8` stays a string, Date-mode timestamps become `Date`s),
|
|
22
|
+
* so entities hydrate identically in either mode; Temporal-mode parsers construct
|
|
23
|
+
* `Temporal.PlainDate`/`ZonedDateTime`/etc. directly, and the temporal mappers pass
|
|
24
|
+
* already-constructed instances through.
|
|
25
|
+
*/
|
|
26
|
+
declare function setBinaryTypeParser(oid: number, parse: BinaryParse): void;
|
|
27
|
+
/** Returns the registered binary parser for `oid`, i.e. for tests to save/restore. */
|
|
28
|
+
declare function getBinaryTypeParser(oid: number): BinaryParse | undefined;
|
|
29
|
+
/** Decodes one binary cell directly from the payload chunk; `length` is the cell's byte length. */
|
|
30
|
+
type BinaryParse = (chunk: Buffer, start: number, length: number) => any;
|
|
31
|
+
/**
|
|
32
|
+
* Auto-registers binary parsers for the database's text-like dynamic-oid types — native enums
|
|
33
|
+
* and citext, plus their array types — so apps get those for free.
|
|
34
|
+
*
|
|
35
|
+
* `PostgresDriver` calls this lazily before its first lazy query; apps can also call it
|
|
36
|
+
* directly (i.e. at boot) if they want the registrations eagerly. Explicit
|
|
37
|
+
* `setBinaryTypeParser` registrations are never overwritten.
|
|
38
|
+
*/
|
|
39
|
+
declare function registerDatabaseBinaryParsers(pool: {
|
|
40
|
+
query(sql: string): Promise<{
|
|
41
|
+
rows: any[];
|
|
42
|
+
}>;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the session `TimeZone` used to zone temporal-mode `timestamptz` loads; normally captured
|
|
46
|
+
* automatically by {@link registerDatabaseBinaryParsers}. One zone per process — pools with
|
|
47
|
+
* differing session TimeZones are not supported by the binary path.
|
|
48
|
+
*/
|
|
49
|
+
declare function setSessionTimeZone(timeZone: string): void;
|
|
50
|
+
/** Decodes a cell's bytes as utf8 text, i.e. for text-like custom types (enums, citext, domains). */
|
|
51
|
+
declare function binaryTextParser(chunk: Buffer, start: number, length: number): string;
|
|
52
|
+
/**
|
|
53
|
+
* Decodes a binary array cell into a JS array of element values.
|
|
54
|
+
*
|
|
55
|
+
* The element oid is embedded in the wire format, and each element decodes through this
|
|
56
|
+
* registry — so arrays of any registered type (including custom-registered oids and the
|
|
57
|
+
* mode-appropriate temporal types) work without separate element wiring. Registered for the
|
|
58
|
+
* standard `_type` oids below; register it for custom array oids as needed.
|
|
59
|
+
*/
|
|
60
|
+
declare function binaryArrayParser(chunk: Buffer, start: number, length: number): any[];
|
|
61
|
+
/** Decodes binary `date` cells to `Date`s, matching postgres-date's text semantics; Date mode. */
|
|
62
|
+
declare function binaryDateToDate(chunk: Buffer, start: number): any;
|
|
63
|
+
/** Decodes binary `timestamp` (without zone) cells to local-time `Date`s; Date mode. */
|
|
64
|
+
declare function binaryTimestampToDate(chunk: Buffer, start: number): any;
|
|
65
|
+
/** Decodes binary `timestamptz` cells to `Date`s (µs floor to ms, like the text parse); Date mode. */
|
|
66
|
+
declare function binaryTimestamptzToDate(chunk: Buffer, start: number): any;
|
|
67
|
+
/**
|
|
68
|
+
* Registers the Temporal-mode binary parsers: date/time/timestamp/timestamptz cells construct
|
|
69
|
+
* `Temporal` values *directly* from the wire µs/days — no intermediate strings, no
|
|
70
|
+
* `temporalMappers.fromDb` parsing (the mappers pass already-constructed instances through).
|
|
71
|
+
*
|
|
72
|
+
* `timestamptz` matches the text path's zoning exactly: classic parsing zones the value by the
|
|
73
|
+
* offset the session's `TimeZone` rendered (normalizing `+00` to `UTC`), so we compute the
|
|
74
|
+
* session zone's offset at each instant (see `setSessionTimeZone`; the configured
|
|
75
|
+
* `temporal.timeZone` only governs `now`-conversions, not loads).
|
|
76
|
+
*/
|
|
77
|
+
declare function registerTemporalBinaryParsers(): void;
|
|
78
|
+
//#endregion
|
|
79
|
+
export { BinaryParse, binaryArrayParser, binaryDateToDate, binaryTextParser, binaryTimestampToDate, binaryTimestamptzToDate, getBinaryTypeParser, registerDatabaseBinaryParsers, registerTemporalBinaryParsers, setBinaryTypeParser, setSessionTimeZone };
|
|
80
|
+
//# sourceMappingURL=binaryParsers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binaryParsers.d.mts","names":[],"sources":["../../src/drivers/binaryParsers.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBA0BgB,oBAAoB,aAAa,OAAO;;iBAKxC,oBAAoB,cAAc;;KAKtC,eAAe,OAAO,QAAQ,eAAe;;;;;;;;;iBAUnC,8BAA8B;EAClD,MAAM,cAAc;IAAU;;IAC5B;;;;;;iBA6BY,mBAAmB;;iBAOnB,iBAAiB,OAAO,QAAQ,eAAe;;;;;;;;;iBAY/C,kBAAkB,OAAO,QAAQ,eAAe;;iBAgChD,iBAAiB,OAAO,QAAQ;;iBAYhC,sBAAsB,OAAO,QAAQ;;iBAqBrC,wBAAwB,OAAO,QAAQ;;;;;;;;;;;iBAoBvC"}
|