@query-graph/core 1.0.0-next.1 → 1.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/README.md +132 -91
- package/index.js +50 -50
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -55,51 +55,65 @@ import {
|
|
|
55
55
|
source,
|
|
56
56
|
} from '@query-graph/core/dsl'
|
|
57
57
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const users = source('users', {
|
|
59
|
+
id: 'int64',
|
|
60
|
+
email: 'string',
|
|
61
61
|
})
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const profiles = source('profiles', {
|
|
64
64
|
id: 'int64',
|
|
65
|
-
|
|
65
|
+
userId: 'int64',
|
|
66
|
+
displayName: nullable('string'),
|
|
66
67
|
})
|
|
67
68
|
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
name: '
|
|
71
|
-
from:
|
|
72
|
-
to:
|
|
73
|
-
on: eq(
|
|
69
|
+
const userId = requiredParameter('userId', 'int64')
|
|
70
|
+
const profileRelation = relation({
|
|
71
|
+
name: 'profile',
|
|
72
|
+
from: users,
|
|
73
|
+
to: profiles,
|
|
74
|
+
on: eq(users.field('id'), profiles.field('userId')),
|
|
75
|
+
cardinality: 'one',
|
|
74
76
|
required: true,
|
|
77
|
+
selection: firstBy(asc(profiles.field('id'))),
|
|
75
78
|
})
|
|
76
79
|
|
|
77
|
-
const
|
|
78
|
-
name: '
|
|
79
|
-
sources: [
|
|
80
|
-
parameters: [
|
|
81
|
-
relations: [
|
|
80
|
+
const userProfileModule = defineGraphModule({
|
|
81
|
+
name: 'userProfile',
|
|
82
|
+
sources: [users, profiles],
|
|
83
|
+
parameters: [userId],
|
|
84
|
+
relations: [profileRelation],
|
|
82
85
|
constraints: [
|
|
83
86
|
constraint({
|
|
84
|
-
predicate: eq(
|
|
87
|
+
predicate: eq(users.field('id'), param(userId)),
|
|
85
88
|
}),
|
|
86
89
|
constraint({
|
|
87
|
-
predicate: exists(
|
|
90
|
+
predicate: exists(profiles, isNotNull(profiles.field('displayName'))),
|
|
88
91
|
}),
|
|
89
92
|
],
|
|
90
93
|
projection: [
|
|
91
94
|
project({
|
|
92
|
-
path: '
|
|
93
|
-
expression:
|
|
95
|
+
path: 'id',
|
|
96
|
+
expression: users.field('id'),
|
|
97
|
+
default: true,
|
|
98
|
+
}),
|
|
99
|
+
project({
|
|
100
|
+
path: 'profile.displayName',
|
|
101
|
+
expression: profiles.field('displayName'),
|
|
102
|
+
}),
|
|
103
|
+
],
|
|
104
|
+
orderings: [
|
|
105
|
+
ordering({
|
|
106
|
+
name: 'idAsc',
|
|
107
|
+
by: [asc(users.field('id'))],
|
|
94
108
|
default: true,
|
|
95
109
|
}),
|
|
96
110
|
],
|
|
97
111
|
})
|
|
98
112
|
|
|
99
113
|
const definition = defineGraph({
|
|
100
|
-
name: '
|
|
101
|
-
root:
|
|
102
|
-
modules: [
|
|
114
|
+
name: 'userProfile',
|
|
115
|
+
root: users,
|
|
116
|
+
modules: [userProfileModule],
|
|
103
117
|
})
|
|
104
118
|
|
|
105
119
|
const graph = registerDefinition(definition)
|
|
@@ -149,30 +163,30 @@ npm install @query-graph/core @query-graph/dsl-object
|
|
|
149
163
|
import { registerDefinition } from '@query-graph/core'
|
|
150
164
|
import { asc, defineGraph, eq, firstBy, project, relation, source } from '@query-graph/dsl-object'
|
|
151
165
|
|
|
152
|
-
const
|
|
153
|
-
const
|
|
166
|
+
const users = source('users', { id: 'int64' })
|
|
167
|
+
const profiles = source('profiles', {
|
|
154
168
|
id: 'int64',
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
userId: 'int64',
|
|
170
|
+
displayName: 'string',
|
|
157
171
|
})
|
|
158
172
|
|
|
159
173
|
const definition = defineGraph({
|
|
160
|
-
name: '
|
|
161
|
-
root:
|
|
162
|
-
sources: [
|
|
174
|
+
name: 'users',
|
|
175
|
+
root: users,
|
|
176
|
+
sources: [users, profiles],
|
|
163
177
|
relations: [
|
|
164
178
|
relation({
|
|
165
|
-
name: '
|
|
166
|
-
from:
|
|
167
|
-
to:
|
|
168
|
-
on: eq(
|
|
179
|
+
name: 'profile',
|
|
180
|
+
from: users,
|
|
181
|
+
to: profiles,
|
|
182
|
+
on: eq(users.field('id'), profiles.field('userId')),
|
|
169
183
|
cardinality: 'one',
|
|
170
|
-
selection: firstBy(asc(
|
|
184
|
+
selection: firstBy(asc(profiles.field('id'))),
|
|
171
185
|
}),
|
|
172
186
|
],
|
|
173
187
|
projection: [
|
|
174
|
-
project({ path: 'id', expression:
|
|
175
|
-
project({ path: '
|
|
188
|
+
project({ path: 'id', expression: users.field('id'), default: true }),
|
|
189
|
+
project({ path: 'profile.displayName', expression: profiles.field('displayName') }),
|
|
176
190
|
],
|
|
177
191
|
})
|
|
178
192
|
|
|
@@ -194,7 +208,7 @@ const graph = registerDefinition(definition)
|
|
|
194
208
|
|
|
195
209
|
```ts
|
|
196
210
|
constraint({
|
|
197
|
-
predicate: exists(
|
|
211
|
+
predicate: exists(memberships, eq(memberships.field('teamId'), param(teamId))),
|
|
198
212
|
})
|
|
199
213
|
```
|
|
200
214
|
|
|
@@ -213,7 +227,7 @@ Oracle и SQL Server compiler строят коррелированный `EXIST
|
|
|
213
227
|
|
|
214
228
|
```ts
|
|
215
229
|
constraint({
|
|
216
|
-
predicate: exists(
|
|
230
|
+
predicate: exists(permissions, permissionPredicate, { from: memberships }),
|
|
217
231
|
})
|
|
218
232
|
```
|
|
219
233
|
|
|
@@ -228,28 +242,38 @@ constraint({
|
|
|
228
242
|
`number | number[]`.
|
|
229
243
|
|
|
230
244
|
```ts
|
|
231
|
-
const
|
|
245
|
+
const users = source('users', {
|
|
246
|
+
id: 'int64',
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
const memberships = source('memberships', {
|
|
250
|
+
id: 'int64',
|
|
251
|
+
userId: 'int64',
|
|
252
|
+
teamId: 'int64',
|
|
253
|
+
})
|
|
254
|
+
|
|
255
|
+
const teamIds = requiredListParameter('teamIds', 'int64')
|
|
232
256
|
|
|
233
257
|
const definition = defineGraph({
|
|
234
|
-
name: '
|
|
235
|
-
root:
|
|
236
|
-
sources: [
|
|
237
|
-
parameters: [
|
|
258
|
+
name: 'usersByTeams',
|
|
259
|
+
root: users,
|
|
260
|
+
sources: [users, memberships],
|
|
261
|
+
parameters: [teamIds],
|
|
238
262
|
relations: [
|
|
239
263
|
relation({
|
|
240
|
-
name: '
|
|
241
|
-
from:
|
|
242
|
-
to:
|
|
243
|
-
on: eq(
|
|
264
|
+
name: 'memberships',
|
|
265
|
+
from: users,
|
|
266
|
+
to: memberships,
|
|
267
|
+
on: eq(users.field('id'), memberships.field('userId')),
|
|
244
268
|
cardinality: 'many',
|
|
245
269
|
}),
|
|
246
270
|
],
|
|
247
271
|
constraints: [
|
|
248
272
|
constraint({
|
|
249
|
-
predicate: exists(
|
|
273
|
+
predicate: exists(memberships, inParameter(memberships.field('teamId'), teamIds)),
|
|
250
274
|
}),
|
|
251
275
|
],
|
|
252
|
-
projection: [project({ path: 'id', expression:
|
|
276
|
+
projection: [project({ path: 'id', expression: users.field('id'), default: true })],
|
|
253
277
|
})
|
|
254
278
|
```
|
|
255
279
|
|
|
@@ -257,15 +281,15 @@ Operation передает обычный массив:
|
|
|
257
281
|
|
|
258
282
|
```ts
|
|
259
283
|
const statement = relationalGraph.compileSqlServer({
|
|
260
|
-
parameters: {
|
|
284
|
+
parameters: { teamIds: [12, 18, 24] },
|
|
261
285
|
})
|
|
262
286
|
```
|
|
263
287
|
|
|
264
288
|
Compiler разворачивает его в `IN (@p0, @p1, @p2)`. Каждый элемент получает
|
|
265
|
-
binding `{ parameter: '
|
|
289
|
+
binding `{ parameter: 'teamIds', index, scalarType: 'int64' }`, по которому
|
|
266
290
|
adapter исполнения берет значение из исходного массива. Rust проверяет каждый
|
|
267
291
|
элемент отдельно и возвращает путь ошибки наподобие
|
|
268
|
-
`parameters.
|
|
292
|
+
`parameters.teamIds[2]`.
|
|
269
293
|
|
|
270
294
|
Отсутствующий optional list отключает constraint с `when`. Переданный пустой
|
|
271
295
|
список остается присутствующим параметром и компилируется в ложный предикат
|
|
@@ -302,12 +326,12 @@ TypeScript выводит union имен из definition и подключенн
|
|
|
302
326
|
одной строки:
|
|
303
327
|
|
|
304
328
|
```ts
|
|
305
|
-
const
|
|
306
|
-
name: '
|
|
307
|
-
from:
|
|
308
|
-
to:
|
|
309
|
-
on: eq(
|
|
310
|
-
selection: firstBy(asc(
|
|
329
|
+
const profile = relation({
|
|
330
|
+
name: 'profile',
|
|
331
|
+
from: users,
|
|
332
|
+
to: profiles,
|
|
333
|
+
on: eq(users.field('id'), profiles.field('userId')),
|
|
334
|
+
selection: firstBy(asc(profiles.field('id'))),
|
|
311
335
|
})
|
|
312
336
|
```
|
|
313
337
|
|
|
@@ -327,46 +351,60 @@ SQL Server renderer использует `OUTER/CROSS APPLY` и `TOP (1)`, Oracl
|
|
|
327
351
|
SQL-конструкции `GROUP BY` и `HAVING`:
|
|
328
352
|
|
|
329
353
|
```ts
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
354
|
+
const teams = source('teams', {
|
|
355
|
+
id: 'int64',
|
|
356
|
+
workspaceId: 'int64',
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
const memberships = source('memberships', {
|
|
360
|
+
id: 'int64',
|
|
361
|
+
userId: 'int64',
|
|
362
|
+
teamId: 'int64',
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
const workspaceId = requiredParameter('workspaceId', 'int64')
|
|
366
|
+
const minimumMembers = requiredParameter('minimumMembers', 'int64')
|
|
367
|
+
|
|
368
|
+
const teamId = dimension({
|
|
369
|
+
path: 'teamId',
|
|
370
|
+
expression: teams.field('id'),
|
|
333
371
|
default: true,
|
|
334
372
|
})
|
|
335
373
|
|
|
336
|
-
const
|
|
337
|
-
path: '
|
|
338
|
-
expression: countDistinct(
|
|
374
|
+
const memberCount = measure({
|
|
375
|
+
path: 'memberCount',
|
|
376
|
+
expression: countDistinct(memberships.field('userId')),
|
|
339
377
|
default: true,
|
|
340
378
|
})
|
|
341
379
|
|
|
342
380
|
const definition = defineSummaryGraph({
|
|
343
|
-
name: '
|
|
344
|
-
root:
|
|
345
|
-
sources: [
|
|
346
|
-
parameters: [
|
|
381
|
+
name: 'teamSummary',
|
|
382
|
+
root: teams,
|
|
383
|
+
sources: [teams, memberships],
|
|
384
|
+
parameters: [workspaceId, minimumMembers],
|
|
347
385
|
relations: [
|
|
348
386
|
relation({
|
|
349
|
-
name: '
|
|
350
|
-
from:
|
|
351
|
-
to:
|
|
352
|
-
on: eq(
|
|
387
|
+
name: 'members',
|
|
388
|
+
from: teams,
|
|
389
|
+
to: memberships,
|
|
390
|
+
on: eq(teams.field('id'), memberships.field('teamId')),
|
|
353
391
|
cardinality: 'many',
|
|
354
392
|
}),
|
|
355
393
|
],
|
|
356
394
|
constraints: [
|
|
357
395
|
constraint({
|
|
358
|
-
predicate: eq(
|
|
396
|
+
predicate: eq(teams.field('workspaceId'), param(workspaceId)),
|
|
359
397
|
}),
|
|
360
398
|
constraint({
|
|
361
|
-
predicate: gte(
|
|
399
|
+
predicate: gte(memberCount, param(minimumMembers)),
|
|
362
400
|
}),
|
|
363
401
|
],
|
|
364
|
-
dimensions: [
|
|
365
|
-
measures: [
|
|
402
|
+
dimensions: [teamId],
|
|
403
|
+
measures: [memberCount],
|
|
366
404
|
orderings: [
|
|
367
405
|
ordering({
|
|
368
|
-
name: '
|
|
369
|
-
by: [desc(
|
|
406
|
+
name: 'memberCountDesc',
|
|
407
|
+
by: [desc(memberCount)],
|
|
370
408
|
default: true,
|
|
371
409
|
}),
|
|
372
410
|
],
|
|
@@ -443,10 +481,9 @@ TypeScript проверяет имена источников, полей и с
|
|
|
443
481
|
const relationalGraph = registerDefinition(definition).withRelationalMapping(mapping)
|
|
444
482
|
|
|
445
483
|
relationalGraph.compileSqlServer({
|
|
446
|
-
select: ['id', '
|
|
484
|
+
select: ['id', 'profile.displayName'],
|
|
447
485
|
parameters: {
|
|
448
|
-
|
|
449
|
-
personIds: [7, 11],
|
|
486
|
+
userId: 42,
|
|
450
487
|
},
|
|
451
488
|
})
|
|
452
489
|
```
|
|
@@ -494,18 +531,22 @@ Wire errors, semantic validation и SQL compilation имеют разные ве
|
|
|
494
531
|
```ts
|
|
495
532
|
const relationalGraph = graph.withRelationalMapping({
|
|
496
533
|
sources: {
|
|
497
|
-
|
|
534
|
+
users: {
|
|
535
|
+
table: {
|
|
536
|
+
schema: 'dbo',
|
|
537
|
+
name: 'users',
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
profiles: {
|
|
498
541
|
table: {
|
|
499
542
|
schema: 'dbo',
|
|
500
|
-
name: '
|
|
543
|
+
name: 'user_profiles',
|
|
501
544
|
},
|
|
502
545
|
columns: {
|
|
503
|
-
|
|
546
|
+
userId: 'user_id',
|
|
547
|
+
displayName: 'display_name',
|
|
504
548
|
},
|
|
505
549
|
},
|
|
506
|
-
value: {
|
|
507
|
-
table: 'ControllerObjectValue',
|
|
508
|
-
},
|
|
509
550
|
},
|
|
510
551
|
})
|
|
511
552
|
```
|
|
@@ -515,9 +556,9 @@ const relationalGraph = graph.withRelationalMapping({
|
|
|
515
556
|
|
|
516
557
|
```ts
|
|
517
558
|
const operation = {
|
|
518
|
-
select: ['
|
|
559
|
+
select: ['id', 'profile.displayName'],
|
|
519
560
|
parameters: {
|
|
520
|
-
|
|
561
|
+
userId: 42,
|
|
521
562
|
},
|
|
522
563
|
offset: 0,
|
|
523
564
|
limit: 25,
|
|
@@ -532,7 +573,7 @@ console.table(statement.relations)
|
|
|
532
573
|
```
|
|
533
574
|
|
|
534
575
|
`statement.bindings` связывает сгенерированные имена, например `p0`, с
|
|
535
|
-
логическими параметрами, например `
|
|
576
|
+
логическими параметрами, например `userId`, и содержит их scalar type.
|
|
536
577
|
Потребитель берет значения из `operation.parameters` и передает их
|
|
537
578
|
своему драйверу базы данных.
|
|
538
579
|
|
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.0.0
|
|
84
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
83
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
100
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
99
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
120
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
119
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
136
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
135
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
152
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
151
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
170
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
187
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
186
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
203
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
202
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
222
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
239
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
238
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
260
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
259
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
276
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
275
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
294
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
293
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
309
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
328
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
327
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
344
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
343
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
362
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
361
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
378
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
377
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
396
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
395
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
412
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
411
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
429
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
428
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
445
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
444
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
465
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
464
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
481
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
480
|
+
if (bindingPackageVersion !== '1.0.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.0.0 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.0.0
|
|
497
|
-
throw new Error(`Native binding package version mismatch, expected 1.0.0
|
|
496
|
+
if (bindingPackageVersion !== '1.0.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.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
498
498
|
}
|
|
499
499
|
return binding
|
|
500
500
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@query-graph/core",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Native query graph planner and SQL compiler for Node.js",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/*"
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
},
|
|
136
136
|
"packageManager": "yarn@4.13.0",
|
|
137
137
|
"optionalDependencies": {
|
|
138
|
-
"@query-graph/core-win32-x64-msvc": "1.0.0
|
|
139
|
-
"@query-graph/core-darwin-x64": "1.0.0
|
|
140
|
-
"@query-graph/core-linux-x64-gnu": "1.0.0
|
|
141
|
-
"@query-graph/core-darwin-arm64": "1.0.0
|
|
138
|
+
"@query-graph/core-win32-x64-msvc": "1.0.0",
|
|
139
|
+
"@query-graph/core-darwin-x64": "1.0.0",
|
|
140
|
+
"@query-graph/core-linux-x64-gnu": "1.0.0",
|
|
141
|
+
"@query-graph/core-darwin-arm64": "1.0.0"
|
|
142
142
|
}
|
|
143
143
|
}
|