qubu 0.4.2 → 0.4.3
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/codegen.d.mts +1 -1
- package/dist/codegen.mjs +6 -3
- package/dist/{column-hqKr7-1I.mjs → column-DmazTL67.mjs} +15 -2
- package/dist/{complete-types-IjEn5VPN.d.mts → complete-types-CY0KbzNw.d.mts} +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.mjs +3 -3
- package/dist/ddl.d.mts +4 -4
- package/dist/ddl.mjs +2 -2
- package/dist/diff.d.mts +1 -1
- package/dist/{index-CPvfEheG.d.mts → index-C_BQNvbT.d.mts} +2 -2
- package/dist/{index-1DpA3mUh.d.mts → index-DSX3IGM6.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +226 -44
- package/dist/introspection.d.mts +2 -2
- package/dist/introspection.mjs +1 -1
- package/dist/migration.d.mts +2 -2
- package/dist/{mysql-B_cYzzX2.mjs → mysql-DxFleLw4.mjs} +3 -3
- package/dist/mysql.d.mts +2 -2
- package/dist/{on-conflict-hfPW0KmQ.mjs → on-conflict-jPsl9l0K.mjs} +6 -3
- package/dist/postgres.d.mts +2 -2
- package/dist/postgres.mjs +3 -3
- package/dist/{registry-BRMLYwDp.mjs → registry-BGqa05et.mjs} +2 -2
- package/dist/{relational-BZ3WDPzC.mjs → relational-x3BDVX9e.mjs} +2 -2
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +5 -5
- package/dist/{snapshot-C-W65HEd.mjs → snapshot-tkKoCd-F.mjs} +1 -1
- package/dist/snapshot.d.mts +3 -3
- package/dist/snapshot.mjs +2 -2
- package/dist/{source-BcS2AsIg.mjs → source-C4Vmu5bb.mjs} +1 -1
- package/dist/{sqlite-Cg0nwYEH.mjs → sqlite-mPVdrKrk.mjs} +2 -2
- package/dist/sqlite.d.mts +30 -3
- package/dist/sqlite.mjs +28 -2
- package/dist/{table-Bp5irMSj.mjs → table-DLQ7YWth.mjs} +2 -2
- package/dist/{types-BK1COGZe.d.mts → types-C0VkiwpR.d.mts} +146 -41
- package/dist/{types-JSZHpUEj.d.mts → types-CTCqtFlS.d.mts} +1 -1
- package/dist/{types-JM3FcAnX.mjs → types-CTENnDh9.mjs} +2 -2
- package/dist/{value-Bi71Agyf.mjs → value-BEEj_Ayd.mjs} +1 -1
- package/dist/vite/ambient.d.ts +6 -0
- package/docs/dialects-and-execution.md +47 -0
- package/docs/guides/drizzle.md +2 -1
- package/docs/reference/supported-surface.md +1 -1
- package/docs/schema/columns-and-writes.md +14 -0
- package/package.json +1 -1
package/dist/snapshot.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SnapshotStorage, C as SnapshotIndexTerm, D as SnapshotLiteral, Dr as createSchemaDialect, E as SnapshotKeyConstraint, Er as SchemaDialectHooks, F as neutralSnapshotDialect, I as schemaSnapshotDialectVersion, L as schemaSnapshotFormat, M as SnapshotTable, N as SnapshotUniqueConstraint, O as SnapshotNamingPolicy, P as SnapshotValidationContext, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, T as SnapshotJsonValue, Tr as SchemaDialect, _ as SnapshotExpressionContext, a as SnapshotBigInt, b as SnapshotGeneratedColumn, c as SnapshotConstraint, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput,
|
|
2
|
-
import { A as CompleteSnapshotProvenance, B as SchemaSnapshotV2Input, C as CompleteSnapshotObjectMetadata, D as CompleteSnapshotPartition, E as CompleteSnapshotOwnership, F as CompleteSnapshotTrigger, G as schemaSnapshotVersion2, H as completeSchemaSnapshotVersion, I as CompleteSnapshotValueFact, L as CompleteSnapshotView, M as CompleteSnapshotRoutineParameter, N as CompleteSnapshotSequence, O as CompleteSnapshotPhysicalReference, P as CompleteSnapshotTable, R as SchemaSnapshotV2, S as CompleteSnapshotObjectKind, T as CompleteSnapshotOpaqueObject, U as schemaSnapshotCompleteVersion, V as completeSchemaSnapshotFormat, W as schemaSnapshotV2Version, _ as CompleteSnapshotIndex, a as CompleteSnapshotCollation, b as CompleteSnapshotNamespace, c as CompleteSnapshotConstraint, d as CompleteSnapshotDeferredObject, f as CompleteSnapshotDomain, g as CompleteSnapshotIdentity, h as CompleteSnapshotForeignKey, i as CompleteSnapshotCheckConstraint, j as CompleteSnapshotRoutine, k as CompleteSnapshotPolicy, l as CompleteSnapshotCreateResult, m as CompleteSnapshotExtension, n as CompleteSchemaSnapshotInput, o as CompleteSnapshotColumn, p as CompleteSnapshotEnum, r as CompleteSnapshotCapabilities, s as CompleteSnapshotComment, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult, v as CompleteSnapshotIndexTerm, w as CompleteSnapshotObjectReference, x as CompleteSnapshotObject, y as CompleteSnapshotKeyConstraint, z as SchemaSnapshotV2DecodeResult } from "./complete-types-
|
|
3
|
-
import { A as assertSchemaSnapshot, B as decodeCompleteSchemaSnapshot, C as createSchemaSnapshot, D as serializeSchema, E as encodeSnapshot, F as assertCompleteSnapshot, G as encodeCompleteSnapshot, H as decodeSchemaSnapshotV2, I as assertSchemaSnapshotV2, J as SnapshotCanonicalError, K as encodeSchemaSnapshotV2, L as canonicalizeCompleteSchemaSnapshot, M as decodeSchemaSnapshot, N as CompleteSnapshotValidationError, O as tryCreateSchemaSnapshot, P as assertCompleteSchemaSnapshot, Q as toSnapshotJsonValue, R as canonicalizeSchemaSnapshotV2, S as SnapshotSerializationError, T as encodeSchemaSnapshot, U as digestCompleteSchemaSnapshot, V as decodeCompleteSnapshot, W as encodeCompleteSchemaSnapshot, X as encodeCanonicalSnapshot, Y as canonicalJson, Z as schemaSnapshotDigest, _ as postgresSchemaDialect, a as mysqlSnapshotDialect, b as tryCreatePostgresSchemaSnapshot, c as SqliteStorageAffinity, d as sqliteSnapshotAdapter, f as sqliteSnapshotDialect, g as createPostgresSchemaSnapshot, h as PostgresSnapshotOptions, i as mysqlSnapshotAdapter, j as canonicalizeSchemaSnapshot, k as SnapshotValidationError, l as createSqliteSchemaSnapshot, m as tryCreateSqliteSchemaSnapshot, n as createMysqlSchemaSnapshot, o as tryCreateMysqlSchemaSnapshot, p as sqliteStorageAffinity, q as schemaSnapshotV2Digest, r as mysqlSchemaDialect, s as SqliteSnapshotOptions, t as MysqlSnapshotOptions, u as sqliteSchemaDialect, v as postgresSnapshotAdapter, w as digestSchemaSnapshot, x as SchemaSnapshotOptions, y as postgresSnapshotDialect, z as completeSchemaSnapshotDigest } from "./index-
|
|
1
|
+
import { A as SnapshotStorage, C as SnapshotIndexTerm, D as SnapshotLiteral, Dr as createSchemaDialect, E as SnapshotKeyConstraint, Er as SchemaDialectHooks, F as neutralSnapshotDialect, I as schemaSnapshotDialectVersion, L as schemaSnapshotFormat, M as SnapshotTable, N as SnapshotUniqueConstraint, O as SnapshotNamingPolicy, P as SnapshotValidationContext, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, T as SnapshotJsonValue, Tr as SchemaDialect, _ as SnapshotExpressionContext, a as SnapshotBigInt, b as SnapshotGeneratedColumn, c as SnapshotConstraint, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, j as SnapshotStorageContext, k as SnapshotSpecialNumber, l as SnapshotCreateResult, ls as PortableColumnStorage, m as SnapshotDialect, n as SchemaSnapshot, o as SnapshotCheckConstraint, os as NativeColumnStorage, p as SnapshotDiagnosticCode, r as SchemaSnapshotAdapter, s as SnapshotColumn, t as AnySchema, u as SnapshotDecodeResult, v as SnapshotExtensionContext, w as SnapshotIndexTermExpression, x as SnapshotIdentity, y as SnapshotForeignKey, z as schemaSnapshotVersion } from "./types-C0VkiwpR.mjs";
|
|
2
|
+
import { A as CompleteSnapshotProvenance, B as SchemaSnapshotV2Input, C as CompleteSnapshotObjectMetadata, D as CompleteSnapshotPartition, E as CompleteSnapshotOwnership, F as CompleteSnapshotTrigger, G as schemaSnapshotVersion2, H as completeSchemaSnapshotVersion, I as CompleteSnapshotValueFact, L as CompleteSnapshotView, M as CompleteSnapshotRoutineParameter, N as CompleteSnapshotSequence, O as CompleteSnapshotPhysicalReference, P as CompleteSnapshotTable, R as SchemaSnapshotV2, S as CompleteSnapshotObjectKind, T as CompleteSnapshotOpaqueObject, U as schemaSnapshotCompleteVersion, V as completeSchemaSnapshotFormat, W as schemaSnapshotV2Version, _ as CompleteSnapshotIndex, a as CompleteSnapshotCollation, b as CompleteSnapshotNamespace, c as CompleteSnapshotConstraint, d as CompleteSnapshotDeferredObject, f as CompleteSnapshotDomain, g as CompleteSnapshotIdentity, h as CompleteSnapshotForeignKey, i as CompleteSnapshotCheckConstraint, j as CompleteSnapshotRoutine, k as CompleteSnapshotPolicy, l as CompleteSnapshotCreateResult, m as CompleteSnapshotExtension, n as CompleteSchemaSnapshotInput, o as CompleteSnapshotColumn, p as CompleteSnapshotEnum, r as CompleteSnapshotCapabilities, s as CompleteSnapshotComment, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult, v as CompleteSnapshotIndexTerm, w as CompleteSnapshotObjectReference, x as CompleteSnapshotObject, y as CompleteSnapshotKeyConstraint, z as SchemaSnapshotV2DecodeResult } from "./complete-types-CY0KbzNw.mjs";
|
|
3
|
+
import { A as assertSchemaSnapshot, B as decodeCompleteSchemaSnapshot, C as createSchemaSnapshot, D as serializeSchema, E as encodeSnapshot, F as assertCompleteSnapshot, G as encodeCompleteSnapshot, H as decodeSchemaSnapshotV2, I as assertSchemaSnapshotV2, J as SnapshotCanonicalError, K as encodeSchemaSnapshotV2, L as canonicalizeCompleteSchemaSnapshot, M as decodeSchemaSnapshot, N as CompleteSnapshotValidationError, O as tryCreateSchemaSnapshot, P as assertCompleteSchemaSnapshot, Q as toSnapshotJsonValue, R as canonicalizeSchemaSnapshotV2, S as SnapshotSerializationError, T as encodeSchemaSnapshot, U as digestCompleteSchemaSnapshot, V as decodeCompleteSnapshot, W as encodeCompleteSchemaSnapshot, X as encodeCanonicalSnapshot, Y as canonicalJson, Z as schemaSnapshotDigest, _ as postgresSchemaDialect, a as mysqlSnapshotDialect, b as tryCreatePostgresSchemaSnapshot, c as SqliteStorageAffinity, d as sqliteSnapshotAdapter, f as sqliteSnapshotDialect, g as createPostgresSchemaSnapshot, h as PostgresSnapshotOptions, i as mysqlSnapshotAdapter, j as canonicalizeSchemaSnapshot, k as SnapshotValidationError, l as createSqliteSchemaSnapshot, m as tryCreateSqliteSchemaSnapshot, n as createMysqlSchemaSnapshot, o as tryCreateMysqlSchemaSnapshot, p as sqliteStorageAffinity, q as schemaSnapshotV2Digest, r as mysqlSchemaDialect, s as SqliteSnapshotOptions, t as MysqlSnapshotOptions, u as sqliteSchemaDialect, v as postgresSnapshotAdapter, w as digestSchemaSnapshot, x as SchemaSnapshotOptions, y as postgresSnapshotDialect, z as completeSchemaSnapshotDigest } from "./index-DSX3IGM6.mjs";
|
|
4
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, CompleteSnapshotObjectReference, CompleteSnapshotOpaqueObject, CompleteSnapshotOwnership, CompleteSnapshotPartition, CompleteSnapshotPhysicalReference, CompleteSnapshotPolicy, CompleteSnapshotProvenance, CompleteSnapshotRoutine, CompleteSnapshotRoutineParameter, CompleteSnapshotSequence, CompleteSnapshotTable, CompleteSnapshotTrigger, CompleteSnapshotValidationError, CompleteSnapshotValueFact, CompleteSnapshotView, MysqlSnapshotOptions, type NativeColumnStorage, type PortableColumnStorage, PostgresSnapshotOptions, 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, SqliteSnapshotOptions, SqliteStorageAffinity, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV2, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV2, completeSchemaSnapshotDigest, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createMysqlSchemaSnapshot, createPostgresSchemaSnapshot, createSchemaDialect, createSchemaSnapshot, createSqliteSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV2, digestCompleteSchemaSnapshot, digestSchemaSnapshot, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV2, encodeSnapshot, mysqlSchemaDialect, mysqlSnapshotAdapter, mysqlSnapshotDialect, neutralSnapshotDialect, postgresSchemaDialect, postgresSnapshotAdapter, postgresSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotDigest, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV2Digest, schemaSnapshotV2Version, schemaSnapshotVersion, schemaSnapshotVersion2, serializeSchema, sqliteSchemaDialect, sqliteSnapshotAdapter, sqliteSnapshotDialect, sqliteStorageAffinity, toSnapshotJsonValue, tryCreateMysqlSchemaSnapshot, tryCreatePostgresSchemaSnapshot, tryCreateSchemaSnapshot, tryCreateSqliteSchemaSnapshot };
|
package/dist/snapshot.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
|
|
2
2
|
import { a as toSnapshotJsonValue, c as canonicalizeSchemaSnapshot, d as schemaSnapshotDialectVersion, f as schemaSnapshotFormat, i as schemaSnapshotDigest, l as decodeSchemaSnapshot, m as schemaSnapshotVersion, n as canonicalJson, o as SnapshotValidationError, p as schemaSnapshotNamingPolicyVersion, r as encodeCanonicalSnapshot, s as assertSchemaSnapshot, t as SnapshotCanonicalError, u as neutralSnapshotDialect } from "./canonical-BXUguqfo.mjs";
|
|
3
|
-
import { a as sqliteStorageAffinity, c as createSchemaSnapshot, d as encodeSnapshot, f as serializeSchema, i as sqliteSnapshotDialect, l as digestSchemaSnapshot, n as sqliteSchemaDialect, o as tryCreateSqliteSchemaSnapshot, p as tryCreateSchemaSnapshot, r as sqliteSnapshotAdapter, s as SnapshotSerializationError, t as createSqliteSchemaSnapshot, u as encodeSchemaSnapshot } from "./sqlite-
|
|
3
|
+
import { a as sqliteStorageAffinity, c as createSchemaSnapshot, d as encodeSnapshot, f as serializeSchema, i as sqliteSnapshotDialect, l as digestSchemaSnapshot, n as sqliteSchemaDialect, o as tryCreateSqliteSchemaSnapshot, p as tryCreateSchemaSnapshot, r as sqliteSnapshotAdapter, s as SnapshotSerializationError, t as createSqliteSchemaSnapshot, u as encodeSchemaSnapshot } from "./sqlite-mPVdrKrk.mjs";
|
|
4
4
|
import { _ as completeSchemaSnapshotVersion, a as canonicalizeCompleteSchemaSnapshot, b as schemaSnapshotVersion2, c as decodeCompleteSchemaSnapshot, d as digestCompleteSchemaSnapshot, f as encodeCompleteSchemaSnapshot, g as completeSchemaSnapshotFormat, h as schemaSnapshotV2Digest, i as assertSchemaSnapshotV2, l as decodeCompleteSnapshot, m as encodeSchemaSnapshotV2, n as assertCompleteSchemaSnapshot, o as canonicalizeSchemaSnapshotV2, p as encodeCompleteSnapshot, r as assertCompleteSnapshot, s as completeSchemaSnapshotDigest, t as CompleteSnapshotValidationError, u as decodeSchemaSnapshotV2, v as schemaSnapshotCompleteVersion, y as schemaSnapshotV2Version } from "./complete-WYyVozgK.mjs";
|
|
5
|
-
import { a as tryCreateMysqlSchemaSnapshot, c as postgresSnapshotAdapter, i as mysqlSnapshotDialect, l as postgresSnapshotDialect, n as mysqlSchemaDialect, o as createPostgresSchemaSnapshot, r as mysqlSnapshotAdapter, s as postgresSchemaDialect, t as createMysqlSchemaSnapshot, u as tryCreatePostgresSchemaSnapshot } from "./mysql-
|
|
5
|
+
import { a as tryCreateMysqlSchemaSnapshot, c as postgresSnapshotAdapter, i as mysqlSnapshotDialect, l as postgresSnapshotDialect, n as mysqlSchemaDialect, o as createPostgresSchemaSnapshot, r as mysqlSnapshotAdapter, s as postgresSchemaDialect, t as createMysqlSchemaSnapshot, u as tryCreatePostgresSchemaSnapshot } from "./mysql-DxFleLw4.mjs";
|
|
6
6
|
export { CompleteSnapshotValidationError, SnapshotCanonicalError, SnapshotSerializationError, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV2, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV2, completeSchemaSnapshotDigest, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createMysqlSchemaSnapshot, createPostgresSchemaSnapshot, createSchemaDialect, createSchemaSnapshot, createSqliteSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV2, digestCompleteSchemaSnapshot, digestSchemaSnapshot, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV2, encodeSnapshot, mysqlSchemaDialect, mysqlSnapshotAdapter, mysqlSnapshotDialect, neutralSnapshotDialect, postgresSchemaDialect, postgresSnapshotAdapter, postgresSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotDigest, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV2Digest, schemaSnapshotV2Version, schemaSnapshotVersion, schemaSnapshotVersion2, serializeSchema, sqliteSchemaDialect, sqliteSnapshotAdapter, sqliteSnapshotDialect, sqliteStorageAffinity, toSnapshotJsonValue, tryCreateMysqlSchemaSnapshot, tryCreatePostgresSchemaSnapshot, tryCreateSchemaSnapshot, tryCreateSqliteSchemaSnapshot };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as resolveSqlNames, t as createColumnReference, u as columnResultValue } from "./column-DmazTL67.mjs";
|
|
2
2
|
//#region src/schema/source.ts
|
|
3
3
|
const sourceIdentity = Symbol("qubu.source.identity");
|
|
4
4
|
function createSource(sourceKind, render, reference, constraints = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as standardDialect } from "./standard-DfcZEVOj.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as isUnsafeSchemaSql, m as validateConstraintDialect, n as defaultSchemaNamingPolicy, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-
|
|
2
|
+
import { F as isValidSchemaObjectName, P as generatedSchemaObjectName, r as isColumnReference } from "./column-DmazTL67.mjs";
|
|
3
|
+
import { _ as isUnsafeSchemaSql, m as validateConstraintDialect, n as defaultSchemaNamingPolicy, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-BGqa05et.mjs";
|
|
4
4
|
import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
|
|
5
5
|
import { a as toSnapshotJsonValue, f as schemaSnapshotFormat, i as schemaSnapshotDigest, o as SnapshotValidationError, r as encodeCanonicalSnapshot, s as assertSchemaSnapshot, u as neutralSnapshotDialect } from "./canonical-BXUguqfo.mjs";
|
|
6
6
|
import { sqliteDialect } from "./sqlite.mjs";
|
package/dist/sqlite.d.mts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import { V as Dialect, _n as doNothing, bn as onConflict, dn as ConflictAction, fn as ConflictTarget, gn as OnConflictClause, hn as ExcludedSource, mn as DoUpdateAction, pn as DoNothingAction, vn as doUpdate, yn as excluded } from "./types-
|
|
1
|
+
import { Io as ColumnDefinition, V as Dialect, _n as doNothing, ad as SqlTimestamp, bn as onConflict, dn as ConflictAction, fn as ConflictTarget, gn as OnConflictClause, hn as ExcludedSource, mn as DoUpdateAction, os as NativeColumnStorage, pn as DoNothingAction, vn as doUpdate, yn as excluded } from "./types-C0VkiwpR.mjs";
|
|
2
2
|
//#region src/dialects/sqlite.d.ts
|
|
3
|
-
|
|
3
|
+
/** Integer encoding used by SQLite timestamp columns. */
|
|
4
|
+
type SqliteTimestampMode = "timestamp" | "timestamp_ms";
|
|
5
|
+
/** Options for a SQLite integer timestamp. */
|
|
6
|
+
interface SqliteTimestampOptions {
|
|
7
|
+
/** Store Unix seconds by default, or milliseconds with `timestamp_ms`. */
|
|
8
|
+
readonly mode?: SqliteTimestampMode;
|
|
9
|
+
readonly nullable?: boolean;
|
|
10
|
+
readonly sqlName?: string;
|
|
11
|
+
/** Supply an application value when an insert omits this column. */
|
|
12
|
+
readonly defaultFn?: () => Date;
|
|
13
|
+
}
|
|
14
|
+
type SqliteTimestampNullable<TOptions extends SqliteTimestampOptions> = TOptions extends {
|
|
15
|
+
readonly nullable: true;
|
|
16
|
+
} ? true : false;
|
|
17
|
+
type SqliteTimestampHasRuntimeDefault<TOptions extends SqliteTimestampOptions> = TOptions extends {
|
|
18
|
+
readonly defaultFn: () => Date;
|
|
19
|
+
} ? true : false;
|
|
20
|
+
/** Qubu definition for a SQLite `INTEGER` timestamp exposed as a JavaScript `Date`. */
|
|
21
|
+
type SqliteTimestampColumn<TOptions extends SqliteTimestampOptions = {}> = ColumnDefinition<{
|
|
22
|
+
readonly output: Date;
|
|
23
|
+
readonly nullable: SqliteTimestampNullable<TOptions>;
|
|
24
|
+
readonly hasRuntimeDefault: SqliteTimestampHasRuntimeDefault<TOptions>;
|
|
25
|
+
readonly sqlType: SqlTimestamp;
|
|
26
|
+
readonly storage: NativeColumnStorage<"sqlite", "INTEGER">;
|
|
27
|
+
}>;
|
|
28
|
+
/** Declare a SQLite `INTEGER` timestamp with a live Date codec. */
|
|
29
|
+
declare function sqliteTimestamp<const TOptions extends SqliteTimestampOptions = {}>(options?: TOptions): SqliteTimestampColumn<TOptions>;
|
|
30
|
+
declare function sqliteDialect(): Dialect<"on-conflict" | "json">;
|
|
4
31
|
//#endregion
|
|
5
|
-
export { type ConflictAction, type ConflictTarget, type DoNothingAction, type DoUpdateAction, type ExcludedSource, type OnConflictClause, doNothing, doUpdate, excluded, onConflict, sqliteDialect };
|
|
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,33 @@
|
|
|
1
1
|
import { o as createDialect, r as sqliteJson } from "./json-Db7XRD91.mjs";
|
|
2
|
+
import { g as nativeStorage, h as nativeColumn } from "./column-DmazTL67.mjs";
|
|
2
3
|
import { r as sqliteExplain } from "./explain-CkIK13L_.mjs";
|
|
3
|
-
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-
|
|
4
|
+
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-jPsl9l0K.mjs";
|
|
4
5
|
//#region src/dialects/sqlite.ts
|
|
6
|
+
/** Declare a SQLite `INTEGER` timestamp with a live Date codec. */
|
|
7
|
+
function sqliteTimestamp(options) {
|
|
8
|
+
const mode = options?.mode ?? "timestamp";
|
|
9
|
+
const scale = mode === "timestamp" ? 1e3 : 1;
|
|
10
|
+
return nativeColumn(nativeStorage("sqlite", "INTEGER"), {
|
|
11
|
+
nullable: options?.nullable === true,
|
|
12
|
+
sqlName: options?.sqlName,
|
|
13
|
+
defaultFn: options?.defaultFn,
|
|
14
|
+
codec: {
|
|
15
|
+
toDriver(value) {
|
|
16
|
+
if (!(value instanceof Date) || Number.isNaN(value.getTime())) throw new TypeError("SQLite timestamps require a valid Date");
|
|
17
|
+
return mode === "timestamp" ? Math.floor(value.getTime() / scale) : value.getTime();
|
|
18
|
+
},
|
|
19
|
+
fromDriver(value) {
|
|
20
|
+
if (value instanceof Date) return value;
|
|
21
|
+
if (typeof value !== "number" && typeof value !== "bigint") throw new TypeError("SQLite timestamp results require a numeric value");
|
|
22
|
+
const timestamp = Number(value);
|
|
23
|
+
if (!Number.isFinite(timestamp) || !Number.isInteger(timestamp)) throw new TypeError("SQLite timestamp results require a finite integer");
|
|
24
|
+
const decoded = new Date(timestamp * scale);
|
|
25
|
+
if (Number.isNaN(decoded.getTime())) throw new TypeError("SQLite timestamp result is outside the valid Date range");
|
|
26
|
+
return decoded;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}).$type();
|
|
30
|
+
}
|
|
5
31
|
function renderSqliteSchemaLiteral(value) {
|
|
6
32
|
if (value === null) return "NULL";
|
|
7
33
|
if (typeof value === "boolean") return value ? "1" : "0";
|
|
@@ -45,4 +71,4 @@ function sqliteDialect() {
|
|
|
45
71
|
});
|
|
46
72
|
}
|
|
47
73
|
//#endregion
|
|
48
|
-
export { doNothing, doUpdate, excluded, onConflict, sqliteDialect };
|
|
74
|
+
export { doNothing, doUpdate, excluded, onConflict, sqliteDialect, sqliteTimestamp };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as exposeColumns, t as createSource } from "./source-
|
|
1
|
+
import { L as materializeSchemaObjectRecord, R as resolveSqlNames, Y as parenthesize, at as resultValueOf, i as identifier, rt as resultShapeValue, t as createColumnReference, u as columnResultValue } from "./column-DmazTL67.mjs";
|
|
2
|
+
import { r as exposeColumns, t as createSource } from "./source-C4Vmu5bb.mjs";
|
|
3
3
|
//#region src/schema/alias.ts
|
|
4
4
|
function alias(sourceOrQuery, name) {
|
|
5
5
|
const input = sourceOrQuery;
|