@query-graph/core 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dsl.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const GRAPH_DEFINITION_VERSION = 9
3
+ const GRAPH_DEFINITION_VERSION = 10
4
4
  const SCALAR_TYPES = new Set([
5
5
  'boolean',
6
6
  'int32',
@@ -19,6 +19,7 @@ const SUMMARY_FIELD_BRAND = Symbol('SummaryField')
19
19
  const RELATION_CONFIGURATION_KEYS = new Set(['name', 'from', 'to', 'on', 'required', 'cardinality', 'selection'])
20
20
  const CONSTRAINT_CONFIGURATION_KEYS = new Set(['predicate', 'when'])
21
21
  const PROJECTION_CONFIGURATION_KEYS = new Set(['path', 'expression', 'default'])
22
+ const PROJECTION_OBJECT_CONFIGURATION_KEYS = new Set(['path', 'presence'])
22
23
  const EXISTS_CONFIGURATION_KEYS = new Set(['from'])
23
24
  const ORDERING_CONFIGURATION_KEYS = new Set(['name', 'by', 'default'])
24
25
 
@@ -357,6 +358,14 @@ function project(value) {
357
358
  return definition
358
359
  }
359
360
 
361
+ function projectObject(value) {
362
+ const configuration = configurationOf('projectObject', value, PROJECTION_OBJECT_CONFIGURATION_KEYS)
363
+ return {
364
+ path: typeof configuration.path === 'string' ? configuration.path.split('.') : [...configuration.path],
365
+ presence: asExpression(configuration.presence),
366
+ }
367
+ }
368
+
360
369
  function dimension(value) {
361
370
  return summaryField('dimension', configurationOf('dimension', value, PROJECTION_CONFIGURATION_KEYS))
362
371
  }
@@ -429,6 +438,7 @@ function defineGraphModule(configuration) {
429
438
  relations: content.relations,
430
439
  constraints: content.constraints,
431
440
  projection: content.projection,
441
+ objects: content.objects,
432
442
  orderings: content.orderings,
433
443
  }
434
444
  Object.defineProperty(module, GRAPH_MODULE_BRAND, { value: true })
@@ -456,7 +466,7 @@ function defineSummaryGraph(configuration) {
456
466
 
457
467
  function buildGraphDefinition(configuration, mode) {
458
468
  const content = composeDefinitionContent(configuration)
459
- validateProjectionMode(content.projection, mode)
469
+ validateProjectionMode(content.projection, content.objects, mode)
460
470
 
461
471
  return deepFreeze({
462
472
  schemaVersion: GRAPH_DEFINITION_VERSION,
@@ -468,13 +478,17 @@ function buildGraphDefinition(configuration, mode) {
468
478
  constraints: content.constraints,
469
479
  projection: {
470
480
  fields: content.projection,
481
+ objects: content.objects,
471
482
  },
472
483
  orderings: content.orderings,
473
484
  })
474
485
  }
475
486
 
476
- function validateProjectionMode(projection, mode) {
487
+ function validateProjectionMode(projection, objects, mode) {
477
488
  if (mode === 'summary') {
489
+ if (objects.length > 0) {
490
+ throw new TypeError('Summary graph cannot define projection objects')
491
+ }
478
492
  if (projection.length === 0) {
479
493
  throw new TypeError('Summary graph must define at least one dimension or measure')
480
494
  }
@@ -502,6 +516,7 @@ function composeDefinitionContent(configuration) {
502
516
  relations: [],
503
517
  constraints: [],
504
518
  projection: [],
519
+ objects: [],
505
520
  orderings: [],
506
521
  }
507
522
  const indexes = {
@@ -510,6 +525,7 @@ function composeDefinitionContent(configuration) {
510
525
  relations: new Map(),
511
526
  constraints: new Set(),
512
527
  projection: new Map(),
528
+ objects: new Map(),
513
529
  orderings: new Map(),
514
530
  }
515
531
 
@@ -547,6 +563,9 @@ function addDefinitionPart(content, indexes, part, owner) {
547
563
  addNamedDefinitions(content.projection, indexes.projection, part.projection, 'projection', owner, (projection) =>
548
564
  projection.path.join('.'),
549
565
  )
566
+ addNamedDefinitions(content.objects, indexes.objects, part.objects, 'projection object', owner, (object) =>
567
+ object.path.join('.'),
568
+ )
550
569
 
551
570
  addNamedDefinitions(
552
571
  content.orderings,
@@ -732,6 +751,7 @@ exports.relation = relation
732
751
  exports.constraint = constraint
733
752
  exports.ordering = ordering
734
753
  exports.project = project
754
+ exports.projectObject = projectObject
735
755
  exports.dimension = dimension
736
756
  exports.measure = measure
737
757
  exports.asc = asc
@@ -740,3 +760,6 @@ exports.defineGraphModule = defineGraphModule
740
760
  exports.defineGraph = defineGraph
741
761
  exports.defineSummaryGraph = defineSummaryGraph
742
762
  exports.firstBy = firstBy
763
+ exports.batchQuery = require('./composition.js').batchQuery
764
+ exports.batchRelation = require('./composition.js').batchRelation
765
+ exports.composeGraph = require('./composition.js').composeGraph
package/index.d.ts CHANGED
@@ -1,5 +1,24 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ export declare class CompiledQueryPlan {
4
+ get root(): CompiledSqlStatement
5
+ get batches(): Array<CompiledBatchStep>
6
+ compileBatch(name: string, keys: readonly unknown[]): CompiledSqlStatement
7
+ }
8
+
9
+ export declare class ComposedQueryGraph {
10
+ get name(): string
11
+ withBatchRelation(graph: RelationalQueryGraph, relation: import('./dsl.js').BatchRelationWire): ComposedQueryGraph
12
+ compileSqlServerPlan(
13
+ operation: import('./definition.js').QueryOperation,
14
+ options?: import('./definition.js').SqlServerCompileOptions,
15
+ ): CompiledQueryPlan
16
+ compileOraclePlan(
17
+ operation: import('./definition.js').QueryOperation,
18
+ options?: import('./definition.js').OracleCompileOptions,
19
+ ): CompiledQueryPlan
20
+ }
21
+
3
22
  export declare class QueryGraph {
4
23
  get name(): string
5
24
  get root(): string
@@ -15,6 +34,7 @@ export declare class QueryGraph {
15
34
 
16
35
  export declare class RelationalQueryGraph {
17
36
  get name(): string
37
+ compose(): ComposedQueryGraph
18
38
  compileSqlServer(
19
39
  operation: import('./definition.js').QueryOperation,
20
40
  options?: import('./definition.js').SqlServerCompileOptions,
@@ -25,6 +45,17 @@ export declare class RelationalQueryGraph {
25
45
  ): CompiledSqlStatement
26
46
  }
27
47
 
48
+ export interface CompiledBatchStep {
49
+ name: string
50
+ parentKey: string
51
+ childKey: string
52
+ keyParameter: string
53
+ parameters: Readonly<Record<string, unknown>>
54
+ cardinality: import('./dsl.js').BatchCardinality
55
+ parentKeyInjected: boolean
56
+ childKeyInjected: boolean
57
+ }
58
+
28
59
  export interface CompiledSqlColumn {
29
60
  name: string
30
61
  path: string
@@ -33,6 +64,11 @@ export interface CompiledSqlColumn {
33
64
  relations: Array<string>
34
65
  }
35
66
 
67
+ export interface CompiledSqlObject {
68
+ path: string
69
+ presenceColumn: string
70
+ }
71
+
36
72
  export interface CompiledSqlRelation {
37
73
  name: string
38
74
  from: string
@@ -45,6 +81,7 @@ export interface CompiledSqlStatement {
45
81
  sql: string
46
82
  bindings: Array<SqlBinding>
47
83
  columns: Array<CompiledSqlColumn>
84
+ objects: Array<CompiledSqlObject>
48
85
  relations: Array<CompiledSqlRelation>
49
86
  }
50
87
 
@@ -58,3 +95,5 @@ export interface SqlBinding {
58
95
  scalarType: import('./definition.js').ScalarType
59
96
  index?: number
60
97
  }
98
+
99
+ export { batchQuery, batchRelation, composeGraph } from './dsl.js'
package/index.js CHANGED
@@ -80,8 +80,8 @@ function requireNative() {
80
80
  try {
81
81
  const binding = require('@query-graph/core-android-arm64')
82
82
  const bindingPackageVersion = require('@query-graph/core-android-arm64/package.json').version
83
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
83
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
84
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
85
85
  }
86
86
  return binding
87
87
  } catch (e) {
@@ -96,8 +96,8 @@ function requireNative() {
96
96
  try {
97
97
  const binding = require('@query-graph/core-android-arm-eabi')
98
98
  const bindingPackageVersion = require('@query-graph/core-android-arm-eabi/package.json').version
99
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
99
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
100
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
101
101
  }
102
102
  return binding
103
103
  } catch (e) {
@@ -116,8 +116,8 @@ function requireNative() {
116
116
  try {
117
117
  const binding = require('@query-graph/core-win32-x64-msvc')
118
118
  const bindingPackageVersion = require('@query-graph/core-win32-x64-msvc/package.json').version
119
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
120
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
121
121
  }
122
122
  return binding
123
123
  } catch (e) {
@@ -132,8 +132,8 @@ function requireNative() {
132
132
  try {
133
133
  const binding = require('@query-graph/core-win32-ia32-msvc')
134
134
  const bindingPackageVersion = require('@query-graph/core-win32-ia32-msvc/package.json').version
135
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
136
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
137
137
  }
138
138
  return binding
139
139
  } catch (e) {
@@ -148,8 +148,8 @@ function requireNative() {
148
148
  try {
149
149
  const binding = require('@query-graph/core-win32-arm64-msvc')
150
150
  const bindingPackageVersion = require('@query-graph/core-win32-arm64-msvc/package.json').version
151
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
151
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
152
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
153
153
  }
154
154
  return binding
155
155
  } catch (e) {
@@ -167,8 +167,8 @@ function requireNative() {
167
167
  try {
168
168
  const binding = require('@query-graph/core-darwin-universal')
169
169
  const bindingPackageVersion = require('@query-graph/core-darwin-universal/package.json').version
170
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
170
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
172
  }
173
173
  return binding
174
174
  } catch (e) {
@@ -183,8 +183,8 @@ function requireNative() {
183
183
  try {
184
184
  const binding = require('@query-graph/core-darwin-x64')
185
185
  const bindingPackageVersion = require('@query-graph/core-darwin-x64/package.json').version
186
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
186
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
187
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
188
188
  }
189
189
  return binding
190
190
  } catch (e) {
@@ -199,8 +199,8 @@ function requireNative() {
199
199
  try {
200
200
  const binding = require('@query-graph/core-darwin-arm64')
201
201
  const bindingPackageVersion = require('@query-graph/core-darwin-arm64/package.json').version
202
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
202
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
203
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
204
204
  }
205
205
  return binding
206
206
  } catch (e) {
@@ -219,8 +219,8 @@ function requireNative() {
219
219
  try {
220
220
  const binding = require('@query-graph/core-freebsd-x64')
221
221
  const bindingPackageVersion = require('@query-graph/core-freebsd-x64/package.json').version
222
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
222
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
223
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
224
224
  }
225
225
  return binding
226
226
  } catch (e) {
@@ -235,8 +235,8 @@ function requireNative() {
235
235
  try {
236
236
  const binding = require('@query-graph/core-freebsd-arm64')
237
237
  const bindingPackageVersion = require('@query-graph/core-freebsd-arm64/package.json').version
238
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
238
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
239
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
240
240
  }
241
241
  return binding
242
242
  } catch (e) {
@@ -256,8 +256,8 @@ function requireNative() {
256
256
  try {
257
257
  const binding = require('@query-graph/core-linux-x64-musl')
258
258
  const bindingPackageVersion = require('@query-graph/core-linux-x64-musl/package.json').version
259
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
260
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
261
261
  }
262
262
  return binding
263
263
  } catch (e) {
@@ -272,8 +272,8 @@ function requireNative() {
272
272
  try {
273
273
  const binding = require('@query-graph/core-linux-x64-gnu')
274
274
  const bindingPackageVersion = require('@query-graph/core-linux-x64-gnu/package.json').version
275
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
275
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
276
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
277
277
  }
278
278
  return binding
279
279
  } catch (e) {
@@ -290,8 +290,8 @@ function requireNative() {
290
290
  try {
291
291
  const binding = require('@query-graph/core-linux-arm64-musl')
292
292
  const bindingPackageVersion = require('@query-graph/core-linux-arm64-musl/package.json').version
293
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
293
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
294
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
295
295
  }
296
296
  return binding
297
297
  } catch (e) {
@@ -306,8 +306,8 @@ function requireNative() {
306
306
  try {
307
307
  const binding = require('@query-graph/core-linux-arm64-gnu')
308
308
  const bindingPackageVersion = require('@query-graph/core-linux-arm64-gnu/package.json').version
309
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
309
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
310
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
311
311
  }
312
312
  return binding
313
313
  } catch (e) {
@@ -324,8 +324,8 @@ function requireNative() {
324
324
  try {
325
325
  const binding = require('@query-graph/core-linux-arm-musleabihf')
326
326
  const bindingPackageVersion = require('@query-graph/core-linux-arm-musleabihf/package.json').version
327
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
327
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
328
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
329
329
  }
330
330
  return binding
331
331
  } catch (e) {
@@ -340,8 +340,8 @@ function requireNative() {
340
340
  try {
341
341
  const binding = require('@query-graph/core-linux-arm-gnueabihf')
342
342
  const bindingPackageVersion = require('@query-graph/core-linux-arm-gnueabihf/package.json').version
343
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
343
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
344
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
345
345
  }
346
346
  return binding
347
347
  } catch (e) {
@@ -358,8 +358,8 @@ function requireNative() {
358
358
  try {
359
359
  const binding = require('@query-graph/core-linux-loong64-musl')
360
360
  const bindingPackageVersion = require('@query-graph/core-linux-loong64-musl/package.json').version
361
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
361
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
362
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
363
363
  }
364
364
  return binding
365
365
  } catch (e) {
@@ -374,8 +374,8 @@ function requireNative() {
374
374
  try {
375
375
  const binding = require('@query-graph/core-linux-loong64-gnu')
376
376
  const bindingPackageVersion = require('@query-graph/core-linux-loong64-gnu/package.json').version
377
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
377
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
378
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
379
379
  }
380
380
  return binding
381
381
  } catch (e) {
@@ -392,8 +392,8 @@ function requireNative() {
392
392
  try {
393
393
  const binding = require('@query-graph/core-linux-riscv64-musl')
394
394
  const bindingPackageVersion = require('@query-graph/core-linux-riscv64-musl/package.json').version
395
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
395
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
396
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
397
397
  }
398
398
  return binding
399
399
  } catch (e) {
@@ -408,8 +408,8 @@ function requireNative() {
408
408
  try {
409
409
  const binding = require('@query-graph/core-linux-riscv64-gnu')
410
410
  const bindingPackageVersion = require('@query-graph/core-linux-riscv64-gnu/package.json').version
411
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
411
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
412
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
413
413
  }
414
414
  return binding
415
415
  } catch (e) {
@@ -425,8 +425,8 @@ function requireNative() {
425
425
  try {
426
426
  const binding = require('@query-graph/core-linux-ppc64-gnu')
427
427
  const bindingPackageVersion = require('@query-graph/core-linux-ppc64-gnu/package.json').version
428
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
429
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
430
430
  }
431
431
  return binding
432
432
  } catch (e) {
@@ -441,8 +441,8 @@ function requireNative() {
441
441
  try {
442
442
  const binding = require('@query-graph/core-linux-s390x-gnu')
443
443
  const bindingPackageVersion = require('@query-graph/core-linux-s390x-gnu/package.json').version
444
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
444
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
445
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
446
446
  }
447
447
  return binding
448
448
  } catch (e) {
@@ -461,8 +461,8 @@ function requireNative() {
461
461
  try {
462
462
  const binding = require('@query-graph/core-openharmony-arm64')
463
463
  const bindingPackageVersion = require('@query-graph/core-openharmony-arm64/package.json').version
464
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
464
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
465
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
466
466
  }
467
467
  return binding
468
468
  } catch (e) {
@@ -477,8 +477,8 @@ function requireNative() {
477
477
  try {
478
478
  const binding = require('@query-graph/core-openharmony-x64')
479
479
  const bindingPackageVersion = require('@query-graph/core-openharmony-x64/package.json').version
480
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
480
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
481
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
482
482
  }
483
483
  return binding
484
484
  } catch (e) {
@@ -493,8 +493,8 @@ function requireNative() {
493
493
  try {
494
494
  const binding = require('@query-graph/core-openharmony-arm')
495
495
  const bindingPackageVersion = require('@query-graph/core-openharmony-arm/package.json').version
496
- if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
- throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
496
+ if (bindingPackageVersion !== '1.1.2' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
497
+ throw new Error(`Native binding package version mismatch, expected 1.1.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
498
498
  }
499
499
  return binding
500
500
  } catch (e) {
@@ -557,6 +557,12 @@ if (!nativeBinding) {
557
557
  }
558
558
 
559
559
  module.exports = nativeBinding
560
+ module.exports.CompiledQueryPlan = nativeBinding.CompiledQueryPlan
561
+ module.exports.ComposedQueryGraph = nativeBinding.ComposedQueryGraph
560
562
  module.exports.QueryGraph = nativeBinding.QueryGraph
561
563
  module.exports.RelationalQueryGraph = nativeBinding.RelationalQueryGraph
562
564
  module.exports.registerDefinition = nativeBinding.registerDefinition
565
+
566
+ module.exports.batchQuery = require('./composition.js').batchQuery
567
+ module.exports.batchRelation = require('./composition.js').batchRelation
568
+ module.exports.composeGraph = require('./composition.js').composeGraph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@query-graph/core",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Native query graph planner and SQL compiler for Node.js",
5
5
  "workspaces": [
6
6
  "packages/*"
@@ -41,6 +41,7 @@
41
41
  "node-addon"
42
42
  ],
43
43
  "files": [
44
+ "composition.js",
44
45
  "definition.d.ts",
45
46
  "definition.js",
46
47
  "dsl.d.ts",
@@ -135,9 +136,9 @@
135
136
  },
136
137
  "packageManager": "yarn@4.13.0",
137
138
  "optionalDependencies": {
138
- "@query-graph/core-win32-x64-msvc": "1.1.0",
139
- "@query-graph/core-darwin-x64": "1.1.0",
140
- "@query-graph/core-linux-x64-gnu": "1.1.0",
141
- "@query-graph/core-darwin-arm64": "1.1.0"
139
+ "@query-graph/core-win32-x64-msvc": "1.1.2",
140
+ "@query-graph/core-darwin-x64": "1.1.2",
141
+ "@query-graph/core-linux-x64-gnu": "1.1.2",
142
+ "@query-graph/core-darwin-arm64": "1.1.2"
142
143
  }
143
144
  }