@niscorp/vex 0.4.5 → 0.5.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/DESIGN.md +72 -45
  3. package/DOCS.md +130 -21
  4. package/README.md +17 -0
  5. package/dist/adapters/express/index.cjs +606 -173
  6. package/dist/adapters/express/index.cjs.map +1 -1
  7. package/dist/adapters/express/index.d.cts +6 -2
  8. package/dist/adapters/express/index.d.ts +6 -2
  9. package/dist/adapters/express/index.js +16 -3
  10. package/dist/adapters/express/index.js.map +1 -1
  11. package/dist/adapters/hono/index.cjs +597 -173
  12. package/dist/adapters/hono/index.cjs.map +1 -1
  13. package/dist/adapters/hono/index.d.cts +5 -2
  14. package/dist/adapters/hono/index.d.ts +5 -2
  15. package/dist/adapters/hono/index.js +7 -3
  16. package/dist/adapters/hono/index.js.map +1 -1
  17. package/dist/agent/index.cjs +12 -12
  18. package/dist/agent/index.cjs.map +1 -1
  19. package/dist/agent/index.d.cts +1 -1
  20. package/dist/agent/index.d.ts +1 -1
  21. package/dist/agent/index.js +12 -12
  22. package/dist/agent/index.js.map +1 -1
  23. package/dist/{chunk-W5MYFJKT.js → chunk-F7OXXJIH.js} +562 -192
  24. package/dist/chunk-F7OXXJIH.js.map +1 -0
  25. package/dist/{chunk-F7RDSWYF.js → chunk-VHNCSQPO.js} +2 -2
  26. package/dist/{chunk-F7RDSWYF.js.map → chunk-VHNCSQPO.js.map} +1 -1
  27. package/dist/{handler-O6XslV-S.d.ts → handler-DdfaWN_J.d.ts} +7 -1
  28. package/dist/{handler-CB0BqKsY.d.cts → handler-kvZkxwaN.d.cts} +7 -1
  29. package/dist/index.cjs +493 -232
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +5 -3
  32. package/dist/index.d.ts +5 -3
  33. package/dist/index.js +118 -221
  34. package/dist/index.js.map +1 -1
  35. package/dist/migrations/index.cjs.map +1 -1
  36. package/dist/migrations/index.js +1 -1
  37. package/dist/{types-BmHuPfPS.d.cts → types-BxkRxTTx.d.cts} +5 -0
  38. package/dist/{types-D5CCaqcd.d.ts → types-DgUZNKii.d.ts} +5 -0
  39. package/package.json +8 -8
  40. package/dist/chunk-W5MYFJKT.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-BmHuPfPS.cjs';
2
- export { l as AdapterCapabilities, B as BoundParams, m as ColumnUpgrader, n as CoreMutation, E as EntitySchema, o as ExecuteOptions, G as GenerateDsl, p as GenerationCaller, I as IndexSchema, q as IntrospectOptions, r as ItemRef, L as LiveRowsConfig, s as LiveRowsStats, t as LookupValue, u as MapToShape, v as Mutation, w as MutationCacheEntry, x as MutationDefinitionSchema, y as MutationSchema, z as MutationValue, N as NamedScopeBehaviors, H as NormalizedType, O as OkCacheEntry, J as QueryErrorResponse, K as QueryRequest, T as QueryRequestSchema, U as QueryResponse, V as REFRESH_MODES, W as RelationSchema, X as ResolvedField, Y as ResolvedFilter, Z as ResolvedJoin, _ as ResolvedMutation, $ as ResolvedOnConflict, a0 as ResolvedSemantic, a1 as ResolvedSource, a2 as ReturnedRef, a3 as SCOPE_VERBS, a4 as ScopeBehaviors, a5 as ScopeBinding, a6 as ScopeEntityRule, a7 as ScopeMatch, a8 as ScopeRule, a9 as ScopeRules, aa as ScopeSet, ab as ScopeValues, ac as TestResult, ad as UNREADABLE_MODES, ae as UnsatisfiableCacheEntry, af as UpgradedColumn, ag as UpgradedColumns, ah as UpgradedColumnsSchema, ai as VexEvent, aj as VexEventHandler, ak as createScopePolicy, al as isRefresh, am as mergeScopePolicies, an as scopeBindings, ao as scopeGrants, ap as scopeProfiles } from './types-BmHuPfPS.cjs';
1
+ import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-BxkRxTTx.cjs';
2
+ export { l as AdapterCapabilities, B as BoundParams, m as ColumnUpgrader, n as CoreMutation, E as EntitySchema, o as ExecuteOptions, G as GenerateDsl, p as GenerationCaller, I as IndexSchema, q as IntrospectOptions, r as ItemRef, L as LiveRowsConfig, s as LiveRowsStats, t as LookupValue, u as MapToShape, v as Mutation, w as MutationCacheEntry, x as MutationDefinitionSchema, y as MutationSchema, z as MutationValue, N as NamedScopeBehaviors, H as NormalizedType, O as OkCacheEntry, J as QueryErrorResponse, K as QueryRequest, T as QueryRequestSchema, U as QueryResponse, V as REFRESH_MODES, W as RelationSchema, X as ResolvedField, Y as ResolvedFilter, Z as ResolvedJoin, _ as ResolvedMutation, $ as ResolvedOnConflict, a0 as ResolvedSemantic, a1 as ResolvedSource, a2 as ReturnedRef, a3 as SCOPE_VERBS, a4 as ScopeBehaviors, a5 as ScopeBinding, a6 as ScopeEntityRule, a7 as ScopeMatch, a8 as ScopeRule, a9 as ScopeRules, aa as ScopeSet, ab as ScopeValues, ac as TestResult, ad as UNREADABLE_MODES, ae as UnsatisfiableCacheEntry, af as UpgradedColumn, ag as UpgradedColumns, ah as UpgradedColumnsSchema, ai as VexEvent, aj as VexEventHandler, ak as createScopePolicy, al as isRefresh, am as mergeScopePolicies, an as scopeBindings, ao as scopeGrants, ap as scopeProfiles } from './types-BxkRxTTx.cjs';
3
3
  import { Q as Query, F as FieldOrValue, a as Filter } from './query.schema-B-LVNfyX.cjs';
4
4
  export { A as AggregateExpression, b as AggregateExpressionSchema, C as ComputeExpression, c as ComputeExpressionSchema, d as ContextRef, e as FilterSchema, f as QuerySchema, S as ScopeRef, g as SortEntry, h as Source } from './query.schema-B-LVNfyX.cjs';
5
5
  import { P as PgPool } from './introspect-D3OaXHBc.cjs';
6
6
  import { Sequence } from '@niscorp/strata';
7
- export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-CB0BqKsY.cjs';
7
+ export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-kvZkxwaN.cjs';
8
8
  import '@niscorp/prism';
9
9
  import 'zod';
10
10
 
@@ -31,6 +31,7 @@ type PostgresAdapterConfig = {
31
31
  pool: PgPool;
32
32
  schema?: string;
33
33
  exclude?: string[];
34
+ qualifyTables?: boolean;
34
35
  };
35
36
  declare const createPostgresAdapter: (config: PostgresAdapterConfig) => DatabaseAdapter;
36
37
 
@@ -47,6 +48,7 @@ type CompilationContext = {
47
48
  value: number;
48
49
  };
49
50
  existsMap?: Map<object, ResolvedExists>;
51
+ namespace?: string;
50
52
  };
51
53
  declare const compileFieldOrValue: (fov: FieldOrValue, ctx: CompilationContext) => string;
52
54
  declare const compileFilter: (filter: Filter, ctx: CompilationContext) => string;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-D5CCaqcd.js';
2
- export { l as AdapterCapabilities, B as BoundParams, m as ColumnUpgrader, n as CoreMutation, E as EntitySchema, o as ExecuteOptions, G as GenerateDsl, p as GenerationCaller, I as IndexSchema, q as IntrospectOptions, r as ItemRef, L as LiveRowsConfig, s as LiveRowsStats, t as LookupValue, u as MapToShape, v as Mutation, w as MutationCacheEntry, x as MutationDefinitionSchema, y as MutationSchema, z as MutationValue, N as NamedScopeBehaviors, H as NormalizedType, O as OkCacheEntry, J as QueryErrorResponse, K as QueryRequest, T as QueryRequestSchema, U as QueryResponse, V as REFRESH_MODES, W as RelationSchema, X as ResolvedField, Y as ResolvedFilter, Z as ResolvedJoin, _ as ResolvedMutation, $ as ResolvedOnConflict, a0 as ResolvedSemantic, a1 as ResolvedSource, a2 as ReturnedRef, a3 as SCOPE_VERBS, a4 as ScopeBehaviors, a5 as ScopeBinding, a6 as ScopeEntityRule, a7 as ScopeMatch, a8 as ScopeRule, a9 as ScopeRules, aa as ScopeSet, ab as ScopeValues, ac as TestResult, ad as UNREADABLE_MODES, ae as UnsatisfiableCacheEntry, af as UpgradedColumn, ag as UpgradedColumns, ah as UpgradedColumnsSchema, ai as VexEvent, aj as VexEventHandler, ak as createScopePolicy, al as isRefresh, am as mergeScopePolicies, an as scopeBindings, ao as scopeGrants, ap as scopeProfiles } from './types-D5CCaqcd.js';
1
+ import { Q as QueryEngineConfig, a as QueryEngine, D as DatabaseSchema, R as ResolvedQuery, A as AnalysisConfig, b as AnalysisResult, C as CompiledQuery, c as ContextMeta, d as DatabaseAdapter, e as Row, F as FieldSchema, P as ParamSlot, f as ResolvedExists, g as QueryErrorCode, S as ScopePolicy, h as CacheBackend, i as CacheEntry, j as Refresh, M as MutationDefinition, k as ContextContract } from './types-DgUZNKii.js';
2
+ export { l as AdapterCapabilities, B as BoundParams, m as ColumnUpgrader, n as CoreMutation, E as EntitySchema, o as ExecuteOptions, G as GenerateDsl, p as GenerationCaller, I as IndexSchema, q as IntrospectOptions, r as ItemRef, L as LiveRowsConfig, s as LiveRowsStats, t as LookupValue, u as MapToShape, v as Mutation, w as MutationCacheEntry, x as MutationDefinitionSchema, y as MutationSchema, z as MutationValue, N as NamedScopeBehaviors, H as NormalizedType, O as OkCacheEntry, J as QueryErrorResponse, K as QueryRequest, T as QueryRequestSchema, U as QueryResponse, V as REFRESH_MODES, W as RelationSchema, X as ResolvedField, Y as ResolvedFilter, Z as ResolvedJoin, _ as ResolvedMutation, $ as ResolvedOnConflict, a0 as ResolvedSemantic, a1 as ResolvedSource, a2 as ReturnedRef, a3 as SCOPE_VERBS, a4 as ScopeBehaviors, a5 as ScopeBinding, a6 as ScopeEntityRule, a7 as ScopeMatch, a8 as ScopeRule, a9 as ScopeRules, aa as ScopeSet, ab as ScopeValues, ac as TestResult, ad as UNREADABLE_MODES, ae as UnsatisfiableCacheEntry, af as UpgradedColumn, ag as UpgradedColumns, ah as UpgradedColumnsSchema, ai as VexEvent, aj as VexEventHandler, ak as createScopePolicy, al as isRefresh, am as mergeScopePolicies, an as scopeBindings, ao as scopeGrants, ap as scopeProfiles } from './types-DgUZNKii.js';
3
3
  import { Q as Query, F as FieldOrValue, a as Filter } from './query.schema-B-LVNfyX.js';
4
4
  export { A as AggregateExpression, b as AggregateExpressionSchema, C as ComputeExpression, c as ComputeExpressionSchema, d as ContextRef, e as FilterSchema, f as QuerySchema, S as ScopeRef, g as SortEntry, h as Source } from './query.schema-B-LVNfyX.js';
5
5
  import { P as PgPool } from './introspect-D3OaXHBc.js';
6
6
  import { Sequence } from '@niscorp/strata';
7
- export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-O6XslV-S.js';
7
+ export { C as ContextField, a as ContextSignature, D as DiscoveryFingerprint, b as DiscoveryResponse, E as ExecuteRecord, M as MutationClient, c as MutationContext, d as MutationEffect, e as MutationTx, Q as QueryResult, V as VexHandlerConfig, f as VexLive, W as WriteEvent, g as WriteResult, h as collectMutationContext, i as collectQueryContext, j as executeMutation, k as executeWrites, l as handleDiscovery, m as handleFingerprintDelete, n as handleFingerprintPatch, o as handleQuery, p as lintMutation, q as mutationEffect, r as mutationMisfits, s as requiredContextKeys, t as tablesChangedBy } from './handler-DdfaWN_J.js';
8
8
  import '@niscorp/prism';
9
9
  import 'zod';
10
10
 
@@ -31,6 +31,7 @@ type PostgresAdapterConfig = {
31
31
  pool: PgPool;
32
32
  schema?: string;
33
33
  exclude?: string[];
34
+ qualifyTables?: boolean;
34
35
  };
35
36
  declare const createPostgresAdapter: (config: PostgresAdapterConfig) => DatabaseAdapter;
36
37
 
@@ -47,6 +48,7 @@ type CompilationContext = {
47
48
  value: number;
48
49
  };
49
50
  existsMap?: Map<object, ResolvedExists>;
51
+ namespace?: string;
50
52
  };
51
53
  declare const compileFieldOrValue: (fov: FieldOrValue, ctx: CompilationContext) => string;
52
54
  declare const compileFilter: (filter: Filter, ctx: CompilationContext) => string;