@vibeorm/sql 5.9.0 → 5.10.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/ast.d.ts +120 -4
- package/dist/codecs.d.ts +106 -12
- package/dist/composable.d.ts +44 -4
- package/dist/dialect.d.ts +24 -1
- package/dist/dialects/migration-inventory.d.ts +0 -11
- package/dist/dialects/mysql-generated-columns.d.ts +1 -5
- package/dist/dialects/mysql-index-expressions.d.ts +1 -19
- package/dist/dialects/mysql-row-rules.d.ts +1 -7
- package/dist/dialects/postgres-generated-columns.d.ts +0 -5
- package/dist/dialects/postgres-index-expressions.d.ts +1 -11
- package/dist/dialects/postgres-rls-readiness.d.ts +0 -2
- package/dist/dialects/postgres-rls.d.ts +7 -1
- package/dist/dialects/postgres-row-rules.d.ts +1 -24
- package/dist/dialects/sqlite-fts.d.ts +2 -2
- package/dist/dialects/sqlite-generated-columns.d.ts +1 -12
- package/dist/dialects/sqlite-index-expressions.d.ts +1 -24
- package/dist/dialects/sqlite-json-equality.d.ts +1 -14
- package/dist/dialects/sqlite-row-rules.d.ts +1 -7
- package/dist/dialects/sqlite-table-definition.d.ts +0 -19
- package/dist/dialects/test-databases.d.ts +96 -0
- package/dist/expr-fragment.d.ts +13 -0
- package/dist/identifiers.d.ts +1 -4
- package/dist/index.d.ts +9 -5
- package/dist/index.js +3754 -3052
- package/dist/index.js.map +46 -43
- package/dist/json-patch.d.ts +0 -14
- package/dist/json-path.d.ts +1 -2
- package/dist/key-list.d.ts +0 -21
- package/dist/native-types.d.ts +3 -1
- package/dist/params.d.ts +0 -2
- package/dist/query/expressions.d.ts +1 -33
- package/dist/query/index.js.map +7 -7
- package/dist/query/mutations.d.ts +1 -14
- package/dist/query/reusable.d.ts +1 -16
- package/dist/query/select.d.ts +1 -10
- package/dist/query/sources.d.ts +1 -36
- package/dist/query/state.d.ts +1 -77
- package/dist/query-plan.d.ts +2 -2
- package/dist/result-decoder.d.ts +21 -1
- package/dist/row-rules.d.ts +1 -19
- package/dist/sql-bindings.d.ts +7 -43
- package/dist/sql-handles.d.ts +1 -3
- package/dist/sql-input.d.ts +8 -24
- package/dist/timestamp-identity.d.ts +6 -12
- package/dist/timestamp-text.d.ts +36 -0
- package/package.json +2 -2
package/dist/json-patch.d.ts
CHANGED
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
* purpose with a marker the client maps back to a typed error:
|
|
20
20
|
* `__vibe_veto:json_patch:<nonce>:<check index>:<found type>`.
|
|
21
21
|
*/
|
|
22
|
-
import type { SqlDialect } from "./dialect.ts";
|
|
23
|
-
import type { ParamCollector } from "./params.ts";
|
|
24
22
|
/** One step of a JSON patch; `value` is the JSON text the Json codec wrote. */
|
|
25
23
|
export type JsonPatchStep = {
|
|
26
24
|
readonly set: readonly string[];
|
|
@@ -71,18 +69,6 @@ export type JsonPatchPlan = {
|
|
|
71
69
|
export declare function planJsonPatch(params: {
|
|
72
70
|
steps: readonly JsonPatchStep[];
|
|
73
71
|
}): JsonPatchPlan;
|
|
74
|
-
/**
|
|
75
|
-
* The patched value of one Json column — `CASE WHEN <a container is not an
|
|
76
|
-
* object> THEN <fail on purpose> … ELSE <patched document> END` — where `read`
|
|
77
|
-
* is the column as the assignment reads it (qualified in a conflict update).
|
|
78
|
-
* Every placeholder is collected in text order.
|
|
79
|
-
*/
|
|
80
|
-
export declare function renderJsonPatch(params: {
|
|
81
|
-
dialect: SqlDialect;
|
|
82
|
-
patch: JsonPatchOperation;
|
|
83
|
-
read: string;
|
|
84
|
-
collector: ParamCollector;
|
|
85
|
-
}): string;
|
|
86
72
|
/** A refusal marker found in a database error message: the nonce, the check index, and the container's type as the database spelled it. */
|
|
87
73
|
export type JsonPatchVeto = {
|
|
88
74
|
readonly nonce: string;
|
package/dist/json-path.d.ts
CHANGED
package/dist/key-list.d.ts
CHANGED
|
@@ -26,17 +26,6 @@ export declare function postgresKeyListElementTypeOf(params: {
|
|
|
26
26
|
dialect: SqlDialect;
|
|
27
27
|
member: KeyListMember;
|
|
28
28
|
}): string | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* The postgres element type a key-list member's array binds as
|
|
31
|
-
* (`$n::<type>[]`), derived from the column's declared type facts.
|
|
32
|
-
*
|
|
33
|
-
* @throws VibeError `VIBE_UNSUPPORTED_CAPABILITY` for a member whose type has
|
|
34
|
-
* no equality a key can use (Json) or a native type this list does not know.
|
|
35
|
-
*/
|
|
36
|
-
export declare function postgresKeyListElementType(params: {
|
|
37
|
-
dialect: SqlDialect;
|
|
38
|
-
member: KeyListMember;
|
|
39
|
-
}): string;
|
|
40
29
|
/**
|
|
41
30
|
* Whether a key list must bind its rows as a row-value list of UNTYPED
|
|
42
31
|
* parameters, `(a, b) IN (($1, $2), …)`, instead of typed arrays on the
|
|
@@ -70,14 +59,4 @@ export declare function postgresBulkInsertArrayCastOf(params: {
|
|
|
70
59
|
dialect: SqlDialect;
|
|
71
60
|
member: KeyListMember;
|
|
72
61
|
}): string | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* The throwing form of {@link postgresBulkInsertArrayCastOf}, for the renderer.
|
|
75
|
-
*
|
|
76
|
-
* @throws VibeError `VIBE_UNSUPPORTED_CAPABILITY` for a native type the
|
|
77
|
-
* bulk-insert form does not know.
|
|
78
|
-
*/
|
|
79
|
-
export declare function postgresBulkInsertArrayCast(params: {
|
|
80
|
-
dialect: SqlDialect;
|
|
81
|
-
member: KeyListMember;
|
|
82
|
-
}): string;
|
|
83
62
|
//# sourceMappingURL=key-list.d.ts.map
|
package/dist/native-types.d.ts
CHANGED
|
@@ -40,7 +40,9 @@ export declare const POSTGRES_EXACT_EQUIVALENTS: Readonly<Partial<Record<ScalarT
|
|
|
40
40
|
* Normalize a MySQL type string for comparison: lowercase, whitespace
|
|
41
41
|
* stripped, base de-aliased, integer display widths dropped (MySQL 8.0.19+
|
|
42
42
|
* omits them; older catalogs report `int(11)`) — EXCEPT `tinyint(1)`, which is
|
|
43
|
-
* the Boolean marker and must survive normalization.
|
|
43
|
+
* the Boolean marker and must survive normalization. A zero fractional
|
|
44
|
+
* precision on a temporal type is dropped: the catalog reports
|
|
45
|
+
* `datetime(0)` as `datetime`.
|
|
44
46
|
*/
|
|
45
47
|
export declare function normalizeMysqlNativeType(params: {
|
|
46
48
|
readonly raw: string;
|
package/dist/params.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export declare class ParamCollector {
|
|
|
4
4
|
private reserved;
|
|
5
5
|
readonly values: unknown[];
|
|
6
6
|
constructor(dialect: SqlDialect);
|
|
7
|
-
/** @internal Allocate recorded positions without inserting sample values. */
|
|
8
|
-
reserve(): string;
|
|
9
7
|
/** Actual positional slots, including repeats of a named input. */
|
|
10
8
|
count(): number;
|
|
11
9
|
/** Register one value; ordinary and reusable paths share transport spelling. */
|
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ColumnDefinition, Expression, Expressions } from "./types.ts";
|
|
3
|
-
import type { RenderContext } from "./state.ts";
|
|
4
|
-
export declare function nullableDecoder<T>(decoder: ResultReadDecoder<T>): ResultReadDecoder<T | null>;
|
|
5
|
-
export declare function assertDecoder(decoder: ResultReadDecoder<unknown>): void;
|
|
6
|
-
/** Keep physical native refinements in the central codec implementations. */
|
|
7
|
-
export declare function nativeColumnDefinition(definition: ColumnDefinition<unknown>): ColumnDefinition<unknown>;
|
|
8
|
-
/** Transport conversion belongs only at the final result boundary. */
|
|
9
|
-
export declare function transportProjection(params: {
|
|
10
|
-
context: RenderContext;
|
|
11
|
-
expression: string;
|
|
12
|
-
definition: ColumnDefinition<unknown>;
|
|
13
|
-
}): string;
|
|
14
|
-
/** Write contracts carry encoding identity independently from projection output. */
|
|
15
|
-
export declare function columnInputContract(definition: ColumnDefinition<unknown>): SqlInputContract;
|
|
16
|
-
export declare function bindColumnValue(params: {
|
|
17
|
-
context: RenderContext;
|
|
18
|
-
definition: ColumnDefinition<unknown>;
|
|
19
|
-
value: unknown;
|
|
20
|
-
encoder?: ResultDecoder<unknown>;
|
|
21
|
-
rejectNull?: boolean;
|
|
22
|
-
}): string;
|
|
23
|
-
/** Construct a typed value for the public qb.value contract. */
|
|
24
|
-
export declare function literal<T>(params: {
|
|
25
|
-
value: T;
|
|
26
|
-
decoder: ResultDecoder<T>;
|
|
27
|
-
}): Expression<T>;
|
|
28
|
-
/** Construct an explicit fragment projection for the public qb.raw contract. */
|
|
29
|
-
export declare function rawExpression<T>(params: {
|
|
30
|
-
sql: SqlFragment;
|
|
31
|
-
decoder: ResultReadDecoder<T>;
|
|
32
|
-
references?: readonly Expression<unknown>[];
|
|
33
|
-
}): Expression<T>;
|
|
1
|
+
import type { Expressions } from "./types.ts";
|
|
34
2
|
/** Compare typed operands for equality, preserving SQL NULL propagation. */
|
|
35
3
|
export declare const eq: Expressions["eq"];
|
|
36
4
|
/** Compare typed operands for inequality. */
|