@dbsp/core 6.3.0 → 7.1.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/{assertion-functions-dyf-Q__5.d.ts → assertion-functions-D777KMxU.d.ts} +146 -66
- package/dist/{chunk-5UI5IH5U.js → chunk-M6BTWAHC.js} +13802 -13445
- package/dist/chunk-M6BTWAHC.js.map +1 -0
- package/dist/index.d.ts +25 -20
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-5UI5IH5U.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { ModelIR, ObservationContext, TransitionLessor, ApplyPolicy, ApplyResult
|
|
|
3
3
|
export { Adapter, AdapterLogger, AlterColumnOptions, AmbiguousIncludeError, Assumption, BaseAdapter, Cardinality, ColumnIR, ColumnType, CompileOptions, CompiledQuery, CompilingAdapter, CreateIndexOptions, DbCasing, DialectCapabilities, DropIndexOptions, Dump, ExecutingAdapter, IncludeStrategy, IndexColumnDef, IndexIR, IndexInfo, IndexMethod, IntrospectingAdapter, ModelIR, NotYetSupportedError, Optionality, PlanDecision, PlanOptions, PlanReport, PlanWarning, ProvenPlanStep, RangeValue, RawSqlAdapter, StreamingAdapter, TableIR, TransactionalAdapter, TruncateOptions, VacuumOptions } from '@dbsp/types';
|
|
4
4
|
import { IncludeIntent, SelectIntent, WhereIntent, AggregateIntent, OrderByIntent, JoinIntent, QueryIntent, WhereRangeIntent } from '@dbsp/types/internal';
|
|
5
5
|
export { AggregateExpressionIntent, AggregateIntent, ExpressionIntent, IncludeIntent, InsertFromIntent, InsertIntent, JoinIntent, MutationIntent, OrderByIntent, QueryIntent, RecursiveIntent, SelectAggregateIntent, SelectFieldsIntent, SelectIntent, SelectWithExpressionsIntent, SubqueryRefIntent, UpsertFromIntent, WhereAndIntent, WhereComparisonIntent, WhereInIntent, WhereIntent, WhereLikeIntent, WhereNotIntent, WhereNullIntent, WhereOrIntent, WhereRangeIntent, WindowIntent, isDeleteIntent, isInsertIntent, isUpdateIntent, isUpsertIntent } from '@dbsp/types/internal';
|
|
6
|
-
import { P as PackRegistry, T as TransitionRunPersister, R as RecursiveIncludeOptions, D as DefaultFilters, H as HookStore, a as HookErrorHandler, O as ObserverErrorHandler, Q as QueryBuilder, b as RelationHints, I as IncludeOptionsWithRecursive, A as AliasedExprColumn, C as ColumnSpec, c as AggregateOptions, d as
|
|
7
|
-
export {
|
|
6
|
+
import { P as PackRegistry, T as TransitionRunPersister, R as RecursiveIncludeOptions, D as DefaultFilters, H as HookStore, a as HookErrorHandler, O as ObserverErrorHandler, Q as QueryBuilder, b as RelationHints, I as IncludeOptionsWithRecursive, A as AliasedExprColumn, C as ColumnSpec, c as AggregateOptions, d as ColumnRef, e as DistinctField, f as OrderByLeaf, g as OrderByRecord, h as OrderBySpec, N as NullsPosition, i as PredicateRef, W as WhereFilter, B as BatchValuesRef, j as DumpMetaInput, S as StreamOptions, k as PaginateOptions, l as PaginatedResult, m as CursorPaginateOptions, n as CursorPaginatedResult, o as SetOperationBuilder, p as TableRef, q as InsertBuilder, U as UpdateBuilder, r as DeleteBuilder, s as UpsertBuilder, t as InferTableRow, L as ListHierarchyOptions, u as NqlTag, v as BatchValuesOptions, E as ExpressionSpec, w as Schema, x as SchemaDefinition, y as InferDB, z as ReferenceLeaf, F as ExpressionRef, G as PredicateExpressionRef, J as AssertionBlock, K as AssertionQueryResult, M as AssertionSummary, V as HookManager } from './assertion-functions-D777KMxU.js';
|
|
7
|
+
export { X as AfterMutationHook, Y as AfterMutationObserver, Z as AfterQueryHook, _ as AfterQueryObserver, $ as AmbiguousPlanError, a0 as Assertion, a1 as AssertionOutcome, a2 as BeforeMutationHook, a3 as BeforeQueryHook, a4 as ColumnDef, a5 as IncludeOptions, a6 as IntentSummary, a7 as JsonValue, a8 as ManyToManyDefinition, a9 as ManyToManyOptions, aa as MutationDump, ab as MutationHookContext, ac as NqlBuilder, ad as OnErrorHook, ae as POSTGRESQL_CAPABILITIES, af as ParseError, ag as ParseResult, ah as QueryAssertionResult, ai as QueryHookContext, aj as RefOptions, ak as RelationRef, al as SchemaColumnType, am as SchemaIndexOptions, an as SchemaOptions, ao as SchemaTableOptions, ap as SelfRefRoles, aq as SqlRawExpression, ar as SubqueryBuilder, as as SubqueryExpression, at as TABLE_META, au as TableDef, av as admitRecordedIdentity, aw as aggOrderBy, ax as and, ay as any, az as array, aA as arrayAgg, aB as assertEquals, aC as assertParamsEquals, aD as assertParamsType, aE as assertSQLEquals, aF as batchValues, aG as boolFn, aH as cast, aI as coalesce, aJ as col, aK as createHookManager, aL as distinct, aM as eq, aN as every, aO as exists, aP as exprRef, aQ as extractPseudoColumnKeywords, aR as fn, aS as getSchemaFromDb, aT as gt, aU as gte, aV as inArray, aW as inSubquery, aX as isBatchValuesRef, aY as isDistinctFrom, aZ as isNotNull, a_ as isNull, a$ as isOperationRuntime, b0 as isRef, b1 as isSqlRaw, b2 as like, b3 as literal, b4 as lt, b5 as lte, b6 as manyToMany, b7 as namedArg, b8 as neq, b9 as none, ba as not, bb as notExists, bc as nqlRaw, bd as op, be as or, bf as outerRef, bg as param, bh as parseAssertionFile, bi as plan, bj as planRecursive, bk as raw, bl as rawExists, bm as ref, bn as relationColumn, bo as schema, bp as some, bq as sql, br as star, bs as subquery, bt as unary, bu as unsafeAsPredicate, bv as validateAssertionBlocks } from './assertion-functions-D777KMxU.js';
|
|
8
8
|
import '@dbsp/nql';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -171,12 +171,12 @@ declare class QueryBuilderImpl<TResult = unknown> implements QueryBuilder<TResul
|
|
|
171
171
|
coalesce<K extends keyof TResult & string, Alias extends string>(fields: readonly K[], as: Alias): QueryBuilder<TResult & {
|
|
172
172
|
[P in Alias]: NonNullable<TResult[K]>;
|
|
173
173
|
}>;
|
|
174
|
-
count(fieldOrOptions?: AggregateOptions | string | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
175
|
-
sum(field: string | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
176
|
-
avg(field: string | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
177
|
-
min(field: string, as?: string): QueryBuilder<TResult>;
|
|
178
|
-
max(field: string, as?: string): QueryBuilder<TResult>;
|
|
179
|
-
groupBy(fields: readonly string[]): QueryBuilder<TResult>;
|
|
174
|
+
count(fieldOrOptions?: AggregateOptions | string | ColumnRef<string, string, unknown> | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
175
|
+
sum(field: string | ColumnRef<string, string, unknown> | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
176
|
+
avg(field: string | ColumnRef<string, string, unknown> | DistinctField, as?: string): QueryBuilder<TResult>;
|
|
177
|
+
min(field: string | ColumnRef<string, string, unknown>, as?: string): QueryBuilder<TResult>;
|
|
178
|
+
max(field: string | ColumnRef<string, string, unknown>, as?: string): QueryBuilder<TResult>;
|
|
179
|
+
groupBy(fields: readonly (string | ColumnRef<string, string, unknown>)[]): QueryBuilder<TResult>;
|
|
180
180
|
having(condition: WhereIntent): QueryBuilder<TResult>;
|
|
181
181
|
distinct(): QueryBuilder<TResult>;
|
|
182
182
|
/**
|
|
@@ -194,7 +194,7 @@ declare class QueryBuilderImpl<TResult = unknown> implements QueryBuilder<TResul
|
|
|
194
194
|
* // SQL: SELECT DISTINCT ON ("user_id", "action") * FROM "logs"
|
|
195
195
|
* ```
|
|
196
196
|
*/
|
|
197
|
-
distinctOn(...columns: string[]): QueryBuilder<TResult>;
|
|
197
|
+
distinctOn(...columns: (string | ColumnRef<string, string, unknown>)[]): QueryBuilder<TResult>;
|
|
198
198
|
forUpdate(): QueryBuilder<TResult>;
|
|
199
199
|
forShare(): QueryBuilder<TResult>;
|
|
200
200
|
forNoKeyUpdate(): QueryBuilder<TResult>;
|
|
@@ -202,7 +202,7 @@ declare class QueryBuilderImpl<TResult = unknown> implements QueryBuilder<TResul
|
|
|
202
202
|
lock(strength: _dbsp_types.LockStrength, waitPolicy?: _dbsp_types.LockWaitPolicy): QueryBuilder<TResult>;
|
|
203
203
|
skipLocked(): QueryBuilder<TResult>;
|
|
204
204
|
noWait(): QueryBuilder<TResult>;
|
|
205
|
-
orderBy(fieldOrRecordOrSpecs:
|
|
205
|
+
orderBy(fieldOrRecordOrSpecs: OrderByLeaf | OrderByRecord | readonly OrderBySpec[], direction?: SortDirection, options?: {
|
|
206
206
|
nulls?: NullsPosition;
|
|
207
207
|
}): QueryBuilder<TResult>;
|
|
208
208
|
limit(count: number): QueryBuilder<TResult>;
|
|
@@ -514,7 +514,7 @@ declare class RawCteQueryBuilder<TResult = unknown> {
|
|
|
514
514
|
*/
|
|
515
515
|
columns(cols: readonly string[]): this;
|
|
516
516
|
/**
|
|
517
|
-
* Filter the outer query result.
|
|
517
|
+
* Filter the outer query result. Successive calls are combined with AND.
|
|
518
518
|
*/
|
|
519
519
|
where(condition: WhereIntent$1): this;
|
|
520
520
|
/**
|
|
@@ -1219,7 +1219,7 @@ declare function denseRank(): WindowBuilder;
|
|
|
1219
1219
|
* wSum('amount').partitionBy('user_id').orderBy('date').as('running_total')
|
|
1220
1220
|
* // → SUM("amount") OVER (PARTITION BY "user_id" ORDER BY "date" ASC) AS "running_total"
|
|
1221
1221
|
*/
|
|
1222
|
-
declare function wSum(field: string): WindowBuilder;
|
|
1222
|
+
declare function wSum(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1223
1223
|
/**
|
|
1224
1224
|
* AVG window function: running/cumulative average
|
|
1225
1225
|
*
|
|
@@ -1229,7 +1229,7 @@ declare function wSum(field: string): WindowBuilder;
|
|
|
1229
1229
|
* wAvg('price').partitionBy('category').as('avg_price')
|
|
1230
1230
|
* // → AVG("price") OVER (PARTITION BY "category") AS "avg_price"
|
|
1231
1231
|
*/
|
|
1232
|
-
declare function wAvg(field: string): WindowBuilder;
|
|
1232
|
+
declare function wAvg(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1233
1233
|
/**
|
|
1234
1234
|
* COUNT window function: count within partition.
|
|
1235
1235
|
* When called with no argument, produces COUNT(*) OVER (...).
|
|
@@ -1244,7 +1244,7 @@ declare function wAvg(field: string): WindowBuilder;
|
|
|
1244
1244
|
* wCount('id').partitionBy('category').as('items_in_category')
|
|
1245
1245
|
* // → COUNT("id") OVER (PARTITION BY "category") AS "items_in_category"
|
|
1246
1246
|
*/
|
|
1247
|
-
declare function wCount(field?: string): WindowBuilder;
|
|
1247
|
+
declare function wCount(field?: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1248
1248
|
/**
|
|
1249
1249
|
* MIN window function: minimum value within partition
|
|
1250
1250
|
*
|
|
@@ -1254,7 +1254,7 @@ declare function wCount(field?: string): WindowBuilder;
|
|
|
1254
1254
|
* wMin('price').partitionBy('category').as('min_price')
|
|
1255
1255
|
* // → MIN("price") OVER (PARTITION BY "category") AS "min_price"
|
|
1256
1256
|
*/
|
|
1257
|
-
declare function wMin(field: string): WindowBuilder;
|
|
1257
|
+
declare function wMin(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1258
1258
|
/**
|
|
1259
1259
|
* MAX window function: maximum value within partition
|
|
1260
1260
|
*
|
|
@@ -1264,7 +1264,7 @@ declare function wMin(field: string): WindowBuilder;
|
|
|
1264
1264
|
* wMax('price').partitionBy('category').as('max_price')
|
|
1265
1265
|
* // → MAX("price") OVER (PARTITION BY "category") AS "max_price"
|
|
1266
1266
|
*/
|
|
1267
|
-
declare function wMax(field: string): WindowBuilder;
|
|
1267
|
+
declare function wMax(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1268
1268
|
/**
|
|
1269
1269
|
* LAG window function: access previous row value
|
|
1270
1270
|
*
|
|
@@ -1274,7 +1274,7 @@ declare function wMax(field: string): WindowBuilder;
|
|
|
1274
1274
|
* lag('amount').orderBy('date').as('prev_amount')
|
|
1275
1275
|
* // → LAG("amount") OVER (ORDER BY "date" ASC) AS "prev_amount"
|
|
1276
1276
|
*/
|
|
1277
|
-
declare function lag(field: string): WindowBuilder;
|
|
1277
|
+
declare function lag(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1278
1278
|
/**
|
|
1279
1279
|
* LEAD window function: access next row value
|
|
1280
1280
|
*
|
|
@@ -1284,9 +1284,14 @@ declare function lag(field: string): WindowBuilder;
|
|
|
1284
1284
|
* lead('amount').orderBy('date').as('next_amount')
|
|
1285
1285
|
* // → LEAD("amount") OVER (ORDER BY "date" ASC) AS "next_amount"
|
|
1286
1286
|
*/
|
|
1287
|
-
declare function lead(field: string): WindowBuilder;
|
|
1287
|
+
declare function lead(field: string | ColumnRef<string, string, unknown>): WindowBuilder;
|
|
1288
1288
|
|
|
1289
|
-
|
|
1289
|
+
/**
|
|
1290
|
+
* A CASE result: a reference leaf (a string is a column, a finite number or
|
|
1291
|
+
* boolean is inlined, an array or `Date` is bound, an expression is used as
|
|
1292
|
+
* is), or `null` for SQL `NULL`.
|
|
1293
|
+
*/
|
|
1294
|
+
type CaseValue = ReferenceLeaf | null;
|
|
1290
1295
|
declare class CaseBuilder {
|
|
1291
1296
|
private readonly branches;
|
|
1292
1297
|
constructor(branches: ReadonlyArray<{
|
|
@@ -2314,4 +2319,4 @@ declare class InvalidJsonAggPayloadError extends Error {
|
|
|
2314
2319
|
constructor(path: string, cause: unknown);
|
|
2315
2320
|
}
|
|
2316
2321
|
|
|
2317
|
-
export { AggregateOptions, AmbiguousRelationError, AssertionQueryResult, AssertionSummary, BatchValuesOptions, BatchValuesRef, CaseBuilder, type CaseValue, ColumnNotFoundError, ColumnRef, ColumnSpec, CteBuilder, CteQueryBuilder, CursorPaginateOptions, CursorPaginatedResult, DeleteBuilder, DistinctField, ErrorCode, Errors, ExecutionError, ExpressionRef, ExpressionSpec, type FullTextSearchField, HookManager, IRREGULAR_PLURALS, InferTableRow, InsertBuilder, InvalidJsonAggPayloadError, InvalidOperationError, type Logger, ModelIRImpl, NotFoundError, NqlTag, type OrmInstance, type OrmOf, PaginateOptions, PaginatedResult, PredicateExpressionRef, PredicateRef, QueryBuilder, type RangeType, RawCteQueryBuilder, type RecursiveOptions, RelationHints, RelationNotFoundError, ResultHydrator, Schema, SchemaDefinition, SetOperationBuilder, StreamOptions, type TableDDL, type TableIndexes, TableNotFoundError, TableRef, UnsafeOperationError, UpdateBuilder, UpsertBuilder, type WarningCategory, caseWhen, createOrm, createRawCteBuilder, createStagedTransitionOrchestrator, denseRank, emitWarning, fullTextSearch, getLogger, lag, lead, normalizeSQL, pluralize, rangeContainedBy, rangeContains, rangeOverlaps, rank, resetLogger, rowNumber, runAssertions, setLogger, silentLogger, singularize, textScore, wAvg, wCount, wMax, wMin, wSum };
|
|
2322
|
+
export { AggregateOptions, AmbiguousRelationError, AssertionQueryResult, AssertionSummary, BatchValuesOptions, BatchValuesRef, CaseBuilder, type CaseValue, ColumnNotFoundError, ColumnRef, ColumnSpec, CteBuilder, CteQueryBuilder, CursorPaginateOptions, CursorPaginatedResult, DeleteBuilder, DistinctField, ErrorCode, Errors, ExecutionError, ExpressionRef, ExpressionSpec, type FullTextSearchField, HookManager, IRREGULAR_PLURALS, InferTableRow, InsertBuilder, InvalidJsonAggPayloadError, InvalidOperationError, type Logger, ModelIRImpl, NotFoundError, NqlTag, type OrmInstance, type OrmOf, PaginateOptions, PaginatedResult, PredicateExpressionRef, PredicateRef, QueryBuilder, type RangeType, RawCteQueryBuilder, type RecursiveOptions, ReferenceLeaf, RelationHints, RelationNotFoundError, ResultHydrator, Schema, SchemaDefinition, SetOperationBuilder, StreamOptions, type TableDDL, type TableIndexes, TableNotFoundError, TableRef, UnsafeOperationError, UpdateBuilder, UpsertBuilder, type WarningCategory, caseWhen, createOrm, createRawCteBuilder, createStagedTransitionOrchestrator, denseRank, emitWarning, fullTextSearch, getLogger, lag, lead, normalizeSQL, pluralize, rangeContainedBy, rangeContains, rangeOverlaps, rank, resetLogger, rowNumber, runAssertions, setLogger, silentLogger, singularize, textScore, wAvg, wCount, wMax, wMin, wSum };
|
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
wMax,
|
|
122
122
|
wMin,
|
|
123
123
|
wSum
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-M6BTWAHC.js";
|
|
125
125
|
|
|
126
126
|
// src/index.ts
|
|
127
127
|
import { AmbiguousIncludeError, NotYetSupportedError } from "@dbsp/types";
|
|
@@ -186,7 +186,7 @@ export {
|
|
|
186
186
|
eq,
|
|
187
187
|
every,
|
|
188
188
|
exists,
|
|
189
|
-
|
|
189
|
+
ref as exprRef,
|
|
190
190
|
extractPseudoColumnKeywords,
|
|
191
191
|
fn,
|
|
192
192
|
fullTextSearch,
|
|
@@ -235,7 +235,7 @@ export {
|
|
|
235
235
|
rank,
|
|
236
236
|
raw,
|
|
237
237
|
rawExists,
|
|
238
|
-
ref,
|
|
238
|
+
ref2 as ref,
|
|
239
239
|
relationColumn,
|
|
240
240
|
resetLogger,
|
|
241
241
|
rowNumber,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @dbsp/core\n * Schema definition and query planning for db-semantic-planner.\n */\n\n// ============================================================================\n// ModelIR Types\n// ============================================================================\n\nexport type {\n\tCardinality,\n\tColumnIR,\n\tColumnType,\n\tIncludeStrategy,\n\tIndexIR,\n\tModelIR,\n\tOptionality,\n\tTableIR,\n} from './model-ir.js';\n\n// CLI-NQL: Relation kind helpers and pseudo-column factory\n\n// ============================================================================\n// IntentAST Types\n// ============================================================================\n\nexport type {\n\tAggregateExpressionIntent,\n\tAggregateIntent,\n\tExpressionIntent,\n\tIncludeIntent,\n\tInsertFromIntent,\n\tInsertIntent,\n\tJoinIntent,\n\tMutationIntent,\n\tOrderByIntent,\n\tQueryIntent,\n\tRecursiveIntent,\n\tSelectAggregateIntent,\n\tSelectFieldsIntent,\n\tSelectIntent,\n\tSelectWithExpressionsIntent,\n\tSubqueryRefIntent,\n\tUpsertFromIntent,\n\tWhereAndIntent,\n\tWhereComparisonIntent,\n\tWhereInIntent,\n\tWhereIntent,\n\tWhereLikeIntent,\n\tWhereNotIntent,\n\tWhereNullIntent,\n\tWhereOrIntent,\n\tWhereRangeIntent,\n\tWindowIntent,\n} from './intent-ast.js';\nexport {\n\tisDeleteIntent,\n\tisInsertIntent,\n\tisUpdateIntent,\n\tisUpsertIntent,\n} from './intent-ast.js';\n\n// ============================================================================\n// Schema DSL (User-facing API)\n// ============================================================================\n\n// ARCH-005: Unified Schema API\nexport {\n\ttype ColumnDef,\n\tgetSchemaFromDb,\n\tisRef,\n\ttype JsonValue,\n\ttype ManyToManyDefinition,\n\ttype ManyToManyOptions,\n\tmanyToMany,\n\ttype RefOptions,\n\tref,\n\ttype Schema,\n\ttype SchemaColumnType,\n\ttype SchemaDefinition,\n\ttype SchemaTableOptions,\n\ttype SelfRefRoles,\n\tschema,\n\ttype TableDef,\n} from './dx/schema.js';\n\n// ============================================================================\n// Conventions (pluralization and casing)\n// ============================================================================\n\nexport {\n\tIRREGULAR_PLURALS,\n\tpluralize,\n\tsingularize,\n} from './conventions.js';\n\n// ============================================================================\n// Semantic Planner\n// ============================================================================\n\nexport { AmbiguousIncludeError, NotYetSupportedError } from '@dbsp/types';\nexport type {\n\tPlanDecision,\n\tPlanOptions,\n\tPlanReport,\n\tPlanWarning,\n} from './planner.js';\nexport {\n\tAmbiguousPlanError,\n\tplan,\n\tplanRecursive,\n} from './planner.js';\n\n// ============================================================================\n// ADR-0003 Transition Planner Interfaces\n// ============================================================================\n\nexport type {\n\tAssumption,\n\tProvenPlanStep,\n} from './transition/index.js';\nexport {\n\tadmitRecordedIdentity,\n\tcreateStagedTransitionOrchestrator,\n\tisOperationRuntime,\n} from './transition/index.js';\n\n// ============================================================================\n// Implementation (for advanced use cases)\n// ============================================================================\n\nexport { ModelIRImpl } from './model-impl.js';\n\n// ============================================================================\n// Adapter Interface (for multi-adapter support)\n// ============================================================================\n\nexport type {\n\tAdapter,\n\tAdapterLogger,\n\tBaseAdapter,\n\tCompiledQuery,\n\tCompileOptions,\n\tCompilingAdapter,\n\tDbCasing,\n\tDump,\n\tExecutingAdapter,\n\tIntrospectingAdapter,\n\tRawSqlAdapter,\n\tStreamingAdapter,\n\tTransactionalAdapter,\n} from './adapter.js';\n\n// ============================================================================\n// DX Layer (Developer Experience)\n// ============================================================================\n\nexport {\n\ttype AfterMutationHook,\n\ttype AfterMutationObserver,\n\ttype AfterQueryHook,\n\ttype AfterQueryObserver,\n\ttype AggregateOptions,\n\ttype AlterColumnOptions,\n\tAmbiguousRelationError,\n\taggOrderBy,\n\tand,\n\tany,\n\tarray,\n\tarrayAgg,\n\ttype BatchValuesOptions,\n\ttype BatchValuesRef,\n\ttype BeforeMutationHook,\n\ttype BeforeQueryHook,\n\tbatchValues,\n\tboolFn,\n\tCaseBuilder,\n\ttype CaseValue,\n\tColumnNotFoundError,\n\ttype ColumnRef,\n\ttype ColumnSpec,\n\ttype CreateIndexOptions,\n\tCteBuilder,\n\tCteQueryBuilder,\n\ttype CursorPaginatedResult,\n\ttype CursorPaginateOptions,\n\tcaseWhen,\n\tcast,\n\tcoalesce,\n\tcol,\n\tcreateHookManager,\n\tcreateOrm,\n\tcreateRawCteBuilder,\n\tDeleteBuilder,\n\ttype DistinctField,\n\ttype DropIndexOptions,\n\tdenseRank,\n\tdistinct,\n\tErrorCode,\n\tErrors,\n\tExecutionError,\n\tExpressionRef,\n\ttype ExpressionSpec,\n\temitWarning,\n\teq,\n\tevery,\n\texists,\n\texprRef,\n\textractPseudoColumnKeywords,\n\ttype FullTextSearchField,\n\tfn,\n\tfullTextSearch,\n\tgetLogger,\n\tgt,\n\tgte,\n\ttype HookManager,\n\ttype IncludeOptions,\n\ttype IndexColumnDef,\n\ttype IndexInfo,\n\ttype IndexMethod,\n\ttype InferTableRow,\n\tInsertBuilder,\n\tInvalidOperationError,\n\tinArray,\n\tinSubquery,\n\tisBatchValuesRef,\n\tisDistinctFrom,\n\tisNotNull,\n\tisNull,\n\tisSqlRaw,\n\ttype Logger,\n\tlag,\n\tlead,\n\tlike,\n\tliteral,\n\tlt,\n\tlte,\n\ttype MutationDump,\n\ttype MutationHookContext,\n\tNotFoundError,\n\ttype NqlBuilder,\n\ttype NqlTag,\n\tnamedArg,\n\tneq,\n\tnone,\n\tnot,\n\tnotExists,\n\tnqlRaw,\n\ttype OnErrorHook,\n\ttype OrmInstance,\n\ttype OrmOf,\n\top,\n\tor,\n\touterRef,\n\ttype PaginatedResult,\n\ttype PaginateOptions,\n\ttype PredicateExpressionRef,\n\ttype PredicateRef,\n\tparam,\n\ttype QueryBuilder,\n\ttype QueryHookContext,\n\ttype RangeType,\n\ttype RangeValue,\n\tRawCteQueryBuilder,\n\ttype RecursiveOptions,\n\ttype RelationHints,\n\tRelationNotFoundError,\n\ttype RelationRef,\n\tResultHydrator,\n\trangeContainedBy,\n\trangeContains,\n\trangeOverlaps,\n\trank,\n\traw,\n\trawExists,\n\trelationColumn,\n\tresetLogger,\n\trowNumber,\n\ttype SchemaIndexOptions,\n\ttype SchemaOptions,\n\ttype SetOperationBuilder,\n\ttype SqlRawExpression,\n\ttype StreamOptions,\n\tSubqueryBuilder,\n\tSubqueryExpression,\n\tsetLogger,\n\tsilentLogger,\n\tsome,\n\tsql,\n\tstar,\n\tsubquery,\n\tTABLE_META,\n\ttype TableDDL,\n\ttype TableIndexes,\n\tTableNotFoundError,\n\ttype TableRef,\n\ttype TruncateOptions,\n\ttextScore,\n\tUnsafeOperationError,\n\tUpdateBuilder,\n\tUpsertBuilder,\n\tunary,\n\tunsafeAsPredicate,\n\ttype VacuumOptions,\n\ttype WarningCategory,\n\twAvg,\n\twCount,\n\twMax,\n\twMin,\n\twSum,\n} from './dx/index.js';\n\n// ============================================================================\n// Dialect Capabilities (CORE-004)\n// ============================================================================\n\nexport type { DialectCapabilities } from './dialects/index.js';\nexport { POSTGRESQL_CAPABILITIES } from './dialects/index.js';\n\n// ============================================================================\n// SQL Utilities\n// ============================================================================\n\nexport { normalizeSQL } from './sql-utils.js';\n\n// ============================================================================\n// Assertion System (.assert.dbsp)\n// ============================================================================\n\nexport type {\n\tAssertion,\n\tAssertionOutcome,\n\tAssertionQueryResult,\n\tAssertionSummary,\n\tIntentSummary,\n\tParseError,\n\tParseResult,\n\tQueryAssertionResult,\n} from './assert/index.js';\nexport {\n\tassertEquals,\n\tassertParamsEquals,\n\tassertParamsType,\n\tassertSQLEquals,\n\tparseAssertionFile,\n\trunAssertions,\n\tvalidateAssertionBlocks,\n} from './assert/index.js';\n\nexport { InvalidJsonAggPayloadError } from './dx/include-payload-hydration.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGA,SAAS,uBAAuB,4BAA4B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @dbsp/core\n * Schema definition and query planning for db-semantic-planner.\n */\n\n// ============================================================================\n// ModelIR Types\n// ============================================================================\n\nexport type {\n\tCardinality,\n\tColumnIR,\n\tColumnType,\n\tIncludeStrategy,\n\tIndexIR,\n\tModelIR,\n\tOptionality,\n\tTableIR,\n} from './model-ir.js';\n\n// CLI-NQL: Relation kind helpers and pseudo-column factory\n\n// ============================================================================\n// IntentAST Types\n// ============================================================================\n\nexport type {\n\tAggregateExpressionIntent,\n\tAggregateIntent,\n\tExpressionIntent,\n\tIncludeIntent,\n\tInsertFromIntent,\n\tInsertIntent,\n\tJoinIntent,\n\tMutationIntent,\n\tOrderByIntent,\n\tQueryIntent,\n\tRecursiveIntent,\n\tSelectAggregateIntent,\n\tSelectFieldsIntent,\n\tSelectIntent,\n\tSelectWithExpressionsIntent,\n\tSubqueryRefIntent,\n\tUpsertFromIntent,\n\tWhereAndIntent,\n\tWhereComparisonIntent,\n\tWhereInIntent,\n\tWhereIntent,\n\tWhereLikeIntent,\n\tWhereNotIntent,\n\tWhereNullIntent,\n\tWhereOrIntent,\n\tWhereRangeIntent,\n\tWindowIntent,\n} from './intent-ast.js';\nexport {\n\tisDeleteIntent,\n\tisInsertIntent,\n\tisUpdateIntent,\n\tisUpsertIntent,\n} from './intent-ast.js';\n\n// ============================================================================\n// Schema DSL (User-facing API)\n// ============================================================================\n\n// ARCH-005: Unified Schema API\nexport {\n\ttype ColumnDef,\n\tgetSchemaFromDb,\n\tisRef,\n\ttype JsonValue,\n\ttype ManyToManyDefinition,\n\ttype ManyToManyOptions,\n\tmanyToMany,\n\ttype RefOptions,\n\tref,\n\ttype Schema,\n\ttype SchemaColumnType,\n\ttype SchemaDefinition,\n\ttype SchemaTableOptions,\n\ttype SelfRefRoles,\n\tschema,\n\ttype TableDef,\n} from './dx/schema.js';\n\n// ============================================================================\n// Conventions (pluralization and casing)\n// ============================================================================\n\nexport {\n\tIRREGULAR_PLURALS,\n\tpluralize,\n\tsingularize,\n} from './conventions.js';\n\n// ============================================================================\n// Semantic Planner\n// ============================================================================\n\nexport { AmbiguousIncludeError, NotYetSupportedError } from '@dbsp/types';\nexport type {\n\tPlanDecision,\n\tPlanOptions,\n\tPlanReport,\n\tPlanWarning,\n} from './planner.js';\nexport {\n\tAmbiguousPlanError,\n\tplan,\n\tplanRecursive,\n} from './planner.js';\n\n// ============================================================================\n// ADR-0003 Transition Planner Interfaces\n// ============================================================================\n\nexport type {\n\tAssumption,\n\tProvenPlanStep,\n} from './transition/index.js';\nexport {\n\tadmitRecordedIdentity,\n\tcreateStagedTransitionOrchestrator,\n\tisOperationRuntime,\n} from './transition/index.js';\n\n// ============================================================================\n// Implementation (for advanced use cases)\n// ============================================================================\n\nexport { ModelIRImpl } from './model-impl.js';\n\n// ============================================================================\n// Adapter Interface (for multi-adapter support)\n// ============================================================================\n\nexport type {\n\tAdapter,\n\tAdapterLogger,\n\tBaseAdapter,\n\tCompiledQuery,\n\tCompileOptions,\n\tCompilingAdapter,\n\tDbCasing,\n\tDump,\n\tExecutingAdapter,\n\tIntrospectingAdapter,\n\tRawSqlAdapter,\n\tStreamingAdapter,\n\tTransactionalAdapter,\n} from './adapter.js';\n\n// ============================================================================\n// DX Layer (Developer Experience)\n// ============================================================================\n\nexport {\n\ttype AfterMutationHook,\n\ttype AfterMutationObserver,\n\ttype AfterQueryHook,\n\ttype AfterQueryObserver,\n\ttype AggregateOptions,\n\ttype AlterColumnOptions,\n\tAmbiguousRelationError,\n\taggOrderBy,\n\tand,\n\tany,\n\tarray,\n\tarrayAgg,\n\ttype BatchValuesOptions,\n\ttype BatchValuesRef,\n\ttype BeforeMutationHook,\n\ttype BeforeQueryHook,\n\tbatchValues,\n\tboolFn,\n\tCaseBuilder,\n\ttype CaseValue,\n\tColumnNotFoundError,\n\ttype ColumnRef,\n\ttype ColumnSpec,\n\ttype CreateIndexOptions,\n\tCteBuilder,\n\tCteQueryBuilder,\n\ttype CursorPaginatedResult,\n\ttype CursorPaginateOptions,\n\tcaseWhen,\n\tcast,\n\tcoalesce,\n\tcol,\n\tcreateHookManager,\n\tcreateOrm,\n\tcreateRawCteBuilder,\n\tDeleteBuilder,\n\ttype DistinctField,\n\ttype DropIndexOptions,\n\tdenseRank,\n\tdistinct,\n\tErrorCode,\n\tErrors,\n\tExecutionError,\n\tExpressionRef,\n\ttype ExpressionSpec,\n\temitWarning,\n\teq,\n\tevery,\n\texists,\n\texprRef,\n\textractPseudoColumnKeywords,\n\ttype FullTextSearchField,\n\tfn,\n\tfullTextSearch,\n\tgetLogger,\n\tgt,\n\tgte,\n\ttype HookManager,\n\ttype IncludeOptions,\n\ttype IndexColumnDef,\n\ttype IndexInfo,\n\ttype IndexMethod,\n\ttype InferTableRow,\n\tInsertBuilder,\n\tInvalidOperationError,\n\tinArray,\n\tinSubquery,\n\tisBatchValuesRef,\n\tisDistinctFrom,\n\tisNotNull,\n\tisNull,\n\tisSqlRaw,\n\ttype Logger,\n\tlag,\n\tlead,\n\tlike,\n\tliteral,\n\tlt,\n\tlte,\n\ttype MutationDump,\n\ttype MutationHookContext,\n\tNotFoundError,\n\ttype NqlBuilder,\n\ttype NqlTag,\n\tnamedArg,\n\tneq,\n\tnone,\n\tnot,\n\tnotExists,\n\tnqlRaw,\n\ttype OnErrorHook,\n\ttype OrmInstance,\n\ttype OrmOf,\n\top,\n\tor,\n\touterRef,\n\ttype PaginatedResult,\n\ttype PaginateOptions,\n\ttype PredicateExpressionRef,\n\ttype PredicateRef,\n\tparam,\n\ttype QueryBuilder,\n\ttype QueryHookContext,\n\ttype RangeType,\n\ttype RangeValue,\n\tRawCteQueryBuilder,\n\ttype RecursiveOptions,\n\ttype ReferenceLeaf,\n\ttype RelationHints,\n\tRelationNotFoundError,\n\ttype RelationRef,\n\tResultHydrator,\n\trangeContainedBy,\n\trangeContains,\n\trangeOverlaps,\n\trank,\n\traw,\n\trawExists,\n\trelationColumn,\n\tresetLogger,\n\trowNumber,\n\ttype SchemaIndexOptions,\n\ttype SchemaOptions,\n\ttype SetOperationBuilder,\n\ttype SqlRawExpression,\n\ttype StreamOptions,\n\tSubqueryBuilder,\n\tSubqueryExpression,\n\tsetLogger,\n\tsilentLogger,\n\tsome,\n\tsql,\n\tstar,\n\tsubquery,\n\tTABLE_META,\n\ttype TableDDL,\n\ttype TableIndexes,\n\tTableNotFoundError,\n\ttype TableRef,\n\ttype TruncateOptions,\n\ttextScore,\n\tUnsafeOperationError,\n\tUpdateBuilder,\n\tUpsertBuilder,\n\tunary,\n\tunsafeAsPredicate,\n\ttype VacuumOptions,\n\ttype WarningCategory,\n\twAvg,\n\twCount,\n\twMax,\n\twMin,\n\twSum,\n} from './dx/index.js';\n\n// ============================================================================\n// Dialect Capabilities (CORE-004)\n// ============================================================================\n\nexport type { DialectCapabilities } from './dialects/index.js';\nexport { POSTGRESQL_CAPABILITIES } from './dialects/index.js';\n\n// ============================================================================\n// SQL Utilities\n// ============================================================================\n\nexport { normalizeSQL } from './sql-utils.js';\n\n// ============================================================================\n// Assertion System (.assert.dbsp)\n// ============================================================================\n\nexport type {\n\tAssertion,\n\tAssertionOutcome,\n\tAssertionQueryResult,\n\tAssertionSummary,\n\tIntentSummary,\n\tParseError,\n\tParseResult,\n\tQueryAssertionResult,\n} from './assert/index.js';\nexport {\n\tassertEquals,\n\tassertParamsEquals,\n\tassertParamsType,\n\tassertSQLEquals,\n\tparseAssertionFile,\n\trunAssertions,\n\tvalidateAssertionBlocks,\n} from './assert/index.js';\n\nexport { InvalidJsonAggPayloadError } from './dx/include-payload-hydration.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGA,SAAS,uBAAuB,4BAA4B;","names":[]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseAdapter, ExecutingAdapter, StreamingAdapter, TransactionalAdapter, CheckConstraintIR, Comparator, ObservationContext, AdmittedOutcomeClaim, DestructiveAuthorityPermit, DestructiveDecision, OutcomeClaimAdmissionInput, OutcomeClaimAdmission, OutcomeProtocolRefusal, DestructiveAction, DestructiveAuthorityEvidence, EnumIR, EvidenceObservation, ObservationRequest, EvidenceView, ProofObligation, ExecutionContract, ExecutionRequirement, AdvisoryObservationId, AssumptionId, ClaimId, EvidenceId, SemanticArtifactId, IndexIR, LedgerHome, LedgerAddress, LedgerChainMember, LedgerChainProjection, ClaimToken, OutcomeRecoveryInput, OutcomeRecoveryClassification, ClaimBundleStatement, ClaimStatementBundle, OutcomeClaimPlan, ProvenPlanShape, Assumption, ApplyPolicy, ResourceAddress, ResourceSelector, TransitionRunMetadata, NormalizedManagedStep, TransitionFragment, ProofClaim, OperationEffectAssessment, WhereIntent, QueryIntent, PlanReport, ResolvedRange, RangeAllocator, ModelIR, ResolvedCondition, PlanDecision, SelectExecution } from '@dbsp/types';
|
|
2
2
|
export { AdapterCapabilities, AdapterStreamOptions, ApplicableEvaluation, ApplyPolicy, CapabilityDescriptor, ColumnJsReadType, CompareOutcome, DumpMeta, DurableIntentRecord, ExclusiveTransitionTarget, FingerprintManifest, ForeignKeyIR, LogicalIdentity, ObservationContext, ObservationIssuer, ObservationRequest, OnDeleteAction, OperationEffectAssessment, PhysicalOperation, ProvenPlanShape, RecognitionResult, RecursivePlanReport, RelationIR, RelationType, ResourceAddress, RuleEvaluation, StepJournal, TableReaddressDeclaration, TransactionOptions, TransactionalCompletionRecord, TransitionLessor, TransitionQueryClient, TransitionRule, TransitionRunMetadata, TransitionSessionClient } from '@dbsp/types';
|
|
3
|
-
import { P as PackRegistry, T as TransitionRunPersister,
|
|
4
|
-
export {
|
|
3
|
+
import { P as PackRegistry, T as TransitionRunPersister, bw as Applier, bx as InProcessProvenPlan, by as Prover } from './assertion-functions-D777KMxU.js';
|
|
4
|
+
export { bz as ASSERTION_TYPES, J as AssertionBlock, bA as DUCKDB_CAPABILITIES, bB as DurablyLoadedRun, bC as ExecutionCoordinator, bD as MSSQL_CAPABILITIES, bE as MYSQL_CAPABILITIES, bF as ManagedOutcomeExecutionRequest, bG as ManagedOutcomePreflightRequest, bH as NonRollbackableExecutionTracker, g as OrderByRecord, bI as PlanScope, bJ as RefDefinition, bK as RegisteredOperationSemantics, bL as SQLITE_CAPABILITIES, bM as TRANSITION_LESSOR_REJECTION, bN as TransitionExecutionClient, bO as TransitionLeaseFailure, bP as TransitionPack, bQ as acquireExclusiveTransitionLease, bR as acquireTransitionLease, bS as acquireTransitionTargetLease, bT as assertCanonicalizableJson, bU as assertContains, bV as assertDbColumnExists, bW as assertDbOutput, bX as assertDbRowsEquals, bY as assertDbRowsMax, bZ as assertDbRowsMin, b_ as assertDbValueEquals, b$ as assertIntentHasGroupBy, c0 as assertIntentHasOrderBy, c1 as assertIntentHasWhere, c2 as assertIntentTable, c3 as assertIntentType, c4 as assertIntentWith, c5 as assertMatches, c6 as assertParamsLength, c7 as assertParamsValue, c8 as assertSQLColumn, c9 as assertSQLJoin, ca as assertSQLTable, cb as assertSuccess, cc as bindDeclarationSet, cd as compileNqlRead, ce as createBindingFinalPlan, cf as createExclusiveTransitionTarget, cg as createPackRegistry, ch as createTransitionLessor, ci as declarationSetFromModel, cj as isDurablyLoadedRun, ck as isExclusiveTransitionTarget, cl as isExpressionSpec, cm as isOverallSuccess, cn as isTransitionLessor, co as isWhereIntent, cp as loadVerifiedRecoveryJournal, cq as markTransitionClientCompromised, cr as mintDurablyLoadedRun, cs as normalizeRecursiveIncludeOptions, ct as objectToWhereIntent, cu as planInScope, cv as planOperationSession, cw as rawNotExists, cx as requiresDatabase, cy as resolveQueryIndex, cz as serverVersionNum, cA as stringAgg, cB as transitionPhysicalSessionIsCompromised, cC as validateDeclarationModel, cD as validateIncludeInput, cE as validateIncludeOptions, cF as validateIncludeOrdering, cG as validateIncludeStrategy, cH as validateRecursiveIncludeStrategy, cI as validateRecursiveSetOperation, cJ as validateResolvedIncludeStrategy, cK as validateSchemaIndexOptions, cL as validateTypeName } from './assertion-functions-D777KMxU.js';
|
|
5
5
|
export { CaseExpressionIntent, CompileOnlyAdapter, ConnectionAvailability, DeleteIntent, LiteralExpressionIntent, PartitionIR, RequiredEnumLabelIR, SelectAllIntent, UpdateIntent, UpsertIntent, WhereAnyIntent, WhereExistsIntent, WhereNotExistsIntent, WhereRelationFilterIntent, WhereSubqueryIntent, isSubqueryRef } from '@dbsp/types/internal';
|
|
6
6
|
import '@dbsp/nql';
|
|
7
7
|
|
package/dist/internal.js
CHANGED
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
validateSchemaIndexOptions,
|
|
120
120
|
validateTransitionRelationalInvariants,
|
|
121
121
|
validateTypeName
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-M6BTWAHC.js";
|
|
123
123
|
|
|
124
124
|
// src/transition/destructive-authority.ts
|
|
125
125
|
import { sameLedgerAddress } from "@dbsp/types";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbsp/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Intent-first semantic query planner for databases — declare WHAT to fetch, the planner decides HOW",
|
|
5
5
|
"author": "Olivier Orabona <oorabona@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dbsp/nql": "^2.0.
|
|
49
|
-
"@dbsp/types": "^6.
|
|
48
|
+
"@dbsp/nql": "^2.0.5",
|
|
49
|
+
"@dbsp/types": "^6.4.0",
|
|
50
50
|
"valibot": "^1.4.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|