@vibeorm/sql 2.4.0 → 3.0.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/LICENSE +21 -0
- package/dist/ast.d.ts +334 -11
- package/dist/codecs.d.ts +48 -0
- package/dist/dialect.d.ts +44 -0
- package/dist/dialects/external-dependents.d.ts +28 -0
- package/dist/dialects/external-ownership.d.ts +8 -0
- package/dist/dialects/migration-shadow.d.ts +5 -0
- package/dist/dialects/postgres-index-keys.d.ts +10 -0
- package/dist/dialects/postgres-physical-catalog.d.ts +17 -0
- package/dist/dialects/sqlite-fts.d.ts +28 -0
- package/dist/exclusion.d.ts +2 -0
- package/dist/index-columns.d.ts +15 -0
- package/dist/index.d.ts +20 -5
- package/dist/index.js +1023 -273
- package/dist/index.js.map +28 -20
- package/dist/json-list-parameter.d.ts +37 -0
- package/dist/native-enum-parameter.d.ts +17 -0
- package/dist/pg-array.d.ts +13 -0
- package/dist/render.d.ts +11 -1
- package/package.json +5 -3
- package/dist/ast.d.ts.map +0 -1
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/codecs.d.ts.map +0 -1
- package/dist/composable.d.ts.map +0 -1
- package/dist/dialect.d.ts.map +0 -1
- package/dist/dialects/constraint-owned-index.d.ts.map +0 -1
- package/dist/dialects/diagnostics.d.ts.map +0 -1
- package/dist/dialects/migration-history.d.ts.map +0 -1
- package/dist/dialects/migration-inventory.d.ts.map +0 -1
- package/dist/dialects/migration-objects.d.ts.map +0 -1
- package/dist/dialects/migration-replay-coverage.d.ts.map +0 -1
- package/dist/dialects/migration-shadow.d.ts.map +0 -1
- package/dist/dialects/migration-visibility.d.ts.map +0 -1
- package/dist/dialects/module-dependency.d.ts.map +0 -1
- package/dist/dialects/mysql-check-probe.d.ts.map +0 -1
- package/dist/dialects/mysql.d.ts.map +0 -1
- package/dist/dialects/postgres-default-identity.d.ts.map +0 -1
- package/dist/dialects/postgres-diagnostics.d.ts.map +0 -1
- package/dist/dialects/postgres-migration.d.ts.map +0 -1
- package/dist/dialects/postgres-rls-readiness.d.ts.map +0 -1
- package/dist/dialects/postgres-rls.d.ts.map +0 -1
- package/dist/dialects/postgres-type-identity.d.ts.map +0 -1
- package/dist/dialects/postgres.d.ts.map +0 -1
- package/dist/dialects/registry.d.ts.map +0 -1
- package/dist/dialects/sqlite-constraints.d.ts.map +0 -1
- package/dist/dialects/sqlite-session.d.ts.map +0 -1
- package/dist/dialects/sqlite-table-definition.d.ts.map +0 -1
- package/dist/dialects/sqlite.d.ts.map +0 -1
- package/dist/exclusion.d.ts.map +0 -1
- package/dist/identifiers.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/json-transport.d.ts.map +0 -1
- package/dist/like.d.ts.map +0 -1
- package/dist/locks.d.ts.map +0 -1
- package/dist/module-journal.d.ts.map +0 -1
- package/dist/params.d.ts.map +0 -1
- package/dist/pg-array.d.ts.map +0 -1
- package/dist/predicate.d.ts.map +0 -1
- package/dist/render.d.ts.map +0 -1
- package/dist/result-decoder.d.ts.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QualifiedSqlName } from "@vibeorm/schema";
|
|
2
|
+
import type { SqlDialect } from "../dialect.ts";
|
|
3
|
+
import type { RenderedQuery } from "../render.ts";
|
|
4
|
+
/** Physical operands and unambiguous server-default evidence for actual type/access-method pairs. */
|
|
5
|
+
export declare function renderPostgresIndexKeys(params: {
|
|
6
|
+
dialect: SqlDialect;
|
|
7
|
+
table?: QualifiedSqlName;
|
|
8
|
+
namespaces?: readonly string[];
|
|
9
|
+
}): RenderedQuery;
|
|
10
|
+
//# sourceMappingURL=postgres-index-keys.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SqlDialect } from "../dialect.ts";
|
|
2
|
+
import type { RenderedQuery } from "../render.ts";
|
|
3
|
+
/** Physical schema queries; callers name each namespace without changing search_path. */
|
|
4
|
+
export type PostgresPhysicalCatalogQuery = "tables" | "views" | "columns" | "constraints" | "checks" | "foreignKeys" | "enums" | "indexes";
|
|
5
|
+
/**
|
|
6
|
+
* Read namespace-qualified physical metadata, preserving catalog type and index identities.
|
|
7
|
+
* Extension members (`pg_depend.deptype = 'e'`) are left out of `tables`, `views` and `enums`:
|
|
8
|
+
* the extension's own script owns them, so no plan may create or drop them. The other reads hang
|
|
9
|
+
* off a table and reach the schema only through the filtered table list; PostgreSQL never records
|
|
10
|
+
* an index or a constraint as an extension member on its own.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderPostgresPhysicalCatalog(params: {
|
|
13
|
+
dialect: SqlDialect;
|
|
14
|
+
namespace: string;
|
|
15
|
+
query: PostgresPhysicalCatalogQuery;
|
|
16
|
+
}): RenderedQuery;
|
|
17
|
+
//# sourceMappingURL=postgres-physical-catalog.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** @internal SQLite FTS synchronization SQL and its independently verifiable catalog spelling. */
|
|
2
|
+
export declare function renderSqliteFtsUpdateTrigger(params: {
|
|
3
|
+
table: string;
|
|
4
|
+
ftsTable: string;
|
|
5
|
+
columns: readonly string[];
|
|
6
|
+
}): {
|
|
7
|
+
readonly create: string;
|
|
8
|
+
readonly definition: string;
|
|
9
|
+
};
|
|
10
|
+
/** @internal Recognize only complete generated legacy/current triggers and their external-content FTS5 table. */
|
|
11
|
+
export declare function sqliteFtsUpdateUpgrade(params: {
|
|
12
|
+
create: string;
|
|
13
|
+
installed: string;
|
|
14
|
+
table: string;
|
|
15
|
+
name: string;
|
|
16
|
+
tableDefinition?: string;
|
|
17
|
+
}): undefined | {
|
|
18
|
+
readonly kind: "tableRequired";
|
|
19
|
+
readonly ftsTable: string;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "recognized";
|
|
22
|
+
readonly ftsTable: string;
|
|
23
|
+
readonly legacyDefinition: string;
|
|
24
|
+
readonly currentDefinition: string;
|
|
25
|
+
readonly drop: string;
|
|
26
|
+
readonly installed: "legacy" | "current";
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=sqlite-fts.d.ts.map
|
package/dist/exclusion.d.ts
CHANGED
|
@@ -21,11 +21,13 @@ export declare function renderExclusionDdl(params: {
|
|
|
21
21
|
export declare function renderExclusionCatalog(params: {
|
|
22
22
|
dialect: SqlDialect;
|
|
23
23
|
probe?: string;
|
|
24
|
+
namespace?: string;
|
|
24
25
|
}): string;
|
|
25
26
|
/** Empty private clone for server normalization; no existing row is scanned or changed. */
|
|
26
27
|
export declare function renderExclusionProbe(params: {
|
|
27
28
|
dialect: SqlDialect;
|
|
28
29
|
table: string;
|
|
30
|
+
namespace?: string;
|
|
29
31
|
probe: string;
|
|
30
32
|
definition: string;
|
|
31
33
|
}): string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QualifiedSqlName } from "@vibeorm/schema";
|
|
2
|
+
import type { SqlDialect } from "./dialect.ts";
|
|
3
|
+
/** One physical migration index key, with an optional qualified PostgreSQL operator class. */
|
|
4
|
+
export type IndexColumnOperand = {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly desc?: boolean;
|
|
7
|
+
readonly operatorClass?: QualifiedSqlName;
|
|
8
|
+
};
|
|
9
|
+
/** Render safe column operands; operator classes are a non-unique PostgreSQL capability. */
|
|
10
|
+
export declare function renderIndexColumns(params: {
|
|
11
|
+
dialect: SqlDialect;
|
|
12
|
+
columns: readonly IndexColumnOperand[];
|
|
13
|
+
unique: boolean;
|
|
14
|
+
}): string[];
|
|
15
|
+
//# sourceMappingURL=index-columns.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
export { nativeEnumArrayParameter, isNativeEnumArrayParameter } from "./native-enum-parameter.ts";
|
|
2
|
+
export type { NativeEnumArrayParameter } from "./native-enum-parameter.ts";
|
|
3
|
+
export { isJsonListParameter, jsonListParameter } from "./json-list-parameter.ts";
|
|
4
|
+
export type { JsonListParameter, JsonListStorage } from "./json-list-parameter.ts";
|
|
5
|
+
export { renderExternalOwnershipCatalog } from "./dialects/external-ownership.ts";
|
|
6
|
+
export { renderExternalDependents } from "./dialects/external-dependents.ts";
|
|
7
|
+
export type { ExternalDependentTarget } from "./dialects/external-dependents.ts";
|
|
8
|
+
export { renderPostgresPhysicalCatalog } from "./dialects/postgres-physical-catalog.ts";
|
|
9
|
+
export type { PostgresPhysicalCatalogQuery } from "./dialects/postgres-physical-catalog.ts";
|
|
10
|
+
export { renderPostgresIndexKeys } from "./dialects/postgres-index-keys.ts";
|
|
11
|
+
export { renderIndexColumns } from "./index-columns.ts";
|
|
12
|
+
export type { IndexColumnOperand } from "./index-columns.ts";
|
|
1
13
|
export { renderModuleDependencyQuery } from "./dialects/module-dependency.ts";
|
|
2
14
|
export type { ModuleDependencyOperation } from "./dialects/module-dependency.ts";
|
|
3
15
|
export { renderReplayCoverageGaps } from "./dialects/migration-replay-coverage.ts";
|
|
4
16
|
export { SHADOW_DATABASE, SHADOW_CAPABILITIES, renderShadowOperation } from "./dialects/migration-shadow.ts";
|
|
5
17
|
export type { ShadowOperation } from "./dialects/migration-shadow.ts";
|
|
6
18
|
export { MODULE_JOURNAL_COLUMN, renderModuleJournal } from "./module-journal.ts";
|
|
19
|
+
export { renderSqliteFtsUpdateTrigger, sqliteFtsUpdateUpgrade } from "./dialects/sqlite-fts.ts";
|
|
7
20
|
export { SQLITE_SESSION_SQL } from "./dialects/sqlite-session.ts";
|
|
8
21
|
export { sql, isSqlFragment, renderSqlFragment, compileSql, sqlUsesIncoming, mapConflictColumns } from "./composable.ts";
|
|
9
22
|
export type { SqlFragment, SqlTag } from "./composable.ts";
|
|
@@ -16,8 +29,8 @@ export type { ResultDecoder, Decoded, ExtendedDateTime } from "./result-decoder.
|
|
|
16
29
|
* lives in this package; see the root sql-catalog.md for the reviewable surface.
|
|
17
30
|
*/
|
|
18
31
|
export { compileExclusion, renderExclusionSetup, renderExclusionDdl, renderExclusionCatalog, renderExclusionProbe } from "./exclusion.ts";
|
|
19
|
-
export type { AdvisoryLockKey, AdvisoryLockStatement, AggFn, AggRef, AggSelect, ColRef, ComparisonOp, DeleteStatement, ExcludedRef, InnerJoin, InsertStatement, JsonFilterOp, LateralJoin, ListSetOperation, OnConflictClause, OnConflictDoNothing, OnConflictUpdate, OrderByAggregate, OrderByColumn, OrderBySubquery, OrderTerm, RowLock, RowNumberProjection, DbNowMarker, JsonParamCell, SelectExpr, SelectStatement, SetOperation, SetOperator, SqlExpr, SqlStatement, TableRef, UpdateStatement, } from "./ast.ts";
|
|
20
|
-
export { ADVISORY_LOCK_RESULT_COLUMN, SQL_DEFAULT_CELL, dbNowMarker, excludedRef, isDbNowMarker, isExcludedRef, isJsonParamCell, isListSetOperation, isSetOperation, isSqlDefaultCell, jsonParamCell, } from "./ast.ts";
|
|
32
|
+
export type { AdvisoryLockKey, AdvisoryLockStatement, AggFn, AggRef, AggSelect, ChainResult, ChainRowSource, ChainStatement, ChainStep, ChainStepStatement, ChainTally, ChainVeto, ColRef, ComparisonOp, CountSubquery, DeleteStatement, ExcludedRef, InnerJoin, KeyTableJoin, KeyTableMember, InsertSelectStatement, InsertStatement, ReturningColumn, JsonFilterOp, LateralJoin, ListSetOperation, OnConflictClause, OnConflictDoNothing, OnConflictUpdate, OrderByAggregate, OrderByColumn, OrderBySubquery, OrderTerm, RowLock, RowNumberProjection, DbNowMarker, JsonParamCell, SelectExpr, SelectStatement, SetOperation, SetOperator, SqlExpr, SqlStatement, StepColumnRef, TableRef, UpdateStatement, } from "./ast.ts";
|
|
33
|
+
export { ADVISORY_LOCK_RESULT_COLUMN, CHAIN_VETO_PREFIX, CHAIN_VETO_TOKEN_PATTERN, SQL_DEFAULT_CELL, chainVetoToken, dbNowMarker, excludedRef, isDbNowMarker, isExcludedRef, isJsonParamCell, isListSetOperation, isSetOperation, isSqlDefaultCell, isStepColumnRef, jsonParamCell, returningColumnName, stepColumnRef, } from "./ast.ts";
|
|
21
34
|
export type { AdvisoryLockFunctions, AdvisoryLockModeFunctions, RowLockSyntax, SqlDialect, } from "./dialect.ts";
|
|
22
35
|
export { ADVISORY_KEY_BOUNDS, describeRowLock, renderAdvisoryLock, renderRowLockClause } from "./locks.ts";
|
|
23
36
|
export { JSON_TRANSPORT, projectionOutputName } from "./json-transport.ts";
|
|
@@ -25,12 +38,13 @@ export { postgresDialect } from "./dialects/postgres.ts";
|
|
|
25
38
|
export { sqliteDialect } from "./dialects/sqlite.ts";
|
|
26
39
|
export { mysqlDialect } from "./dialects/mysql.ts";
|
|
27
40
|
export { SQL_DIALECTS, getSqlDialect } from "./dialects/registry.ts";
|
|
41
|
+
export { tableDefinitionParts } from "./dialects/sqlite-table-definition.ts";
|
|
28
42
|
export { renderPredicate } from "./predicate.ts";
|
|
29
43
|
export type { PredicateModel, PredicateUsage } from "./predicate.ts";
|
|
30
44
|
export { DIALECT_CAPABILITIES, MYSQL_CAPABILITIES, POSTGRES_CAPABILITIES, SQLITE_CAPABILITIES, } from "./capabilities.ts";
|
|
31
|
-
export { DIALECT_CODECS, MYSQL_CODECS, POSTGRES_CODECS, SQLITE_CODECS, decodeIsNoop, enumMembershipCodec, parseDateTimeText, } from "./codecs.ts";
|
|
45
|
+
export { DIALECT_CODECS, MYSQL_CODECS, POSTGRES_CODECS, SQLITE_CODECS, decodeIsNoop, enumMembershipCodec, float32Codec, parseDateTimeText, postgresArrayElementFromText, shortestFloat32, timeOfDayCodec, } from "./codecs.ts";
|
|
32
46
|
export type { CodecTable, ScalarCodec, WireFidelity } from "./codecs.ts";
|
|
33
|
-
export { renderExpr, renderFragment, renderStatement } from "./render.ts";
|
|
47
|
+
export { renderExpr, renderFragment, renderProjection, renderStatement } from "./render.ts";
|
|
34
48
|
export type { RenderedQuery } from "./render.ts";
|
|
35
49
|
export { ParamCollector } from "./params.ts";
|
|
36
50
|
export { NATIVE_RLS, renderRlsColumnType, renderRlsContext, renderRlsDisable, renderRlsDropPolicy, renderRlsEnable, renderRlsForce, renderRlsNoForce, renderRlsPolicy, renderRlsPredicate, renderRlsRole } from "./dialects/postgres-rls.ts";
|
|
@@ -58,5 +72,6 @@ export { POSTGRES_DIAGNOSTIC_SQL, POSTGRES_WORKLOAD_LIMITS, renderPostgresExplai
|
|
|
58
72
|
export type { PostgresExplainOptions, PostgresWorkloadQuery } from "./dialects/postgres-diagnostics.ts";
|
|
59
73
|
export { renderColumnStateQuery, renderConstraintStateQuery, renderIndexStateQuery, renderMigrationSessionRead, renderMigrationSessionRestore, renderMigrationSessionSet, renderRelationStateQuery, } from "./dialects/postgres-migration.ts";
|
|
60
74
|
export type { MigrationSessionSetting } from "./dialects/postgres-migration.ts";
|
|
61
|
-
export { parsePgArrayLiteral, toPgArrayLiteral } from "./pg-array.ts";
|
|
75
|
+
export { parsePgArrayLiteral, parsePgArrayLiteralNested, toPgArrayLiteral } from "./pg-array.ts";
|
|
76
|
+
export type { PgArrayLiteralElement } from "./pg-array.ts";
|
|
62
77
|
//# sourceMappingURL=index.d.ts.map
|