qubu 0.6.0 → 0.6.2
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 +112 -0
- package/dist/{complete-DP7pliuY.mjs → canonical-B5_ouh-c.mjs} +466 -241
- package/dist/codegen.d.mts +2 -2
- package/dist/codegen.mjs +180 -90
- package/dist/column-Cyc2CMnG.mjs +116 -0
- package/dist/column-DDRvD7SF.mjs +721 -0
- package/dist/{constraints-YGyNPQ_z.mjs → constraints-CAmi18Uk.mjs} +8 -3
- package/dist/core.d.mts +3 -3
- package/dist/core.mjs +4 -5
- package/dist/diagnostics-I9vVtXkc.mjs +40 -0
- package/dist/diff.d.mts +9 -9
- package/dist/diff.mjs +152 -102
- package/dist/{explain-CkIK13L_.mjs → explain-BIqEmZha.mjs} +1 -1
- package/dist/expressions-_6JF_J77.mjs +130 -0
- package/dist/index-CaxrMD1A.d.mts +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +414 -77
- package/dist/introspection/mysql.d.mts +26 -0
- package/dist/introspection/mysql.mjs +1278 -0
- package/dist/introspection/postgres.d.mts +43 -0
- package/dist/introspection/postgres.mjs +1889 -0
- package/dist/introspection/sqlite.d.mts +15 -0
- package/dist/introspection/sqlite.mjs +1172 -0
- package/dist/introspection.d.mts +26 -87
- package/dist/introspection.mjs +3 -4351
- package/dist/mysql.d.mts +3 -3
- package/dist/mysql.mjs +8 -7
- package/dist/{errors-Dxv73YJu.mjs → omit-VEr9Ydux.mjs} +5 -1
- package/dist/{on-conflict-DZQ85f1t.mjs → on-conflict-B2rFyHGF.mjs} +78 -8
- package/dist/on-duplicate-key-update-Czsw1Yq-.mjs +95 -0
- package/dist/postgres-hFhd0I9n.mjs +68 -0
- package/dist/postgres.d.mts +3 -3
- package/dist/postgres.mjs +3 -52
- package/dist/registry-BXE_4M9P.mjs +127 -0
- package/dist/{relational-CxnLCqZQ.mjs → relational-CoPBETjI.mjs} +3 -3
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +8 -7
- package/dist/{serialize-BN07IK0v.mjs → serialize-CyobNEx-.mjs} +174 -30
- package/dist/serialize-Du2UPZMt.d.mts +92 -0
- package/dist/snapshot/mysql.d.mts +5 -5
- package/dist/snapshot/mysql.mjs +32 -32
- package/dist/snapshot/postgres.d.mts +5 -5
- package/dist/snapshot/postgres.mjs +25 -25
- package/dist/snapshot/sqlite.d.mts +5 -5
- package/dist/snapshot/sqlite.mjs +30 -30
- package/dist/snapshot-mIb-Zzb5.mjs +1489 -0
- package/dist/snapshot.d.mts +4 -5
- package/dist/snapshot.mjs +3 -4
- package/dist/{source-SqrKWjFJ.mjs → source-DYSUqzvb.mjs} +2 -2
- package/dist/sqlite.d.mts +2 -2
- package/dist/sqlite.mjs +10 -10
- package/dist/{table-BwflqeAj.mjs → table-B8zEq0az.mjs} +4 -4
- package/dist/{types-BIJsj2fJ.mjs → types-CYHpSPwj.mjs} +10 -7
- package/dist/{types-CTCqtFlS.d.mts → types-CiMvKi5V.d.mts} +14 -4
- package/dist/{types-C0VkiwpR.d.mts → types-Dqr4o2I1.d.mts} +640 -189
- package/dist/value-CpaUFtjw.mjs +45 -0
- package/dist/vite/ambient.d.ts +2 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -0
- package/docs/dialects-and-execution.md +61 -11
- package/docs/getting-started.md +1 -1
- package/docs/guides/compose-queries.md +22 -0
- package/docs/guides/drizzle.md +11 -11
- package/docs/guides/extensions/typed-expressions.md +5 -3
- package/docs/guides/json.md +95 -2
- package/docs/guides/mutations.md +125 -0
- package/docs/guides/valtio-sync.md +113 -0
- package/docs/index.md +1 -1
- package/docs/migrations/adapters.md +58 -21
- package/docs/migrations/index.md +50 -12
- package/docs/migrations/operations.md +20 -6
- package/docs/migrations/recovery.md +7 -1
- package/docs/query-model/fragments.md +21 -1
- package/docs/reference/introspection-support.md +16 -18
- package/docs/reference/supported-surface.md +23 -11
- package/docs/schema/catalog-model.md +20 -7
- package/docs/schema/code-generation.md +4 -3
- package/docs/schema/diff.md +2 -2
- package/docs/schema/introspection.md +24 -16
- package/docs/schema/snapshots.md +18 -8
- package/docs/schema/storage-and-schema-sql.md +7 -2
- package/docs/sql-semantic-types.md +8 -0
- package/package.json +14 -1
- package/dist/canonical-DMvR9yBe.mjs +0 -972
- package/dist/column-Da37jYSD.mjs +0 -309
- package/dist/column-r1Y4ivwt.mjs +0 -327
- package/dist/complete-types-CY0KbzNw.d.mts +0 -371
- package/dist/index-B2rZf3-2.d.mts +0 -32
- package/dist/json-Db7XRD91.mjs +0 -169
- package/dist/omit-OxV58AwX.mjs +0 -5
- package/dist/registry-BRcUuazJ.mjs +0 -256
- package/dist/serialize-CEIIlWhC.d.mts +0 -66
- package/dist/snapshot-Xam8-q0j.mjs +0 -392
- package/dist/standard-DfcZEVOj.mjs +0 -12
- package/dist/value-D14I_XgL.mjs +0 -29
package/dist/snapshot.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { A as SnapshotStorage, C as SnapshotIndexTerm, D as SnapshotLiteral,
|
|
2
|
-
import { A as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export { AnySchema, CompleteSchemaSnapshot, CompleteSchemaSnapshotInput, CompleteSnapshotCapabilities, CompleteSnapshotCheckConstraint, CompleteSnapshotCollation, CompleteSnapshotColumn, CompleteSnapshotComment, CompleteSnapshotConstraint, CompleteSnapshotCreateResult, CompleteSnapshotDecodeResult, CompleteSnapshotDeferredObject, CompleteSnapshotDomain, CompleteSnapshotEnum, CompleteSnapshotExtension, CompleteSnapshotForeignKey, CompleteSnapshotIdentity, CompleteSnapshotIndex, CompleteSnapshotIndexTerm, CompleteSnapshotKeyConstraint, CompleteSnapshotNamespace, CompleteSnapshotObject, CompleteSnapshotObjectKind, CompleteSnapshotObjectMetadata, CompleteSnapshotObjectReference, CompleteSnapshotOpaqueObject, CompleteSnapshotOwnership, CompleteSnapshotPartition, CompleteSnapshotPhysicalReference, CompleteSnapshotPolicy, CompleteSnapshotProvenance, CompleteSnapshotRoutine, CompleteSnapshotRoutineParameter, CompleteSnapshotSequence, CompleteSnapshotTable, CompleteSnapshotTrigger, CompleteSnapshotValidationError, CompleteSnapshotValueFact, CompleteSnapshotView, type NativeColumnStorage, type PortableColumnStorage, type SchemaDialect, type SchemaDialectHooks, SchemaSnapshot, SchemaSnapshotAdapter, SchemaSnapshotInput, SchemaSnapshotOptions, SchemaSnapshotV2, SchemaSnapshotV2DecodeResult, SchemaSnapshotV2Input, SnapshotBigInt, SnapshotCanonicalError, SnapshotCheckConstraint, SnapshotColumn, SnapshotConstraint, SnapshotCreateResult, SnapshotDecodeResult, SnapshotDefault, SnapshotDiagnostic, SnapshotDiagnosticCode, SnapshotDialect, SnapshotDialectExtension, SnapshotExpression, SnapshotExpressionContext, SnapshotExtensionContext, SnapshotForeignKey, SnapshotGeneratedColumn, SnapshotIdentity, SnapshotIndex, SnapshotIndexTerm, SnapshotIndexTermExpression, SnapshotJsonValue, SnapshotKeyConstraint, SnapshotLiteral, SnapshotNamingPolicy, SnapshotSerializationError, SnapshotSpecialNumber, SnapshotStorage, SnapshotStorageContext, SnapshotTable, SnapshotUniqueConstraint, SnapshotValidationContext, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV2, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV2, completeSchemaSnapshotFingerprint, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createSchemaDialect, createSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV2, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV2, encodeSnapshot, fingerprintCompleteSchemaSnapshot, fingerprintSchemaSnapshot, neutralSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotFingerprint, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV2Fingerprint, schemaSnapshotV2Version, schemaSnapshotVersion, schemaSnapshotVersion2, serializeSchema, toSnapshotJsonValue, tryCreateSchemaSnapshot };
|
|
1
|
+
import { $ as CompleteSnapshotExtension, A as SnapshotStorage, At as schemaSnapshotCompleteVersion, B as CompleteSchemaSnapshot, C as SnapshotIndexTerm, Ct as CompleteSnapshotValueFact, D as SnapshotLiteral, Dt as SchemaSnapshotV1Input, E as SnapshotKeyConstraint, Et as SchemaSnapshotV1DecodeResult, F as neutralSnapshotDialect, G as CompleteSnapshotColumn, H as CompleteSnapshotCapabilities, I as schemaSnapshotDialectVersion, J as CompleteSnapshotCreateResult, K as CompleteSnapshotComment, L as schemaSnapshotFormat, M as SnapshotTable, Mi as SchemaDialectHooks, Mt as schemaSnapshotVersion1, N as SnapshotUniqueConstraint, Ni as createSchemaDialect, O as SnapshotNamingPolicy, Ot as completeSchemaSnapshotFormat, P as SnapshotValidationContext, Q as CompleteSnapshotEnum, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, St as CompleteSnapshotTrigger, T as SnapshotJsonValue, Tt as SchemaSnapshotV1, U as CompleteSnapshotCheckConstraint, V as CompleteSchemaSnapshotInput, W as CompleteSnapshotCollation, X as CompleteSnapshotDeferredObject, Y as CompleteSnapshotDecodeResult, Z as CompleteSnapshotDomain, _ as SnapshotExpressionContext, _t as CompleteSnapshotProvenance, a as SnapshotBigInt, at as CompleteSnapshotNamespace, b as SnapshotGeneratedColumn, bt as CompleteSnapshotSequence, c as SnapshotConstraint, ct as CompleteSnapshotObjectMetadata, d as SnapshotDefault, dt as CompleteSnapshotObjectReference, et as CompleteSnapshotForeignKey, f as SnapshotDiagnostic, ft as CompleteSnapshotOpaqueObject, g as SnapshotExpression, gc as PortableColumnStorage, gt as CompleteSnapshotPolicy, h as SnapshotDialectExtension, ht as CompleteSnapshotPhysicalReference, i as SchemaSnapshotInput, it as CompleteSnapshotKeyConstraint, j as SnapshotStorageContext, ji as SchemaDialect, jt as schemaSnapshotV1Version, k as SnapshotSpecialNumber, kt as completeSchemaSnapshotVersion, l as SnapshotCreateResult, lt as CompleteSnapshotObjectOwner, m as SnapshotDialect, mt as CompleteSnapshotPartition, n as SchemaSnapshot, nt as CompleteSnapshotIndex, o as SnapshotCheckConstraint, ot as CompleteSnapshotObject, p as SnapshotDiagnosticCode, pc as NativeColumnStorage, pt as CompleteSnapshotOwnership, q as CompleteSnapshotConstraint, r as SchemaSnapshotAdapter, rt as CompleteSnapshotIndexTerm, s as SnapshotColumn, st as CompleteSnapshotObjectKind, t as AnySchema, tt as CompleteSnapshotIdentity, u as SnapshotDecodeResult, ut as CompleteSnapshotObjectOwnerKind, v as SnapshotExtensionContext, vt as CompleteSnapshotRoutine, w as SnapshotIndexTermExpression, wt as CompleteSnapshotView, x as SnapshotIdentity, xt as CompleteSnapshotTable, y as SnapshotForeignKey, yt as CompleteSnapshotRoutineParameter, z as schemaSnapshotVersion } from "./types-Dqr4o2I1.mjs";
|
|
2
|
+
import { A as encodeCanonicalSnapshot, C as encodeCompleteSchemaSnapshot, D as schemaSnapshotV1Fingerprint, E as fingerprintCompleteSchemaSnapshot, M as toSnapshotJsonValue, O as SnapshotCanonicalError, S as decodeSchemaSnapshotV1, T as encodeSchemaSnapshotV1, _ as canonicalizeCompleteSchemaSnapshot, a as encodeSnapshot, b as decodeCompleteSchemaSnapshot, c as tryCreateSchemaSnapshot, d as canonicalizeSchemaSnapshot, f as decodeSchemaSnapshot, g as assertSchemaSnapshotV1, h as assertCompleteSnapshot, i as encodeSchemaSnapshot, j as schemaSnapshotFingerprint, k as canonicalJson, l as SnapshotValidationError, m as assertCompleteSchemaSnapshot, n as SnapshotSerializationError, o as fingerprintSchemaSnapshot, p as CompleteSnapshotValidationError, r as createSchemaSnapshot, s as serializeSchema, t as SchemaSnapshotOptions, u as assertSchemaSnapshot, v as canonicalizeSchemaSnapshotV1, w as encodeCompleteSnapshot, x as decodeCompleteSnapshot, y as completeSchemaSnapshotFingerprint } from "./serialize-Du2UPZMt.mjs";
|
|
3
|
+
import "./index-CaxrMD1A.mjs";
|
|
4
|
+
export { AnySchema, CompleteSchemaSnapshot, CompleteSchemaSnapshotInput, CompleteSnapshotCapabilities, CompleteSnapshotCheckConstraint, CompleteSnapshotCollation, CompleteSnapshotColumn, CompleteSnapshotComment, CompleteSnapshotConstraint, CompleteSnapshotCreateResult, CompleteSnapshotDecodeResult, CompleteSnapshotDeferredObject, CompleteSnapshotDomain, CompleteSnapshotEnum, CompleteSnapshotExtension, CompleteSnapshotForeignKey, CompleteSnapshotIdentity, CompleteSnapshotIndex, CompleteSnapshotIndexTerm, CompleteSnapshotKeyConstraint, CompleteSnapshotNamespace, CompleteSnapshotObject, CompleteSnapshotObjectKind, CompleteSnapshotObjectMetadata, CompleteSnapshotObjectOwner, CompleteSnapshotObjectOwnerKind, CompleteSnapshotObjectReference, CompleteSnapshotOpaqueObject, CompleteSnapshotOwnership, CompleteSnapshotPartition, CompleteSnapshotPhysicalReference, CompleteSnapshotPolicy, CompleteSnapshotProvenance, CompleteSnapshotRoutine, CompleteSnapshotRoutineParameter, CompleteSnapshotSequence, CompleteSnapshotTable, CompleteSnapshotTrigger, CompleteSnapshotValidationError, CompleteSnapshotValueFact, CompleteSnapshotView, type NativeColumnStorage, type PortableColumnStorage, type SchemaDialect, type SchemaDialectHooks, SchemaSnapshot, SchemaSnapshotAdapter, SchemaSnapshotInput, SchemaSnapshotOptions, SchemaSnapshotV1, SchemaSnapshotV1DecodeResult, SchemaSnapshotV1Input, SnapshotBigInt, SnapshotCanonicalError, SnapshotCheckConstraint, SnapshotColumn, SnapshotConstraint, SnapshotCreateResult, SnapshotDecodeResult, SnapshotDefault, SnapshotDiagnostic, SnapshotDiagnosticCode, SnapshotDialect, SnapshotDialectExtension, SnapshotExpression, SnapshotExpressionContext, SnapshotExtensionContext, SnapshotForeignKey, SnapshotGeneratedColumn, SnapshotIdentity, SnapshotIndex, SnapshotIndexTerm, SnapshotIndexTermExpression, SnapshotJsonValue, SnapshotKeyConstraint, SnapshotLiteral, SnapshotNamingPolicy, SnapshotSerializationError, SnapshotSpecialNumber, SnapshotStorage, SnapshotStorageContext, SnapshotTable, SnapshotUniqueConstraint, SnapshotValidationContext, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV1, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV1, completeSchemaSnapshotFingerprint, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createSchemaDialect, createSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV1, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV1, encodeSnapshot, fingerprintCompleteSchemaSnapshot, fingerprintSchemaSnapshot, neutralSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotFingerprint, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV1Fingerprint, schemaSnapshotV1Version, schemaSnapshotVersion, schemaSnapshotVersion1, serializeSchema, toSnapshotJsonValue, tryCreateSchemaSnapshot };
|
package/dist/snapshot.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
|
|
2
|
-
import { a as toSnapshotJsonValue, c as canonicalizeSchemaSnapshot, d as
|
|
3
|
-
import { a as fingerprintSchemaSnapshot, i as encodeSnapshot, n as createSchemaSnapshot, o as serializeSchema, r as encodeSchemaSnapshot, s as tryCreateSchemaSnapshot, t as SnapshotSerializationError } from "./serialize-
|
|
4
|
-
|
|
5
|
-
export { CompleteSnapshotValidationError, SnapshotCanonicalError, SnapshotSerializationError, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV2, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV2, completeSchemaSnapshotFingerprint, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createSchemaDialect, createSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV2, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV2, encodeSnapshot, fingerprintCompleteSchemaSnapshot, fingerprintSchemaSnapshot, neutralSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotFingerprint, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV2Fingerprint, schemaSnapshotV2Version, schemaSnapshotVersion, schemaSnapshotVersion2, serializeSchema, toSnapshotJsonValue, tryCreateSchemaSnapshot };
|
|
2
|
+
import { A as neutralSnapshotDialect, C as fingerprintCompleteSchemaSnapshot, D as schemaSnapshotCompleteVersion, E as completeSchemaSnapshotVersion, M as schemaSnapshotFormat, N as schemaSnapshotNamingPolicyVersion, O as schemaSnapshotV1Version, P as schemaSnapshotVersion, S as encodeSchemaSnapshotV1, T as completeSchemaSnapshotFormat, _ as decodeCompleteSchemaSnapshot, a as toSnapshotJsonValue, b as encodeCompleteSchemaSnapshot, c as canonicalizeSchemaSnapshot, d as assertCompleteSchemaSnapshot, f as assertCompleteSnapshot, g as completeSchemaSnapshotFingerprint, h as canonicalizeSchemaSnapshotV1, i as schemaSnapshotFingerprint, j as schemaSnapshotDialectVersion, k as schemaSnapshotVersion1, l as decodeSchemaSnapshot, m as canonicalizeCompleteSchemaSnapshot, n as canonicalJson, o as SnapshotValidationError, p as assertSchemaSnapshotV1, r as encodeCanonicalSnapshot, s as assertSchemaSnapshot, t as SnapshotCanonicalError, u as CompleteSnapshotValidationError, v as decodeCompleteSnapshot, w as schemaSnapshotV1Fingerprint, x as encodeCompleteSnapshot, y as decodeSchemaSnapshotV1 } from "./canonical-B5_ouh-c.mjs";
|
|
3
|
+
import { a as fingerprintSchemaSnapshot, i as encodeSnapshot, n as createSchemaSnapshot, o as serializeSchema, r as encodeSchemaSnapshot, s as tryCreateSchemaSnapshot, t as SnapshotSerializationError } from "./serialize-CyobNEx-.mjs";
|
|
4
|
+
export { CompleteSnapshotValidationError, SnapshotCanonicalError, SnapshotSerializationError, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV1, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV1, completeSchemaSnapshotFingerprint, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createSchemaDialect, createSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV1, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV1, encodeSnapshot, fingerprintCompleteSchemaSnapshot, fingerprintSchemaSnapshot, neutralSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotFingerprint, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV1Fingerprint, schemaSnapshotV1Version, schemaSnapshotVersion, schemaSnapshotVersion1, serializeSchema, toSnapshotJsonValue, tryCreateSchemaSnapshot };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as columnResultValue } from "./column-
|
|
1
|
+
import { t as createColumnReference, x as resolveSqlNames } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { a as columnResultValue } from "./column-Cyc2CMnG.mjs";
|
|
3
3
|
//#region src/schema/source.ts
|
|
4
4
|
const sourceIdentity = Symbol("qubu.source.identity");
|
|
5
5
|
function createSource(sourceKind, render, reference, constraints = {}) {
|
package/dist/sqlite.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pt as Dialect, Us as ColumnDefinition, _r as excluded, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, lr as ConflictAction, mr as OnConflictClause, pc as NativeColumnStorage, pr as ExcludedSource, ur as ConflictTarget, vf as SqlTimestamp, vr as onConflict } from "./types-Dqr4o2I1.mjs";
|
|
2
2
|
//#region src/dialects/sqlite.d.ts
|
|
3
3
|
/** Integer encoding used by SQLite timestamp columns. */
|
|
4
4
|
type SqliteTimestampMode = "timestamp" | "timestamp_ms";
|
|
@@ -27,6 +27,6 @@ type SqliteTimestampColumn<TOptions extends SqliteTimestampOptions = {}> = Colum
|
|
|
27
27
|
}>;
|
|
28
28
|
/** Declare a SQLite `INTEGER` timestamp with a live Date codec. */
|
|
29
29
|
declare function sqliteTimestamp<const TOptions extends SqliteTimestampOptions = {}>(options?: TOptions): SqliteTimestampColumn<TOptions>;
|
|
30
|
-
declare function sqliteDialect(): Dialect<"
|
|
30
|
+
declare function sqliteDialect(): Dialect<"json" | "on-conflict">;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { type ConflictAction, type ConflictTarget, type DoNothingAction, type DoUpdateAction, type ExcludedSource, type OnConflictClause, SqliteTimestampColumn, SqliteTimestampMode, SqliteTimestampOptions, doNothing, doUpdate, excluded, onConflict, sqliteDialect, sqliteTimestamp };
|
package/dist/sqlite.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as
|
|
3
|
-
import { r as sqliteExplain } from "./explain-
|
|
4
|
-
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-
|
|
1
|
+
import { J as sqliteJson, Z as createDialect } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { d as nativeColumn, f as nativeStorage } from "./column-Cyc2CMnG.mjs";
|
|
3
|
+
import { r as sqliteExplain } from "./explain-BIqEmZha.mjs";
|
|
4
|
+
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-B2rFyHGF.mjs";
|
|
5
5
|
//#region src/dialects/sqlite.ts
|
|
6
6
|
/** Declare a SQLite `INTEGER` timestamp with a live Date codec. */
|
|
7
7
|
function sqliteTimestamp(options) {
|
|
@@ -28,7 +28,7 @@ function sqliteTimestamp(options) {
|
|
|
28
28
|
}
|
|
29
29
|
}).$type();
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function renderSchemaLiteral(value) {
|
|
32
32
|
if (value === null) return "NULL";
|
|
33
33
|
if (typeof value === "boolean") return value ? "1" : "0";
|
|
34
34
|
if (typeof value === "string") return `'${value.replaceAll("'", "''")}'`;
|
|
@@ -39,22 +39,22 @@ function renderSqliteSchemaLiteral(value) {
|
|
|
39
39
|
}
|
|
40
40
|
throw new TypeError(`Unsupported SQLite schema literal type: ${value === void 0 ? "undefined" : typeof value}`);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function renderPagination(context, parts) {
|
|
43
43
|
const fetch = parts.find((part) => part.kind === "fetch");
|
|
44
44
|
const offset = parts.find((part) => part.kind === "offset");
|
|
45
45
|
context.append("LIMIT ");
|
|
46
|
-
if (fetch) context.parameter(fetch.rows);
|
|
46
|
+
if (fetch) context.parameter(fetch.rows, "integer");
|
|
47
47
|
else context.append("-1");
|
|
48
48
|
if (offset) {
|
|
49
49
|
context.append(" OFFSET ");
|
|
50
|
-
context.parameter(offset.rows);
|
|
50
|
+
context.parameter(offset.rows, "integer");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function sqliteDialect() {
|
|
54
54
|
return createDialect({
|
|
55
55
|
name: "sqlite",
|
|
56
56
|
placeholder: () => "?",
|
|
57
|
-
pagination: { render:
|
|
57
|
+
pagination: { render: renderPagination },
|
|
58
58
|
capabilities: ["on-conflict"],
|
|
59
59
|
json: sqliteJson,
|
|
60
60
|
castTypes: {
|
|
@@ -66,7 +66,7 @@ function sqliteDialect() {
|
|
|
66
66
|
json: "TEXT",
|
|
67
67
|
binary: "BLOB"
|
|
68
68
|
},
|
|
69
|
-
renderSchemaLiteral
|
|
69
|
+
renderSchemaLiteral,
|
|
70
70
|
explain: sqliteExplain
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as columnResultValue } from "./column-
|
|
3
|
-
import { r as exposeColumns, t as createSource } from "./source-
|
|
1
|
+
import { H as resultShapeValue, M as parenthesize, W as resultValueOf, b as materializeSchemaObjectRecord, i as identifier, t as createColumnReference, x as resolveSqlNames } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { a as columnResultValue } from "./column-Cyc2CMnG.mjs";
|
|
3
|
+
import { r as exposeColumns, t as createSource } from "./source-DYSUqzvb.mjs";
|
|
4
4
|
//#region src/schema/alias.ts
|
|
5
5
|
function alias(sourceOrQuery, name) {
|
|
6
6
|
const input = sourceOrQuery;
|
|
@@ -75,7 +75,7 @@ function table(name, definitions, metadata) {
|
|
|
75
75
|
};
|
|
76
76
|
const constraints = materializeSchemaObjectRecord(resolvedMetadata.constraints, "constraint");
|
|
77
77
|
const indexes = Object.fromEntries(Object.entries(resolvedMetadata.indexes).map(([indexName, tableIndex]) => {
|
|
78
|
-
const candidateKey = tableIndex.unique && tableIndex.predicate === void 0 && tableIndex.terms.every((term) => {
|
|
78
|
+
const candidateKey = tableIndex.unique && tableIndex.predicate === void 0 && tableIndex.termOptions === void 0 && tableIndex.terms.every((term) => {
|
|
79
79
|
const expression = "orderKind" in term ? term.expression : term;
|
|
80
80
|
return expression.expressionKind === "column" && definitions[expression.fieldName]?.nullable === false;
|
|
81
81
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as columnResultValue } from "./column-Da37jYSD.mjs";
|
|
5
|
-
import { t as asValue } from "./value-D14I_XgL.mjs";
|
|
1
|
+
import { $ as resolveCastTarget, A as fragment, E as makeSchemaExpression, T as makeExpression } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { o as standardDialect, t as asValue } from "./value-CpaUFtjw.mjs";
|
|
3
|
+
import { a as columnResultValue } from "./column-Cyc2CMnG.mjs";
|
|
6
4
|
//#region src/core/render.ts
|
|
7
5
|
function render(query, options = {}) {
|
|
8
6
|
const dialect = isDialect(options) ? options : options.dialect ?? standardDialect();
|
|
9
7
|
const parameters = [];
|
|
8
|
+
const parameterSqlTypes = [];
|
|
9
|
+
let hasParameterSqlTypes = false;
|
|
10
10
|
let text = "";
|
|
11
11
|
let projectionMode = "result";
|
|
12
12
|
const context = {
|
|
@@ -17,8 +17,10 @@ function render(query, options = {}) {
|
|
|
17
17
|
append(value) {
|
|
18
18
|
text += value;
|
|
19
19
|
},
|
|
20
|
-
parameter(value) {
|
|
20
|
+
parameter(value, sqlType) {
|
|
21
21
|
parameters.push(value);
|
|
22
|
+
parameterSqlTypes.push(sqlType);
|
|
23
|
+
hasParameterSqlTypes ||= sqlType !== void 0;
|
|
22
24
|
text += dialect.placeholder(parameters.length);
|
|
23
25
|
},
|
|
24
26
|
render(part) {
|
|
@@ -37,7 +39,8 @@ function render(query, options = {}) {
|
|
|
37
39
|
query.render(context);
|
|
38
40
|
return Object.freeze({
|
|
39
41
|
text,
|
|
40
|
-
parameters: Object.freeze(parameters.slice())
|
|
42
|
+
parameters: Object.freeze(parameters.slice()),
|
|
43
|
+
...hasParameterSqlTypes ? { parameterSqlTypes: Object.freeze(parameterSqlTypes.slice()) } : {}
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
function isDialect(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as SchemaSnapshot } from "./types-
|
|
1
|
+
import { n as SchemaSnapshot } from "./types-Dqr4o2I1.mjs";
|
|
2
2
|
//#region src/introspection/connection.d.ts
|
|
3
3
|
/** A parameterized statement owned by a catalog adapter. */
|
|
4
4
|
interface CatalogQuery {
|
|
@@ -169,10 +169,18 @@ interface CatalogUnknownField {
|
|
|
169
169
|
readonly value: CatalogData | CatalogSqlExpression;
|
|
170
170
|
readonly provenance?: CatalogProvenance;
|
|
171
171
|
}
|
|
172
|
+
/** Object families that can own nested normalized catalog objects. */
|
|
173
|
+
type CatalogObjectOwnerKind = "table" | "view" | "materialized-view" | "domain";
|
|
174
|
+
/** A non-recursive owner scope for a nested normalized catalog object. */
|
|
175
|
+
interface CatalogObjectOwner {
|
|
176
|
+
readonly kind: CatalogObjectOwnerKind;
|
|
177
|
+
readonly id: string;
|
|
178
|
+
}
|
|
172
179
|
/** A reference to an object in the normalized catalog. */
|
|
173
180
|
interface CatalogObjectReference {
|
|
174
181
|
readonly kind: Exclude<CatalogEntityKind, "namespace">;
|
|
175
182
|
readonly id: string;
|
|
183
|
+
readonly owner?: CatalogObjectOwner;
|
|
176
184
|
}
|
|
177
185
|
/** A comment observed for a physical catalog object. */
|
|
178
186
|
interface CatalogComment {
|
|
@@ -280,6 +288,8 @@ interface CatalogNamespace {
|
|
|
280
288
|
interface CatalogEntityReference {
|
|
281
289
|
readonly kind: Exclude<CatalogEntityKind, "namespace" | "deferred-object">;
|
|
282
290
|
readonly id: string;
|
|
291
|
+
readonly owner?: CatalogObjectOwner;
|
|
292
|
+
/** Existing table-local scope input, translated to `owner` by the mapper. */
|
|
283
293
|
readonly tableId?: string;
|
|
284
294
|
}
|
|
285
295
|
/** A primary key constraint in the normalized catalog. */
|
|
@@ -416,7 +426,7 @@ interface CatalogColumn extends CatalogObjectMetadata {
|
|
|
416
426
|
readonly dialect?: CatalogDialectExtension;
|
|
417
427
|
readonly unknownFields?: readonly CatalogUnknownField[];
|
|
418
428
|
}
|
|
419
|
-
/** Object categories intentionally retained outside
|
|
429
|
+
/** Object categories intentionally retained outside the ordinary table surface. */
|
|
420
430
|
type CatalogDeferredObjectKind = "view" | "materialized-view" | "sequence" | "enum" | "domain" | "collation" | "routine" | "trigger" | "policy" | "extension" | "partition" | "virtual-table" | "shadow-table" | "temporary-object" | "foreign-table" | "other";
|
|
421
431
|
/** A deferred or unmodeled object retained for diagnostics and future support. */
|
|
422
432
|
interface CatalogDeferredObject extends CatalogObjectMetadata {
|
|
@@ -560,7 +570,7 @@ type CatalogUnknownObject = CatalogOpaqueObject;
|
|
|
560
570
|
type CatalogCompleteObject = CatalogTable | CatalogView | CatalogSequence | CatalogEnum | CatalogDomain | CatalogCollation | CatalogTrigger | CatalogRoutine | CatalogPartition | CatalogPolicy | CatalogExtensionObject | CatalogOpaqueObject | CatalogDeferredObject | CatalogComment | CatalogOwnership;
|
|
561
571
|
/** Short alias for the complete normalized object union. */
|
|
562
572
|
type CatalogObject = CatalogCompleteObject;
|
|
563
|
-
/** The complete normalized catalog shape used by the
|
|
573
|
+
/** The complete normalized catalog shape used by the v1 snapshot mapper. */
|
|
564
574
|
interface CompleteIntrospectionCatalog {
|
|
565
575
|
readonly dialect: CatalogDialect;
|
|
566
576
|
readonly server: CatalogServerInfo;
|
|
@@ -640,4 +650,4 @@ type IntrospectionResult = IntrospectionSuccess | IntrospectionFailure;
|
|
|
640
650
|
/** Function shape for a later dialect-specific catalog reader. */
|
|
641
651
|
type CatalogIntrospector = (connection: CatalogConnection, options: IntrospectionOptions) => Promise<IntrospectionResult>;
|
|
642
652
|
//#endregion
|
|
643
|
-
export {
|
|
653
|
+
export { CatalogStorageType as $, CatalogNamespace as A, hasIntrospectionErrors as At, CatalogPolicy as B, CatalogForeignKeyTarget as C, introspectedPhysicalIdentityPolicy as Ct, CatalogIndexTerm as D, IntrospectionDiagnosticSeverity as Dt, CatalogIndex as E, IntrospectionDiagnosticInput as Et, CatalogObjectOwnerKind as F, CatalogQueryRow as G, CatalogPrimaryKeyConstraint as H, CatalogObjectReference as I, CatalogRoutineParameter as J, CatalogReference as K, CatalogOpaqueObject as L, CatalogObjectBase as M, CatalogQuery as Mt, CatalogObjectMetadata as N, CatalogQueryOptions as Nt, CatalogIntrospector as O, IntrospectionError as Ot, CatalogObjectOwner as P, CatalogSqlExpression as Q, CatalogOwnership as R, CatalogForeignKeyConstraint as S, CatalogResolvedIdentity as St, CatalogIdentity as T, IntrospectionDiagnosticCode as Tt, CatalogProvenance as U, CatalogPortableStorageType as V, CatalogProvenanceKind as W, CatalogSequence as X, CatalogScalar as Y, CatalogServerInfo as Z, CatalogEntityReference as _, CatalogIdentityHint as _t, CatalogCollation as a, CatalogValueFact as at, CatalogExpressionFact as b, CatalogIdentitySource as bt, CatalogCompleteObject as c, CompleteIntrospectionCatalog as ct, CatalogDeferredObject as d, IntrospectionMode as dt, CatalogTable as et, CatalogDeferredObjectKind as f, IntrospectionOptions as ft, CatalogEntityKind as g, CatalogIdentityFallback as gt, CatalogDomain as h, CatalogIdentityEntityKind as ht, CatalogClassificationConfidence as i, CatalogUnknownObject as it, CatalogObject as j, CatalogConnection as jt, CatalogLiteralFact as k, createIntrospectionDiagnostic as kt, CatalogConstraint as l, IntrospectionCatalog as lt, CatalogDialectExtension as m, IntrospectionSuccess as mt, CatalogCatalogReference as n, CatalogUniqueConstraint as nt, CatalogColumn as o, CatalogVersion as ot, CatalogDialect as p, IntrospectionResult as pt, CatalogRoutine as q, CatalogCheckConstraint as r, CatalogUnknownField as rt, CatalogComment as s, CatalogView as st, CatalogCapabilities as t, CatalogTrigger as tt, CatalogData as u, IntrospectionFailure as ut, CatalogEnum as v, CatalogIdentityHints as vt, CatalogGeneratedColumn as w, IntrospectionDiagnostic as wt, CatalogExtensionObject as x, CatalogPreviousSnapshotIdentitySource as xt, CatalogEnumValue as y, CatalogIdentityPolicy as yt, CatalogPartition as z };
|