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.
Files changed (95) hide show
  1. package/build/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/build/_virtual/_rolldown/runtime.js +5 -0
  3. package/build/codegen.cjs +19 -0
  4. package/build/codegen.cjs.map +1 -0
  5. package/build/codegen.d.cts +1 -0
  6. package/build/codegen.d.mts +1 -0
  7. package/build/codegen.js +11 -28
  8. package/build/codegen.js.map +1 -1
  9. package/build/drivers/PostgresDriver.cjs +290 -0
  10. package/build/drivers/PostgresDriver.cjs.map +1 -0
  11. package/build/drivers/PostgresDriver.d.cts +77 -0
  12. package/build/drivers/PostgresDriver.d.cts.map +1 -0
  13. package/build/drivers/PostgresDriver.d.mts +77 -0
  14. package/build/drivers/PostgresDriver.d.mts.map +1 -0
  15. package/build/drivers/PostgresDriver.js +249 -325
  16. package/build/drivers/PostgresDriver.js.map +1 -1
  17. package/build/drivers/WireRowData.cjs +374 -0
  18. package/build/drivers/WireRowData.cjs.map +1 -0
  19. package/build/drivers/WireRowData.d.cts +111 -0
  20. package/build/drivers/WireRowData.d.cts.map +1 -0
  21. package/build/drivers/WireRowData.d.mts +111 -0
  22. package/build/drivers/WireRowData.d.mts.map +1 -0
  23. package/build/drivers/WireRowData.js +352 -412
  24. package/build/drivers/WireRowData.js.map +1 -1
  25. package/build/drivers/binaryParsers.cjs +422 -0
  26. package/build/drivers/binaryParsers.cjs.map +1 -0
  27. package/build/drivers/{binaryParsers.d.ts → binaryParsers.d.cts} +18 -14
  28. package/build/drivers/binaryParsers.d.cts.map +1 -0
  29. package/build/drivers/binaryParsers.d.mts +80 -0
  30. package/build/drivers/binaryParsers.d.mts.map +1 -0
  31. package/build/drivers/binaryParsers.js +315 -385
  32. package/build/drivers/binaryParsers.js.map +1 -1
  33. package/build/drivers/patchPgProtocol.cjs +255 -0
  34. package/build/drivers/patchPgProtocol.cjs.map +1 -0
  35. package/build/drivers/{patchPgProtocol.d.ts → patchPgProtocol.d.cts} +18 -14
  36. package/build/drivers/patchPgProtocol.d.cts.map +1 -0
  37. package/build/drivers/patchPgProtocol.d.mts +47 -0
  38. package/build/drivers/patchPgProtocol.d.mts.map +1 -0
  39. package/build/drivers/patchPgProtocol.js +211 -232
  40. package/build/drivers/patchPgProtocol.js.map +1 -1
  41. package/build/graphql-codegen-export.cjs +10 -0
  42. package/build/graphql-codegen-export.d.cts +1 -0
  43. package/build/graphql-codegen-export.d.mts +1 -0
  44. package/build/graphql-codegen-export.js +2 -19
  45. package/build/graphql-export.cjs +10 -0
  46. package/build/graphql-export.d.cts +1 -0
  47. package/build/graphql-export.d.mts +1 -0
  48. package/build/graphql-export.js +2 -19
  49. package/build/index.cjs +41 -0
  50. package/build/index.d.cts +3 -0
  51. package/build/index.d.mts +3 -0
  52. package/build/index.js +3 -27
  53. package/build/knex-export.cjs +10 -0
  54. package/build/knex-export.d.cts +1 -0
  55. package/build/knex-export.d.mts +1 -0
  56. package/build/knex-export.js +2 -19
  57. package/build/pg-export.cjs +13 -0
  58. package/build/pg-export.d.cts +4 -0
  59. package/build/pg-export.d.mts +4 -0
  60. package/build/pg-export.js +4 -20
  61. package/build/pg-migrate.cjs +22 -0
  62. package/build/pg-migrate.cjs.map +1 -0
  63. package/build/pg-migrate.d.cts +1 -0
  64. package/build/pg-migrate.d.mts +1 -0
  65. package/build/pg-migrate.js +13 -28
  66. package/build/pg-migrate.js.map +1 -1
  67. package/build/seed.cjs +49 -0
  68. package/build/seed.cjs.map +1 -0
  69. package/build/{seed.d.ts → seed.d.cts} +5 -1
  70. package/build/seed.d.cts.map +1 -0
  71. package/build/seed.d.mts +24 -0
  72. package/build/seed.d.mts.map +1 -0
  73. package/build/seed.js +39 -45
  74. package/build/seed.js.map +1 -1
  75. package/build/tests-export.cjs +10 -0
  76. package/build/tests-export.d.cts +1 -0
  77. package/build/tests-export.d.mts +1 -0
  78. package/build/tests-export.js +2 -19
  79. package/package.json +150 -28
  80. package/build/codegen.d.ts +0 -2
  81. package/build/drivers/PostgresDriver.d.ts +0 -73
  82. package/build/drivers/WireRowData.d.ts +0 -107
  83. package/build/graphql-codegen-export.d.ts +0 -1
  84. package/build/graphql-codegen-export.js.map +0 -1
  85. package/build/graphql-export.d.ts +0 -1
  86. package/build/graphql-export.js.map +0 -1
  87. package/build/index.d.ts +0 -3
  88. package/build/index.js.map +0 -1
  89. package/build/knex-export.d.ts +0 -1
  90. package/build/knex-export.js.map +0 -1
  91. package/build/pg-export.d.ts +0 -3
  92. package/build/pg-export.js.map +0 -1
  93. package/build/pg-migrate.d.ts +0 -2
  94. package/build/tests-export.d.ts +0 -1
  95. package/build/tests-export.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "joist-orm",
3
- "version": "2.3.0-next.41",
3
+ "version": "2.3.0-next.43",
4
4
  "license": "MIT",
5
+ "type": "module",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "https://github.com/joist-orm/joist-orm.git",
@@ -10,68 +11,189 @@
10
11
  "engines": {
11
12
  "node": "^12.17.0 || ^13.10.0 || ^14 || >= 16.0.0 < 16.2.0 || >= 16.3.0"
12
13
  },
13
- "main": "build/index.js",
14
- "types": "build/index.d.ts",
14
+ "main": "build/index.cjs",
15
+ "module": "build/index.js",
16
+ "types": "build/index.d.mts",
15
17
  "typesVersions": {
16
18
  "*": {
17
19
  "pg": [
18
- "build/pg-export.d.ts"
20
+ "build/pg-export.d.mts"
19
21
  ],
20
22
  "codegen": [
21
- "build/codegen.d.ts"
23
+ "build/codegen.d.mts"
22
24
  ],
23
25
  "pg-migrate": [
24
- "build/pg-migrate.d.ts"
26
+ "build/pg-migrate.d.mts"
25
27
  ],
26
28
  "graphql": [
27
- "build/graphql-export.d.ts"
29
+ "build/graphql-export.d.mts"
28
30
  ],
29
31
  "graphql-codegen": [
30
- "build/graphql-codegen-export.d.ts"
32
+ "build/graphql-codegen-export.d.mts"
31
33
  ],
32
34
  "tests": [
33
- "build/tests-export.d.ts"
35
+ "build/tests-export.d.mts"
34
36
  ],
35
37
  "knex": [
36
- "build/knex-export.d.ts"
38
+ "build/knex-export.d.mts"
37
39
  ]
38
40
  }
39
41
  },
40
42
  "bin": {
41
- "joist-codegen": "./build/codegen.js",
42
- "joist-pg-migrate": "./build/pg-migrate.js"
43
+ "joist-codegen": "./build/codegen.cjs",
44
+ "joist-pg-migrate": "./build/pg-migrate.cjs"
43
45
  },
44
46
  "exports": {
45
47
  ".": {
46
- "types": "./build/index.d.ts",
48
+ "bun": {
49
+ "types": "./build/index.d.mts",
50
+ "default": "./build/index.js"
51
+ },
52
+ "module-sync": {
53
+ "types": "./build/index.d.mts",
54
+ "default": "./build/index.js"
55
+ },
56
+ "import": {
57
+ "types": "./build/index.d.mts",
58
+ "default": "./build/index.js"
59
+ },
60
+ "require": {
61
+ "types": "./build/index.d.cts",
62
+ "default": "./build/index.cjs"
63
+ },
47
64
  "default": "./build/index.js"
48
65
  },
49
66
  "./codegen": {
50
- "types": "./build/codegen.d.ts",
67
+ "bun": {
68
+ "types": "./build/codegen.d.mts",
69
+ "default": "./build/codegen.js"
70
+ },
71
+ "module-sync": {
72
+ "types": "./build/codegen.d.mts",
73
+ "default": "./build/codegen.js"
74
+ },
75
+ "import": {
76
+ "types": "./build/codegen.d.mts",
77
+ "default": "./build/codegen.js"
78
+ },
79
+ "require": {
80
+ "types": "./build/codegen.d.cts",
81
+ "default": "./build/codegen.cjs"
82
+ },
51
83
  "default": "./build/codegen.js"
52
84
  },
53
85
  "./pg-migrate": {
54
- "types": "./build/pg-migrate.d.ts",
86
+ "bun": {
87
+ "types": "./build/pg-migrate.d.mts",
88
+ "default": "./build/pg-migrate.js"
89
+ },
90
+ "module-sync": {
91
+ "types": "./build/pg-migrate.d.mts",
92
+ "default": "./build/pg-migrate.js"
93
+ },
94
+ "import": {
95
+ "types": "./build/pg-migrate.d.mts",
96
+ "default": "./build/pg-migrate.js"
97
+ },
98
+ "require": {
99
+ "types": "./build/pg-migrate.d.cts",
100
+ "default": "./build/pg-migrate.cjs"
101
+ },
55
102
  "default": "./build/pg-migrate.js"
56
103
  },
57
104
  "./graphql": {
58
- "types": "./build/graphql-export.d.ts",
105
+ "bun": {
106
+ "types": "./build/graphql-export.d.mts",
107
+ "default": "./build/graphql-export.js"
108
+ },
109
+ "module-sync": {
110
+ "types": "./build/graphql-export.d.mts",
111
+ "default": "./build/graphql-export.js"
112
+ },
113
+ "import": {
114
+ "types": "./build/graphql-export.d.mts",
115
+ "default": "./build/graphql-export.js"
116
+ },
117
+ "require": {
118
+ "types": "./build/graphql-export.d.cts",
119
+ "default": "./build/graphql-export.cjs"
120
+ },
59
121
  "default": "./build/graphql-export.js"
60
122
  },
61
123
  "./graphql-codegen": {
62
- "types": "./build/graphql-codegen-export.d.ts",
124
+ "bun": {
125
+ "types": "./build/graphql-codegen-export.d.mts",
126
+ "default": "./build/graphql-codegen-export.js"
127
+ },
128
+ "module-sync": {
129
+ "types": "./build/graphql-codegen-export.d.mts",
130
+ "default": "./build/graphql-codegen-export.js"
131
+ },
132
+ "import": {
133
+ "types": "./build/graphql-codegen-export.d.mts",
134
+ "default": "./build/graphql-codegen-export.js"
135
+ },
136
+ "require": {
137
+ "types": "./build/graphql-codegen-export.d.cts",
138
+ "default": "./build/graphql-codegen-export.cjs"
139
+ },
63
140
  "default": "./build/graphql-codegen-export.js"
64
141
  },
65
142
  "./tests": {
66
- "types": "./build/tests-export.d.ts",
143
+ "bun": {
144
+ "types": "./build/tests-export.d.mts",
145
+ "default": "./build/tests-export.js"
146
+ },
147
+ "module-sync": {
148
+ "types": "./build/tests-export.d.mts",
149
+ "default": "./build/tests-export.js"
150
+ },
151
+ "import": {
152
+ "types": "./build/tests-export.d.mts",
153
+ "default": "./build/tests-export.js"
154
+ },
155
+ "require": {
156
+ "types": "./build/tests-export.d.cts",
157
+ "default": "./build/tests-export.cjs"
158
+ },
67
159
  "default": "./build/tests-export.js"
68
160
  },
69
161
  "./knex": {
70
- "types": "./build/knex-export.d.ts",
162
+ "bun": {
163
+ "types": "./build/knex-export.d.mts",
164
+ "default": "./build/knex-export.js"
165
+ },
166
+ "module-sync": {
167
+ "types": "./build/knex-export.d.mts",
168
+ "default": "./build/knex-export.js"
169
+ },
170
+ "import": {
171
+ "types": "./build/knex-export.d.mts",
172
+ "default": "./build/knex-export.js"
173
+ },
174
+ "require": {
175
+ "types": "./build/knex-export.d.cts",
176
+ "default": "./build/knex-export.cjs"
177
+ },
71
178
  "default": "./build/knex-export.js"
72
179
  },
73
180
  "./pg": {
74
- "types": "./build/pg-export.d.ts",
181
+ "bun": {
182
+ "types": "./build/pg-export.d.mts",
183
+ "default": "./build/pg-export.js"
184
+ },
185
+ "module-sync": {
186
+ "types": "./build/pg-export.d.mts",
187
+ "default": "./build/pg-export.js"
188
+ },
189
+ "import": {
190
+ "types": "./build/pg-export.d.mts",
191
+ "default": "./build/pg-export.js"
192
+ },
193
+ "require": {
194
+ "types": "./build/pg-export.d.cts",
195
+ "default": "./build/pg-export.cjs"
196
+ },
75
197
  "default": "./build/pg-export.js"
76
198
  }
77
199
  },
@@ -79,14 +201,14 @@
79
201
  "build"
80
202
  ],
81
203
  "dependencies": {
82
- "joist-codegen": "2.3.0-next.41",
83
- "joist-core": "2.3.0-next.41",
84
- "joist-graphql-codegen": "2.3.0-next.41",
85
- "joist-graphql-resolver-utils": "2.3.0-next.41",
86
- "joist-knex": "2.3.0-next.41",
87
- "joist-migration-utils": "2.3.0-next.41",
88
- "joist-test-utils": "2.3.0-next.41",
89
- "joist-utils": "2.3.0-next.41"
204
+ "joist-codegen": "2.3.0-next.43",
205
+ "joist-core": "2.3.0-next.43",
206
+ "joist-graphql-codegen": "2.3.0-next.43",
207
+ "joist-graphql-resolver-utils": "2.3.0-next.43",
208
+ "joist-knex": "2.3.0-next.43",
209
+ "joist-migration-utils": "2.3.0-next.43",
210
+ "joist-test-utils": "2.3.0-next.43",
211
+ "joist-utils": "2.3.0-next.43"
90
212
  },
91
213
  "peerDependencies": {
92
214
  "knex": "^3.1.0",
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export * from "joist-codegen";
@@ -1,73 +0,0 @@
1
- import { Driver, EntityManager, IdAssigner, JoinRowTodo, ParsedFindQuery, PreloadPlugin, RuntimeConfig, Todo } from "joist-core";
2
- import pg from "pg";
3
- export interface PostgresDriverOpts {
4
- idAssigner?: IdAssigner;
5
- /** Sets a default `PreloadPlugin` for any `EntityManager` that uses this driver. */
6
- preloadPlugin?: PreloadPlugin;
7
- /** Called after each query is executed, useful for testing/debugging. */
8
- onQuery?: (sql: string) => void;
9
- /**
10
- * Experimental: keeps entity find results as raw wire bytes and decodes each row/column cell
11
- * lazily on field access, instead of eagerly materializing POJO rows.
12
- *
13
- * Applies to unpaginated `em.find`, `em.load`, and o2m/o2o/recursive relation loads against
14
- * the pure-JS pg client. Other loaders deliberately stay classic: paginated finds (small
15
- * pages, measured neutral), m2m join-table rows (narrow + fully read, where materialized rows
16
- * measured faster, and `JoinRows` owns/mutates them), lazy columns, and id/count loaders.
17
- *
18
- * Lazy queries also request *binary* result format (prototype), decoding int/bool/float/text
19
- * cells — and, via the fast paths `setupLatestPgTypes` registers, date/timestamptz cells —
20
- * wire-bytes -> value with no intermediate strings; numeric/exotic cells render to pg's
21
- * canonical text and reuse the active text parsers for parity. `JOIST_LAZY_BINARY=0`
22
- * reverts lazy queries to text-format results. It
23
- * uses classic rows when the choice is knowable up-front (patching pg-protocol failed, or the
24
- * client is unsupported, i.e. pg-native — both warn once). If a connection turns out
25
- * mid-query to use an unpatched pg-protocol copy (a duplicate `pg` install), the query fails
26
- * with a descriptive error — a misconfiguration CI builds/smoketests will catch immediately.
27
- * Note deferred decoding also defers custom-parser errors from `await em.find` to first field
28
- * access. See JS-ROW-STORE-DESIGN.md.
29
- */
30
- lazyRows?: boolean;
31
- }
32
- /**
33
- * Implements the `Driver` interface for Postgres.
34
- *
35
- * This is the canonical driver implementation and leverages several aspects of
36
- * Postgres for the best performance, i.e.:
37
- *
38
- * - Deferred foreign key constraints are used to allow bulk inserting/updating
39
- * all entities without any topographic sorting/ordering issues.
40
- *
41
- * - Sequences are used to bulk-assign + then bulk-insert all entities, to again
42
- * avoid issues with ordering issues (cannot bulk insert A w/o knowing the id of B).
43
- *
44
- * - We use a pg-specific bulk update syntax.
45
- */
46
- export declare class PostgresDriver implements Driver<pg.PoolClient> {
47
- #private;
48
- readonly pool: pg.Pool;
49
- readonly lazyRows: boolean;
50
- /** Defined only when `lazyRows` is enabled; its presence is the capability signal the EM checks. */
51
- readonly executeFindRowData: Driver["executeFindRowData"];
52
- constructor(pool: pg.Pool, opts?: PostgresDriverOpts);
53
- executeFind(em: EntityManager, parsed: ParsedFindQuery, settings: {
54
- limit?: number;
55
- offset?: number;
56
- }): Promise<any[]>;
57
- executeQuery(em: EntityManager, sql: string, bindings: readonly any[]): Promise<any[]>;
58
- transaction<T>(em: EntityManager, fn: (txn: pg.PoolClient) => Promise<T>): Promise<T>;
59
- assignNewIds(_: EntityManager, todos: Record<string, Todo>): Promise<void>;
60
- flush(em: EntityManager, entityTodos: Record<string, Todo>, joinRows: Record<string, JoinRowTodo>): Promise<void>;
61
- get defaultPlugins(): {
62
- preloadPlugin: PreloadPlugin | undefined;
63
- };
64
- private getMaybeInTxnClient;
65
- }
66
- /**
67
- * Configures the `pg` driver with the best type parsers.
68
- *
69
- * In particular, pg's default `TIMESTAMPTZ` parser is very inefficient, and even just
70
- * pulling in the latest `pg-types` and installing the fixed parser makes a noticable
71
- * difference.
72
- */
73
- export declare function setupLatestPgTypes(temporal: RuntimeConfig["temporal"]): void;
@@ -1,107 +0,0 @@
1
- import { RowData } from "joist-core";
2
- import pg from "pg";
3
- /**
4
- * A lazy wire-row {@link RowData} over raw Postgres `DataRow` payload bytes.
5
- *
6
- * Each query produces its own `WireRowData` — one query, one result; results are never combined
7
- * or appended across queries, and the payload is read-only after the query completes (entity
8
- * mutations go into `InstanceData.data`, never back into the row bytes).
9
- *
10
- * Rows are kept in their row-major wire format (`int16 fieldCount` + length-prefixed cells) as
11
- * zero-copy views over the parser's own immutable buffers: `addRow` records each DataRow's
12
- * `(bytes, offset, length)` by reference, deduping the socket chunk that consecutive rows
13
- * share. (Our pg-protocol patch guarantees message bytes are never rewritten — chunks parse in
14
- * place and straddling messages get a buffer of their own; see `patchPgProtocol.ts`.) A
15
- * `row × column` cell is decoded on first field access by scanning the row's length-prefixed
16
- * cells to the column's ordinal ("row-lazy" decode, see JS-ROW-STORE-DESIGN.md §3/C2). This is
17
- * deferred decoding of row-major data, not a columnar layout.
18
- *
19
- * Because chunks are whole socket reads, retaining any row pins its ~64KiB chunk (plus whatever
20
- * protocol frames share it); `finalize`'s compaction copies retained rows out into an
21
- * exact-size owned buffer when enough of the payload was dropped.
22
- *
23
- * Text-format cells go through the same active text parsers node-postgres would resolve for
24
- * the query (i.e. honoring pool/client `TypeOverrides`), so they parse identically to classic
25
- * rows. Binary-format cells decode via `wireBinaryParser`: wire bytes -> value directly for
26
- * default-parsed scalar types (no intermediate string), else rendered to pg's canonical text
27
- * and fed through the active text parser for parity. (Classic node-postgres cannot do binary
28
- * at all — it round-trips cells through a UTF-8 string, corrupting bytes >= 0x80.)
29
- *
30
- * Because decoding is deferred, a custom parser that throws will do so on first field access
31
- * (or `toRow`/`toRows`), not while awaiting the query; `id` and inheritance-discriminator cells
32
- * still decode during hydration.
33
- *
34
- * After hydration, `finalize` trims unused capacity and, when some rows were not retained (i.e.
35
- * their entities were already in the identity map), compacts the payload down to only the
36
- * retained rows, so retained memory tracks live entities rather than query history.
37
- *
38
- * Small results deliberately stay lazy — there is NO row-count threshold below which we
39
- * materialize to a `PojoRowData` instead. Measured (benchmark-rowdata-small.ts, 40-col rows):
40
- * for the typical sparse access pattern (~6 of 40 columns read), keeping the lazy result wins at
41
- * every size including a single row (n=1: 4.3µs vs 7.6µs; n=1000: 0.76ms vs 3.0ms), because
42
- * materialization eagerly decodes every column while lazy faults only what is read. Even full
43
- * column coverage no longer flips the winner: with binary decode and `#readCell`'s adaptive
44
- * scan cursor, reading all ~36 columns of every row measures ~parity with classic end-to-end
45
- * (benchmark-lazy-parsing.ts), and small finds (n <= 10) are statistically identical.
46
- */
47
- export declare class WireRowData implements RowData {
48
- #private;
49
- get rowCount(): number;
50
- /** The DataRow payload bytes currently indexed; drops when compaction discards rows. */
51
- get payloadBytes(): number;
52
- /** The bytes currently held by payload chunks + the row-slice table, i.e. for benchmarks. */
53
- get memoryBytes(): number;
54
- get(rowIndex: number, columnName: string): any;
55
- /** Materializes one row as a POJO, i.e. for debugging and differential tests; values are not cached. */
56
- toRow(rowIndex: number): any;
57
- /** Materializes classic POJO rows, i.e. for `afterFind` observation or debugging; not cached. */
58
- toRows(): any[];
59
- /**
60
- * Resolves each column's decoder from the query's RowDescription.
61
- *
62
- * Binary-format fields decode through Joist's own binary registry only (see
63
- * `setBinaryTypeParser`) — `pg.types`/`TypeOverrides` are never consulted, and a column whose
64
- * oid has no registered binary parser fails the query here, before any rows arrive, rather
65
- * than guessing at a lossy decoding. Text-format fields (the `binary: false` escape hatch)
66
- * decode by utf8-slicing the cell into the active text parser, resolved via `getTypeParser`
67
- * (i.e. the pool/client `TypeOverrides` chain) or the global registry.
68
- */
69
- setRowDescription(fields: Array<{
70
- name: string;
71
- dataTypeID: number;
72
- format?: string;
73
- }>, getTypeParser?: (dataTypeID: number) => (value: any) => any): void;
74
- /**
75
- * Records one DataRow payload *by reference* (zero-copy); called synchronously from the wire
76
- * parser, whose patched buffer management guarantees the bytes are never rewritten.
77
- *
78
- * Consecutive rows usually share one socket chunk, so `bytes` is deduped against the last
79
- * chunk ref; retaining any row of a chunk pins the whole chunk, which `finalize`'s compaction
80
- * resolves by copying retained rows out when enough of the payload was dropped.
81
- */
82
- addRow(bytes: Buffer, offset: number, payloadLength: number): void;
83
- /** Marks `rowIndex` as retained by a hydrated entity; unmarked rows can be compacted away. */
84
- retain(rowIndex: number): void;
85
- /**
86
- * Trims unused capacity, and compacts down to only `retain`-ed rows when enough rows were not
87
- * retained to be worth the copy.
88
- *
89
- * Compaction exists to release pinned socket buffers to the GC: rows are zero-copy views into
90
- * whole ~64KiB chunks, so keeping any row alive pins its entire chunk — and unretained rows
91
- * are typically duplicates whose entities were *already in memory* (identity-map hits that
92
- * keep their original `rowData`), making the newly-arrived bytes dead weight. Copying the
93
- * retained rows into one exact-size owned buffer lets every chunk reference drop.
94
- *
95
- * The copy re-copies every retained byte, so it only pays off when it buys back a meaningful
96
- * fraction of the payload: we compact when the dropped rows hold more than 20% of the payload
97
- * bytes, and otherwise just trim, accepting the (bounded) leftover bytes. Called once after
98
- * hydration + sidecar reads (`_tags`, preload aggregates) are complete; retained entities keep
99
- * their original `rowIndex`, and un-compacted unretained rows simply remain readable-but-unused.
100
- */
101
- finalize(): void;
102
- }
103
- export declare function executeRowDataQuery(client: pg.PoolClient, sql: string, bindings: readonly any[], opts?: {
104
- binary?: boolean;
105
- }): Promise<RowData>;
106
- /** Returns whether `client` supports the lazy row-data query path, before submitting anything. */
107
- export declare function isRowDataCapableClient(client: unknown): client is pg.PoolClient;
@@ -1 +0,0 @@
1
- export * from "joist-graphql-codegen";
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql-codegen-export.js","sourceRoot":"","sources":["../src/graphql-codegen-export.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAkD;AAClD,wDAAsC"}
@@ -1 +0,0 @@
1
- export * from "joist-graphql-resolver-utils";
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql-export.js","sourceRoot":"","sources":["../src/graphql-export.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAyD;AACzD,+DAA6C"}
package/build/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "joist-core";
2
- export { type ConnectionConfig, Deferred, groupBy, isPlainObject, keyBy, newPgConnectionConfig } from "joist-utils";
3
- export type { CallbackFn } from "joist-utils";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,6CAA2B;AAE3B,wFAAwF;AACxF,2CAAoH;AAApF,uGAAA,QAAQ,OAAA;AAAE,sGAAA,OAAO,OAAA;AAAE,4GAAA,aAAa,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,oHAAA,qBAAqB,OAAA"}
@@ -1 +0,0 @@
1
- export * from "joist-knex";
@@ -1 +0,0 @@
1
- {"version":3,"file":"knex-export.js","sourceRoot":"","sources":["../src/knex-export.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,6CAA2B"}
@@ -1,3 +0,0 @@
1
- export { type BinaryParse, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, setBinaryTypeParser, setSessionTimeZone, } from "./drivers/binaryParsers.js";
2
- export { PostgresDriver, PostgresDriverOpts, setupLatestPgTypes } from "./drivers/PostgresDriver.js";
3
- export { seed } from "./seed.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"pg-export.js","sourceRoot":"","sources":["../src/pg-export.ts"],"names":[],"mappings":";;;AAAA,sFAAsF;AACtF,sFAAsF;AACtF,0FAA0F;AAC1F,6BAA6B;AAC7B,+DAQoC;AANlC,qHAAA,iBAAiB,OAAA;AACjB,oHAAA,gBAAgB,OAAA;AAChB,uHAAA,mBAAmB,OAAA;AACnB,iIAAA,6BAA6B,OAAA;AAC7B,uHAAA,mBAAmB,OAAA;AACnB,sHAAA,kBAAkB,OAAA;AAEpB,iEAAqG;AAA5F,mHAAA,cAAc,OAAA;AAAsB,uHAAA,kBAAkB,OAAA;AAC/D,qCAAiC;AAAxB,+FAAA,IAAI,OAAA"}
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export * from "joist-migration-utils";
@@ -1 +0,0 @@
1
- export * from "joist-test-utils";
@@ -1 +0,0 @@
1
- {"version":3,"file":"tests-export.js","sourceRoot":"","sources":["../src/tests-export.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,mDAAiC"}