turbine-orm 0.81.0 → 0.90.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/README.md +26 -25
- package/dist/checkout.d.ts +27 -2
- package/dist/checkout.js +75 -4
- package/dist/cjs/checkout.d.ts +27 -2
- package/dist/cjs/checkout.js +76 -3
- package/dist/cjs/cli/code-first-tags.d.ts +62 -0
- package/dist/cjs/cli/code-first-tags.js +124 -0
- package/dist/cjs/cli/compile-query.js +9 -0
- package/dist/cjs/cli/config.d.ts +35 -6
- package/dist/cjs/cli/config.js +17 -1
- package/dist/cjs/cli/destructive.d.ts +7 -4
- package/dist/cjs/cli/destructive.js +224 -20
- package/dist/cjs/cli/error-catalog.js +36 -0
- package/dist/cjs/cli/error-text.d.ts +15 -0
- package/dist/cjs/cli/error-text.js +40 -0
- package/dist/cjs/cli/index.d.ts +62 -4
- package/dist/cjs/cli/index.js +568 -108
- package/dist/cjs/cli/local-server-guard.d.ts +53 -0
- package/dist/cjs/cli/local-server-guard.js +119 -0
- package/dist/cjs/cli/local-server-output.d.ts +41 -0
- package/dist/cjs/cli/local-server-output.js +103 -0
- package/dist/cjs/cli/mcp.d.ts +8 -0
- package/dist/cjs/cli/mcp.js +121 -32
- package/dist/cjs/cli/migrate.d.ts +113 -5
- package/dist/cjs/cli/migrate.js +270 -21
- package/dist/cjs/cli/observe.d.ts +6 -1
- package/dist/cjs/cli/observe.js +85 -55
- package/dist/cjs/cli/pii-predicate-guard.d.ts +43 -23
- package/dist/cjs/cli/pii-predicate-guard.js +98 -37
- package/dist/cjs/cli/prisma-resolve.js +17 -13
- package/dist/cjs/cli/prisma-schema.js +12 -4
- package/dist/cjs/cli/studio-ui.generated.js +1 -1
- package/dist/cjs/cli/studio.d.ts +14 -2
- package/dist/cjs/cli/studio.js +244 -69
- package/dist/cjs/cli/ui.d.ts +1 -1
- package/dist/cjs/client.d.ts +558 -85
- package/dist/cjs/client.js +1270 -395
- package/dist/cjs/connection-guard.d.ts +13 -0
- package/dist/cjs/connection-guard.js +28 -0
- package/dist/cjs/connection-url.d.ts +51 -16
- package/dist/cjs/connection-url.js +67 -34
- package/dist/cjs/diagnostics.d.ts +81 -0
- package/dist/cjs/diagnostics.js +147 -0
- package/dist/cjs/dialect.d.ts +449 -20
- package/dist/cjs/dialect.js +117 -76
- package/dist/cjs/engine-config.d.ts +7 -6
- package/dist/cjs/errors.d.ts +126 -6
- package/dist/cjs/errors.js +256 -13
- package/dist/cjs/generate.d.ts +57 -7
- package/dist/cjs/generate.js +635 -279
- package/dist/cjs/global-filters-config.d.ts +59 -0
- package/dist/cjs/global-filters-config.js +367 -0
- package/dist/cjs/index.d.ts +9 -4
- package/dist/cjs/index.js +10 -2
- package/dist/cjs/introspect.d.ts +31 -6
- package/dist/cjs/introspect.js +108 -50
- package/dist/cjs/log-codes.d.ts +12 -0
- package/dist/cjs/log-codes.js +77 -0
- package/dist/cjs/logger.d.ts +87 -0
- package/dist/cjs/logger.js +98 -0
- package/dist/cjs/mssql.d.ts +8 -5
- package/dist/cjs/mssql.js +352 -65
- package/dist/cjs/mysql.d.ts +3 -5
- package/dist/cjs/mysql.js +420 -70
- package/dist/cjs/nested-write.d.ts +3 -0
- package/dist/cjs/nested-write.js +179 -114
- package/dist/cjs/pipeline-submittable.d.ts +12 -0
- package/dist/cjs/pipeline-submittable.js +118 -44
- package/dist/cjs/pipeline.js +21 -26
- package/dist/cjs/powdb-introspect.d.ts +5 -2
- package/dist/cjs/powdb-introspect.js +20 -15
- package/dist/cjs/powdb-shared.d.ts +36 -5
- package/dist/cjs/powdb-shared.js +67 -8
- package/dist/cjs/powdb.d.ts +4 -0
- package/dist/cjs/powdb.js +183 -51
- package/dist/cjs/powql.d.ts +394 -51
- package/dist/cjs/powql.js +1829 -284
- package/dist/cjs/prisma-compat.d.ts +23 -15
- package/dist/cjs/prisma-compat.js +507 -372
- package/dist/cjs/query/aggregates.d.ts +17 -1
- package/dist/cjs/query/aggregates.js +261 -29
- package/dist/cjs/query/batched-loader.d.ts +25 -6
- package/dist/cjs/query/batched-loader.js +103 -20
- package/dist/cjs/query/builder.d.ts +325 -184
- package/dist/cjs/query/builder.js +1452 -490
- package/dist/cjs/query/column-ref.d.ts +61 -0
- package/dist/cjs/query/column-ref.js +73 -0
- package/dist/cjs/query/compound-unique.d.ts +21 -0
- package/dist/cjs/query/compound-unique.js +98 -18
- package/dist/cjs/query/deferred.d.ts +53 -16
- package/dist/cjs/query/expr.d.ts +217 -0
- package/dist/cjs/query/expr.js +859 -0
- package/dist/cjs/query/filters.d.ts +155 -53
- package/dist/cjs/query/filters.js +613 -76
- package/dist/cjs/query/index.d.ts +2 -0
- package/dist/cjs/query/index.js +7 -1
- package/dist/cjs/query/json-value.d.ts +43 -0
- package/dist/cjs/query/json-value.js +59 -0
- package/dist/cjs/query/normalize-args.d.ts +87 -0
- package/dist/cjs/query/normalize-args.js +527 -0
- package/dist/cjs/query/option-surface.d.ts +16 -4
- package/dist/cjs/query/option-surface.js +57 -14
- package/dist/cjs/query/relation-names.d.ts +14 -0
- package/dist/cjs/query/relation-names.js +77 -18
- package/dist/cjs/query/relations.d.ts +30 -3
- package/dist/cjs/query/relations.js +219 -63
- package/dist/cjs/query/row-lock.d.ts +49 -0
- package/dist/cjs/query/row-lock.js +138 -0
- package/dist/cjs/query/sql-comment.d.ts +161 -0
- package/dist/cjs/query/sql-comment.js +381 -0
- package/dist/cjs/query/stream-idle.d.ts +132 -0
- package/dist/cjs/query/stream-idle.js +212 -0
- package/dist/cjs/query/table-client.d.ts +101 -0
- package/dist/cjs/query/table-client.js +74 -0
- package/dist/cjs/query/types.d.ts +677 -298
- package/dist/cjs/query/utils.d.ts +105 -6
- package/dist/cjs/query/utils.js +426 -19
- package/dist/cjs/query/warn-registry.d.ts +18 -0
- package/dist/cjs/query/warn-registry.js +18 -0
- package/dist/cjs/query/where-compile.d.ts +138 -14
- package/dist/cjs/query/where-compile.js +513 -29
- package/dist/cjs/query/where.d.ts +159 -59
- package/dist/cjs/query/where.js +716 -246
- package/dist/cjs/query/writes.d.ts +112 -50
- package/dist/cjs/query/writes.js +1498 -200
- package/dist/cjs/query-events.d.ts +4 -2
- package/dist/cjs/query-events.js +3 -1
- package/dist/cjs/realtime.d.ts +7 -3
- package/dist/cjs/realtime.js +13 -2
- package/dist/cjs/schema-builder.d.ts +55 -4
- package/dist/cjs/schema-builder.js +382 -18
- package/dist/cjs/schema-metadata.d.ts +21 -1
- package/dist/cjs/schema-metadata.js +29 -7
- package/dist/cjs/schema-sql.d.ts +75 -5
- package/dist/cjs/schema-sql.js +497 -45
- package/dist/cjs/schema.d.ts +26 -5
- package/dist/cjs/schema.js +110 -13
- package/dist/cjs/sql-placeholders.d.ts +56 -0
- package/dist/cjs/sql-placeholders.js +204 -0
- package/dist/cjs/sqlite.d.ts +75 -20
- package/dist/cjs/sqlite.js +593 -95
- package/dist/cjs/supplied-pool-types.d.ts +48 -0
- package/dist/cjs/supplied-pool-types.js +256 -0
- package/dist/cjs/transaction-control.d.ts +51 -0
- package/dist/cjs/transaction-control.js +316 -0
- package/dist/cjs/transaction-state.d.ts +342 -0
- package/dist/cjs/transaction-state.js +707 -0
- package/dist/cjs/typed-sql.d.ts +37 -3
- package/dist/cjs/typed-sql.js +102 -8
- package/dist/cli/code-first-tags.d.ts +62 -0
- package/dist/cli/code-first-tags.js +120 -0
- package/dist/cli/compile-query.js +9 -0
- package/dist/cli/config.d.ts +35 -6
- package/dist/cli/config.js +16 -1
- package/dist/cli/destructive.d.ts +7 -4
- package/dist/cli/destructive.js +224 -20
- package/dist/cli/error-catalog.js +36 -0
- package/dist/cli/error-text.d.ts +15 -0
- package/dist/cli/error-text.js +37 -0
- package/dist/cli/index.d.ts +62 -4
- package/dist/cli/index.js +569 -112
- package/dist/cli/local-server-guard.d.ts +53 -0
- package/dist/cli/local-server-guard.js +113 -0
- package/dist/cli/local-server-output.d.ts +41 -0
- package/dist/cli/local-server-output.js +98 -0
- package/dist/cli/mcp.d.ts +8 -0
- package/dist/cli/mcp.js +121 -34
- package/dist/cli/migrate.d.ts +113 -5
- package/dist/cli/migrate.js +261 -21
- package/dist/cli/observe.d.ts +6 -1
- package/dist/cli/observe.js +84 -54
- package/dist/cli/pii-predicate-guard.d.ts +43 -23
- package/dist/cli/pii-predicate-guard.js +100 -35
- package/dist/cli/prisma-resolve.js +15 -11
- package/dist/cli/prisma-schema.js +12 -4
- package/dist/cli/studio-ui.generated.js +1 -1
- package/dist/cli/studio.d.ts +14 -2
- package/dist/cli/studio.js +246 -71
- package/dist/cli/ui.d.ts +1 -1
- package/dist/client.d.ts +558 -85
- package/dist/client.js +1275 -400
- package/dist/connection-guard.d.ts +13 -0
- package/dist/connection-guard.js +27 -0
- package/dist/connection-url.d.ts +51 -16
- package/dist/connection-url.js +63 -34
- package/dist/diagnostics.d.ts +81 -0
- package/dist/diagnostics.js +144 -0
- package/dist/dialect.d.ts +449 -20
- package/dist/dialect.js +115 -43
- package/dist/engine-config.d.ts +7 -6
- package/dist/errors.d.ts +126 -6
- package/dist/errors.js +252 -12
- package/dist/generate.d.ts +57 -7
- package/dist/generate.js +635 -281
- package/dist/global-filters-config.d.ts +59 -0
- package/dist/global-filters-config.js +361 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.js +4 -2
- package/dist/introspect.d.ts +31 -6
- package/dist/introspect.js +106 -50
- package/dist/log-codes.d.ts +12 -0
- package/dist/log-codes.js +74 -0
- package/dist/logger.d.ts +87 -0
- package/dist/logger.js +93 -0
- package/dist/mssql.d.ts +8 -5
- package/dist/mssql.js +354 -67
- package/dist/mysql.d.ts +3 -5
- package/dist/mysql.js +423 -73
- package/dist/nested-write.d.ts +3 -0
- package/dist/nested-write.js +177 -112
- package/dist/pipeline-submittable.d.ts +12 -0
- package/dist/pipeline-submittable.js +117 -44
- package/dist/pipeline.js +21 -26
- package/dist/powdb-introspect.d.ts +5 -2
- package/dist/powdb-introspect.js +21 -16
- package/dist/powdb-shared.d.ts +36 -5
- package/dist/powdb-shared.js +65 -8
- package/dist/powdb.d.ts +4 -0
- package/dist/powdb.js +183 -51
- package/dist/powql.d.ts +394 -51
- package/dist/powql.js +1836 -291
- package/dist/prisma-compat.d.ts +23 -15
- package/dist/prisma-compat.js +508 -373
- package/dist/query/aggregates.d.ts +17 -1
- package/dist/query/aggregates.js +263 -32
- package/dist/query/batched-loader.d.ts +25 -6
- package/dist/query/batched-loader.js +101 -21
- package/dist/query/builder.d.ts +325 -184
- package/dist/query/builder.js +1458 -495
- package/dist/query/column-ref.d.ts +61 -0
- package/dist/query/column-ref.js +66 -0
- package/dist/query/compound-unique.d.ts +21 -0
- package/dist/query/compound-unique.js +97 -19
- package/dist/query/deferred.d.ts +53 -16
- package/dist/query/expr.d.ts +217 -0
- package/dist/query/expr.js +848 -0
- package/dist/query/filters.d.ts +155 -53
- package/dist/query/filters.js +597 -72
- package/dist/query/index.d.ts +2 -0
- package/dist/query/index.js +4 -0
- package/dist/query/json-value.d.ts +43 -0
- package/dist/query/json-value.js +54 -0
- package/dist/query/normalize-args.d.ts +87 -0
- package/dist/query/normalize-args.js +517 -0
- package/dist/query/option-surface.d.ts +16 -4
- package/dist/query/option-surface.js +56 -13
- package/dist/query/relation-names.d.ts +14 -0
- package/dist/query/relation-names.js +77 -19
- package/dist/query/relations.d.ts +30 -3
- package/dist/query/relations.js +220 -67
- package/dist/query/row-lock.d.ts +49 -0
- package/dist/query/row-lock.js +131 -0
- package/dist/query/sql-comment.d.ts +161 -0
- package/dist/query/sql-comment.js +374 -0
- package/dist/query/stream-idle.d.ts +132 -0
- package/dist/query/stream-idle.js +203 -0
- package/dist/query/table-client.d.ts +101 -0
- package/dist/query/table-client.js +70 -0
- package/dist/query/types.d.ts +677 -298
- package/dist/query/utils.d.ts +105 -6
- package/dist/query/utils.js +414 -18
- package/dist/query/warn-registry.d.ts +18 -0
- package/dist/query/warn-registry.js +18 -0
- package/dist/query/where-compile.d.ts +138 -14
- package/dist/query/where-compile.js +508 -31
- package/dist/query/where.d.ts +159 -59
- package/dist/query/where.js +711 -248
- package/dist/query/writes.d.ts +112 -50
- package/dist/query/writes.js +1496 -202
- package/dist/query-events.d.ts +4 -2
- package/dist/query-events.js +3 -1
- package/dist/realtime.d.ts +7 -3
- package/dist/realtime.js +13 -2
- package/dist/schema-builder.d.ts +55 -4
- package/dist/schema-builder.js +381 -18
- package/dist/schema-metadata.d.ts +21 -1
- package/dist/schema-metadata.js +28 -7
- package/dist/schema-sql.d.ts +75 -5
- package/dist/schema-sql.js +494 -44
- package/dist/schema.d.ts +26 -5
- package/dist/schema.js +109 -13
- package/dist/sql-placeholders.d.ts +56 -0
- package/dist/sql-placeholders.js +200 -0
- package/dist/sqlite.d.ts +75 -20
- package/dist/sqlite.js +597 -99
- package/dist/supplied-pool-types.d.ts +48 -0
- package/dist/supplied-pool-types.js +247 -0
- package/dist/transaction-control.d.ts +51 -0
- package/dist/transaction-control.js +311 -0
- package/dist/transaction-state.d.ts +342 -0
- package/dist/transaction-state.js +696 -0
- package/dist/typed-sql.d.ts +37 -3
- package/dist/typed-sql.js +100 -8
- package/package.json +7 -4
- package/skills/turbine-orm/SKILL.md +56 -6
package/dist/query/utils.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Standalone utility functions and classes used by the query builder.
|
|
5
5
|
*/
|
|
6
|
+
import { type TurbineLogger } from '../logger.js';
|
|
6
7
|
/**
|
|
7
8
|
* Quote a SQL identifier (table name, column name) using Postgres double-quote
|
|
8
9
|
* rules: wrap in double quotes, escape internal double quotes by doubling them.
|
|
@@ -243,6 +244,14 @@ export interface SqlCacheEntry {
|
|
|
243
244
|
* a warmed template cannot regain one. See `buildCacheEntry` in builder.ts.
|
|
244
245
|
*/
|
|
245
246
|
name: string;
|
|
247
|
+
/**
|
|
248
|
+
* How many params the build pushed, i.e. the statement's placeholder count.
|
|
249
|
+
* A cache hit whose collect path produces a different count is refused with
|
|
250
|
+
* an InvariantError before anything is sent. Optional so an entry built
|
|
251
|
+
* outside the cache (a test fixture) still type-checks; such an entry skips
|
|
252
|
+
* the count check.
|
|
253
|
+
*/
|
|
254
|
+
paramCount?: number;
|
|
246
255
|
}
|
|
247
256
|
/**
|
|
248
257
|
* FNV-1a 64-bit hash returning 16 lowercase hex chars.
|
|
@@ -258,6 +267,81 @@ export declare function fnv1a64Hex(s: string): string;
|
|
|
258
267
|
* @internal Exported for testing only.
|
|
259
268
|
*/
|
|
260
269
|
export declare function sqlToPreparedName(sql: string): string;
|
|
270
|
+
/**
|
|
271
|
+
* How many distinct statement names one process hands out. Every connection
|
|
272
|
+
* keeps each named statement it has prepared, at 9 to 45 KB of server memory
|
|
273
|
+
* apiece, until the connection closes, so the number of names is what bounds
|
|
274
|
+
* that memory. A statement past the budget is sent unnamed: parsed on every
|
|
275
|
+
* execution and never kept, which costs a few microseconds on a cheap query.
|
|
276
|
+
*/
|
|
277
|
+
export declare const PREPARED_STATEMENT_BUDGET = 200;
|
|
278
|
+
/**
|
|
279
|
+
* The prepared-statement name for `sql`, or `''` (send it unnamed) once the
|
|
280
|
+
* process has named {@link PREPARED_STATEMENT_BUDGET} other statements.
|
|
281
|
+
*
|
|
282
|
+
* The first shapes a process runs keep their names for its lifetime, which in
|
|
283
|
+
* practice are its hot shapes. A server-side `DEALLOCATE` cannot replace this:
|
|
284
|
+
* a pooled query does not know which connection it will run on, and a
|
|
285
|
+
* connection keeps every name it ever prepared.
|
|
286
|
+
*/
|
|
287
|
+
export declare function boundedPreparedName(sql: string): string;
|
|
288
|
+
/**
|
|
289
|
+
* Claim an already derived statement name from the same budget as
|
|
290
|
+
* {@link boundedPreparedName}: `name` itself, or `''` (send it unnamed) once
|
|
291
|
+
* the budget is spent. `sqlComment`'s `c_` names (query/sql-comment.ts) are
|
|
292
|
+
* claimed here, so a commented statement costs one slot like any other.
|
|
293
|
+
*/
|
|
294
|
+
export declare function claimPreparedName(name: string): string;
|
|
295
|
+
/** @internal Tests only: forget every name handed out. */
|
|
296
|
+
export declare function resetPreparedNameBudget(): void;
|
|
297
|
+
/** The `params` object a middleware receives. */
|
|
298
|
+
export interface MiddlewareParams {
|
|
299
|
+
model: string;
|
|
300
|
+
action: string;
|
|
301
|
+
args: Record<string, unknown>;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The `params` a middleware receives. `params.args` is a plain copy of the
|
|
305
|
+
* caller's args, made when it is first read, so middleware can read it, spread
|
|
306
|
+
* it, serialize it and `structuredClone` it, and one that never reads it pays
|
|
307
|
+
* nothing.
|
|
308
|
+
*
|
|
309
|
+
* It is a copy because the query is compiled from the caller's args, not from
|
|
310
|
+
* what middleware sees. A change to the copy would never reach the query, so
|
|
311
|
+
* {@link assertMiddlewareArgsKept} refuses it, naming the path, when the
|
|
312
|
+
* middleware calls `next`. That check compares contents, which is why the copy
|
|
313
|
+
* is not frozen: a frozen object ignores a write silently in a script that is
|
|
314
|
+
* not in strict mode, and a filter added there would be dropped without a word.
|
|
315
|
+
* Assigning to `params.args` itself throws at once.
|
|
316
|
+
*/
|
|
317
|
+
export declare function readOnlyMiddlewareParams(model: string, action: string, args: Record<string, unknown>): MiddlewareParams;
|
|
318
|
+
/**
|
|
319
|
+
* Refuse a `next(p)` whose `p.args` is not the caller's args: one that
|
|
320
|
+
* middleware changed in place, or replaced with an object that differs from
|
|
321
|
+
* them. A copy that is structurally equal passes (`structuredClone(params.args)`,
|
|
322
|
+
* `{ ...params.args }`), because nothing it would change is lost. Throws a
|
|
323
|
+
* TypeError naming the first path that differs.
|
|
324
|
+
*/
|
|
325
|
+
export declare function assertMiddlewareArgsKept(handedOut: MiddlewareParams, passed: {
|
|
326
|
+
args?: unknown;
|
|
327
|
+
} | undefined): void;
|
|
328
|
+
/** Whether `pool` is a node-postgres `Pool`, whose checkouts are real backend connections. */
|
|
329
|
+
export declare function isNodePostgresPool(pool: unknown): boolean;
|
|
330
|
+
/** Whether `client` is a node-postgres connection a cancel request can reach. */
|
|
331
|
+
export declare function canCancelBackend(client: unknown): boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Ask the server to cancel whatever `client`'s backend is running, with the
|
|
334
|
+
* protocol's CancelRequest: a separate short connection carrying the backend's
|
|
335
|
+
* process id and secret key. No login, no session state, and a pooler forwards
|
|
336
|
+
* it to the right server backend, which `pg_cancel_backend(pid)` through a
|
|
337
|
+
* pooler would not.
|
|
338
|
+
*
|
|
339
|
+
* Resolves `true` once the server has closed the cancel connection, i.e. has
|
|
340
|
+
* signalled the backend; `false` when the request could not be delivered
|
|
341
|
+
* within `waitMs`. A cancel that arrives after the statement finished is
|
|
342
|
+
* ignored by the server.
|
|
343
|
+
*/
|
|
344
|
+
export declare function sendCancelRequest(client: unknown, waitMs: number): Promise<boolean>;
|
|
261
345
|
/** Known operator keys, used to detect operator objects vs plain values */
|
|
262
346
|
export declare const OPERATOR_KEYS: Set<string>;
|
|
263
347
|
/**
|
|
@@ -339,6 +423,20 @@ export declare function coerceTemporalValue(dbType: string | undefined, value: u
|
|
|
339
423
|
* as-is.
|
|
340
424
|
*/
|
|
341
425
|
export declare function parseDbDate(value: string): Date;
|
|
426
|
+
/**
|
|
427
|
+
* A float column's value as the driver reads it. JSON has no NaN or infinity,
|
|
428
|
+
* so `json_build_object` renders them as the strings "NaN", "Infinity" and
|
|
429
|
+
* "-Infinity"; every other value passes through.
|
|
430
|
+
*/
|
|
431
|
+
export declare function readJsonFloat(value: unknown): unknown;
|
|
432
|
+
/** {@link readJsonFloat} over a float array (at any depth); the input when nothing changes. */
|
|
433
|
+
export declare function readJsonFloatArray(value: unknown): unknown;
|
|
434
|
+
/**
|
|
435
|
+
* An array column the driver has no parser for (an enum array) arrives as
|
|
436
|
+
* Postgres array text, `{ok,sad}`; read it into an array of strings, as the
|
|
437
|
+
* same column reads through a relation. The input when it cannot be parsed.
|
|
438
|
+
*/
|
|
439
|
+
export declare function readTextArray(value: unknown): unknown;
|
|
342
440
|
/**
|
|
343
441
|
* Is `value` one of the two representations a Postgres temporal `infinity` /
|
|
344
442
|
* `-infinity` reaches the ORM row parser in?
|
|
@@ -547,7 +645,7 @@ export declare function isDefaultTextParser(oid: number, parser: (text: string)
|
|
|
547
645
|
* construction, and only when somebody else's non-default parser is actually
|
|
548
646
|
* being replaced.
|
|
549
647
|
*/
|
|
550
|
-
export declare function warnParserOverwrite(oid: number, typeName: string): void;
|
|
648
|
+
export declare function warnParserOverwrite(oid: number, typeName: string, logger?: TurbineLogger): void;
|
|
551
649
|
/**
|
|
552
650
|
* Register Turbine's temporal text parsers on the pg module. SIX OIDs, doing
|
|
553
651
|
* two different jobs:
|
|
@@ -582,7 +680,7 @@ export declare function warnParserOverwrite(oid: number, typeName: string): void
|
|
|
582
680
|
* per row at decode time, not captured per pool). If any of the four OIDs is
|
|
583
681
|
* already on a NON-default parser, {@link warnParserOverwrite} says so once.
|
|
584
682
|
*/
|
|
585
|
-
export declare function registerUtcTemporalParsers(): void;
|
|
683
|
+
export declare function registerUtcTemporalParsers(logger?: TurbineLogger): void;
|
|
586
684
|
/**
|
|
587
685
|
* Postgres type name → OID, for every type family whose `json_build_object`
|
|
588
686
|
* rendering is NOT the value the pg driver produces for the same column.
|
|
@@ -707,7 +805,7 @@ export declare function availableClause(names: readonly string[], emptySentence:
|
|
|
707
805
|
*/
|
|
708
806
|
export declare function relationInProjectionMessage(table: string, field: string, clause: 'select' | 'omit'): string;
|
|
709
807
|
/**
|
|
710
|
-
*
|
|
808
|
+
* Advice (`diagnostics.advice`) for a sort/grouping term Turbine dropped as redundant
|
|
711
809
|
* (`filters.ts` `dedupeOrderEntries` / `dedupeColumnList`).
|
|
712
810
|
*
|
|
713
811
|
* Deliberately a WARNING and not an error, and deliberately not silent either.
|
|
@@ -716,14 +814,15 @@ export declare function relationInProjectionMessage(table: string, field: string
|
|
|
716
814
|
* plus an unconditional primary-key tiebreak, which collide exactly when the
|
|
717
815
|
* caller sorts by the primary key). But a caller who wrote the duplicate by
|
|
718
816
|
* hand, or who believes a second key is doing something, should hear about it
|
|
719
|
-
* once.
|
|
817
|
+
* once. Advice for the usual reason: it describes the QUERY the application
|
|
720
818
|
* sends, which does not vary with the environment, so a production process
|
|
721
|
-
* learns nothing from repeating it.
|
|
819
|
+
* learns nothing from repeating it. The caller passes its advice logger, or
|
|
820
|
+
* `undefined` when advice is off.
|
|
722
821
|
*
|
|
723
822
|
* Keyed per dropped key, so a sort assembled per request from the same UI says
|
|
724
823
|
* it once rather than once per request.
|
|
725
824
|
*/
|
|
726
|
-
export declare function warnRedundantSortTerm(table: string, clause: string, dropped: readonly {
|
|
825
|
+
export declare function warnRedundantSortTerm(advice: TurbineLogger | undefined, table: string, clause: string, dropped: readonly {
|
|
727
826
|
key: string;
|
|
728
827
|
first: string;
|
|
729
828
|
resolved: string;
|