@query-graph/core 1.1.7 → 1.1.9
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/docs/sql.md +47 -0
- package/docs/type-system.md +35 -1
- package/native.js +50 -50
- package/package.json +5 -5
- package/types/authoring.d.ts +5 -1
- package/types/model.d.ts +7 -1
- package/types/result.d.ts +78 -11
package/docs/sql.md
CHANGED
|
@@ -18,6 +18,53 @@ const graph = registerDefinition(definition).withRelationalMapping({
|
|
|
18
18
|
<code>withRelationalMappings</code>. Одинаковые mappings объединяются,
|
|
19
19
|
конфликтующие table/column names возвращают ошибку фазы mapping.
|
|
20
20
|
|
|
21
|
+
### Oracle Database Links
|
|
22
|
+
|
|
23
|
+
Для удалённой таблицы укажите <code>databaseLink</code> отдельно от имени:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const graph = registerDefinition(definition).withRelationalMapping({
|
|
27
|
+
sources: {
|
|
28
|
+
users: {
|
|
29
|
+
table: { schema: 'APP', name: 'Users', databaseLink: 'REMOTE_GATE' },
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Oracle скомпилирует адрес как <code>"APP"."Users"@REMOTE_GATE</code>.
|
|
36
|
+
Schema и name экранируются как идентификаторы, а ссылка добавляется вне кавычек.
|
|
37
|
+
Без schema получится <code>"Users"@REMOTE_GATE</code>; без databaseLink
|
|
38
|
+
сохраняется прежний локальный адрес. Строка <code>'Users@REMOTE_GATE'</code>
|
|
39
|
+
по-прежнему означает одно имя таблицы, а не удалённый адрес.
|
|
40
|
+
|
|
41
|
+
Поддерживается форма <code>LINK[.DOMAIN...][@CONNECTION]</code>, например
|
|
42
|
+
<code>REMOTE.EXAMPLE.COM@READER</code>. Имя должно содержать 1–128 ASCII-байт,
|
|
43
|
+
LINK и CONNECTION начинаются с латинской буквы; каждая непустая часть допускает
|
|
44
|
+
только буквы, цифры, `_`, `$` и `#`.
|
|
45
|
+
Не передавайте ведущий <code>@</code>, кавычки, пробелы или SQL-фрагменты.
|
|
46
|
+
Неверное имя отклоняется при подключении mapping с диагностикой
|
|
47
|
+
<code>invalidDatabaseLink</code> и путём
|
|
48
|
+
<code>sources.<source>.table.databaseLink</code>.
|
|
49
|
+
|
|
50
|
+
Регистр ссылки нечувствителен: компилятор выводит её в верхнем регистре,
|
|
51
|
+
а объединение mappings считает <code>remote_gate</code> и
|
|
52
|
+
<code>REMOTE_GATE</code> одной ссылкой. Локальная и удалённая таблицы, а также
|
|
53
|
+
таблицы через разные ссылки конфликтуют. Это не меняет сравнение schema/name.
|
|
54
|
+
Правила Oracle описаны в
|
|
55
|
+
[References to Objects in Remote Databases](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Syntax-for-Schema-Objects-and-Parts-in-SQL-Statements.html).
|
|
56
|
+
|
|
57
|
+
SQL Server отклоняет <code>databaseLink</code> с диагностикой
|
|
58
|
+
<code>unsupportedTableQualifier</code>, если операция обращается к этому source.
|
|
59
|
+
Неиспользуемые optional relations по-прежнему не входят в SQL.
|
|
60
|
+
Oracle по-прежнему не поддерживает qualifier <code>catalog</code>.
|
|
61
|
+
|
|
62
|
+
Ссылки работают в корневом source, JOIN, exists и firstBy через общий рендеринг
|
|
63
|
+
таблиц; bindings и projection metadata не меняются. Mapping выбирается при
|
|
64
|
+
инициализации приложения, не из пользовательских operation parameters.
|
|
65
|
+
Библиотека не создаёт DB link и не проверяет доступ к удалённой БД: это остаётся
|
|
66
|
+
ответственностью инфраструктуры потребителя.
|
|
67
|
+
|
|
21
68
|
## Диалекты
|
|
22
69
|
|
|
23
70
|
```ts
|
package/docs/type-system.md
CHANGED
|
@@ -118,10 +118,44 @@ type Row = ResultOf<typeof definition, typeof operation>
|
|
|
118
118
|
Для composed graph выбранные batch relations добавляются как массивы либо
|
|
119
119
|
nullable объекты согласно cardinality.
|
|
120
120
|
|
|
121
|
+
Если объект объявлен через прямое поле источника:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
projectObject({ path: 'profile', presence: profiles.field('id') })
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
то внутри существующего `profile` поля этого источника больше не получают
|
|
128
|
+
`null` из-за optional JOIN. Например, для non-null `id` и `name` и nullable
|
|
129
|
+
`nickname` результат будет:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
type Row = {
|
|
133
|
+
profile: {
|
|
134
|
+
id: number | string
|
|
135
|
+
name: string
|
|
136
|
+
nickname: string | null
|
|
137
|
+
} | null
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Сам объект остается nullable. Nullable-колонки, поля других sources и поля
|
|
142
|
+
вне этого объекта сохраняют прежнюю nullability. Вложенные объекты учитывают
|
|
143
|
+
presence родителей, но наличие родителя не гарантирует наличие другого
|
|
144
|
+
источника, даже если связь с ним объявлена `required`.
|
|
145
|
+
|
|
146
|
+
Вычисляемый presence, например `coalesce(profiles.field('id'), 0)` или
|
|
147
|
+
`isNotNull(profiles.field('id'))`, не подтверждает наличие источника.
|
|
148
|
+
Если тип не позволяет однозначно определить source или путь объекта,
|
|
149
|
+
уточнение также не применяется.
|
|
150
|
+
|
|
151
|
+
Это уточнение относится к результату после обработки `statement.objects`
|
|
152
|
+
потребителем. SQL и `statement.columns[].nullable` не меняются: до сборки
|
|
153
|
+
вложенных объектов отсутствующая строка JOIN по-прежнему дает NULL-колонки.
|
|
154
|
+
|
|
121
155
|
Driver может заменить представление scalar values:
|
|
122
156
|
|
|
123
157
|
```ts
|
|
124
|
-
interface DriverScalars extends DefaultScalarOutputTypeMap {
|
|
158
|
+
interface DriverScalars extends Omit<DefaultScalarOutputTypeMap, 'int64' | 'decimal' | 'dateTime'> {
|
|
125
159
|
int64: bigint
|
|
126
160
|
decimal: string
|
|
127
161
|
dateTime: Date
|
package/native.js
CHANGED
|
@@ -81,12 +81,12 @@ function requireNative() {
|
|
|
81
81
|
const binding = require('@query-graph/core-android-arm64')
|
|
82
82
|
const bindingPackageVersion = require('@query-graph/core-android-arm64/package.json').version
|
|
83
83
|
if (
|
|
84
|
-
bindingPackageVersion !== '1.1.
|
|
84
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
85
85
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
86
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
87
87
|
) {
|
|
88
88
|
throw new Error(
|
|
89
|
-
`Native binding package version mismatch, expected 1.1.
|
|
89
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
90
|
)
|
|
91
91
|
}
|
|
92
92
|
return binding
|
|
@@ -103,12 +103,12 @@ function requireNative() {
|
|
|
103
103
|
const binding = require('@query-graph/core-android-arm-eabi')
|
|
104
104
|
const bindingPackageVersion = require('@query-graph/core-android-arm-eabi/package.json').version
|
|
105
105
|
if (
|
|
106
|
-
bindingPackageVersion !== '1.1.
|
|
106
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
107
107
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
108
108
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
109
109
|
) {
|
|
110
110
|
throw new Error(
|
|
111
|
-
`Native binding package version mismatch, expected 1.1.
|
|
111
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
112
112
|
)
|
|
113
113
|
}
|
|
114
114
|
return binding
|
|
@@ -129,12 +129,12 @@ function requireNative() {
|
|
|
129
129
|
const binding = require('@query-graph/core-win32-x64-msvc')
|
|
130
130
|
const bindingPackageVersion = require('@query-graph/core-win32-x64-msvc/package.json').version
|
|
131
131
|
if (
|
|
132
|
-
bindingPackageVersion !== '1.1.
|
|
132
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
133
133
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
134
134
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
135
135
|
) {
|
|
136
136
|
throw new Error(
|
|
137
|
-
`Native binding package version mismatch, expected 1.1.
|
|
137
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
140
|
return binding
|
|
@@ -151,12 +151,12 @@ function requireNative() {
|
|
|
151
151
|
const binding = require('@query-graph/core-win32-ia32-msvc')
|
|
152
152
|
const bindingPackageVersion = require('@query-graph/core-win32-ia32-msvc/package.json').version
|
|
153
153
|
if (
|
|
154
|
-
bindingPackageVersion !== '1.1.
|
|
154
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
155
155
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
156
156
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
157
157
|
) {
|
|
158
158
|
throw new Error(
|
|
159
|
-
`Native binding package version mismatch, expected 1.1.
|
|
159
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
160
160
|
)
|
|
161
161
|
}
|
|
162
162
|
return binding
|
|
@@ -173,12 +173,12 @@ function requireNative() {
|
|
|
173
173
|
const binding = require('@query-graph/core-win32-arm64-msvc')
|
|
174
174
|
const bindingPackageVersion = require('@query-graph/core-win32-arm64-msvc/package.json').version
|
|
175
175
|
if (
|
|
176
|
-
bindingPackageVersion !== '1.1.
|
|
176
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
177
177
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
178
178
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
179
179
|
) {
|
|
180
180
|
throw new Error(
|
|
181
|
-
`Native binding package version mismatch, expected 1.1.
|
|
181
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
182
182
|
)
|
|
183
183
|
}
|
|
184
184
|
return binding
|
|
@@ -198,12 +198,12 @@ function requireNative() {
|
|
|
198
198
|
const binding = require('@query-graph/core-darwin-universal')
|
|
199
199
|
const bindingPackageVersion = require('@query-graph/core-darwin-universal/package.json').version
|
|
200
200
|
if (
|
|
201
|
-
bindingPackageVersion !== '1.1.
|
|
201
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
202
202
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
203
203
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
204
204
|
) {
|
|
205
205
|
throw new Error(
|
|
206
|
-
`Native binding package version mismatch, expected 1.1.
|
|
206
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
207
207
|
)
|
|
208
208
|
}
|
|
209
209
|
return binding
|
|
@@ -220,12 +220,12 @@ function requireNative() {
|
|
|
220
220
|
const binding = require('@query-graph/core-darwin-x64')
|
|
221
221
|
const bindingPackageVersion = require('@query-graph/core-darwin-x64/package.json').version
|
|
222
222
|
if (
|
|
223
|
-
bindingPackageVersion !== '1.1.
|
|
223
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
224
224
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
225
225
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
226
226
|
) {
|
|
227
227
|
throw new Error(
|
|
228
|
-
`Native binding package version mismatch, expected 1.1.
|
|
228
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
229
229
|
)
|
|
230
230
|
}
|
|
231
231
|
return binding
|
|
@@ -242,12 +242,12 @@ function requireNative() {
|
|
|
242
242
|
const binding = require('@query-graph/core-darwin-arm64')
|
|
243
243
|
const bindingPackageVersion = require('@query-graph/core-darwin-arm64/package.json').version
|
|
244
244
|
if (
|
|
245
|
-
bindingPackageVersion !== '1.1.
|
|
245
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
246
246
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
247
247
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
248
248
|
) {
|
|
249
249
|
throw new Error(
|
|
250
|
-
`Native binding package version mismatch, expected 1.1.
|
|
250
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
251
251
|
)
|
|
252
252
|
}
|
|
253
253
|
return binding
|
|
@@ -268,12 +268,12 @@ function requireNative() {
|
|
|
268
268
|
const binding = require('@query-graph/core-freebsd-x64')
|
|
269
269
|
const bindingPackageVersion = require('@query-graph/core-freebsd-x64/package.json').version
|
|
270
270
|
if (
|
|
271
|
-
bindingPackageVersion !== '1.1.
|
|
271
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
272
272
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
273
273
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
274
274
|
) {
|
|
275
275
|
throw new Error(
|
|
276
|
-
`Native binding package version mismatch, expected 1.1.
|
|
276
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
277
277
|
)
|
|
278
278
|
}
|
|
279
279
|
return binding
|
|
@@ -290,12 +290,12 @@ function requireNative() {
|
|
|
290
290
|
const binding = require('@query-graph/core-freebsd-arm64')
|
|
291
291
|
const bindingPackageVersion = require('@query-graph/core-freebsd-arm64/package.json').version
|
|
292
292
|
if (
|
|
293
|
-
bindingPackageVersion !== '1.1.
|
|
293
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
294
294
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
295
295
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
296
296
|
) {
|
|
297
297
|
throw new Error(
|
|
298
|
-
`Native binding package version mismatch, expected 1.1.
|
|
298
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
299
299
|
)
|
|
300
300
|
}
|
|
301
301
|
return binding
|
|
@@ -317,12 +317,12 @@ function requireNative() {
|
|
|
317
317
|
const binding = require('@query-graph/core-linux-x64-musl')
|
|
318
318
|
const bindingPackageVersion = require('@query-graph/core-linux-x64-musl/package.json').version
|
|
319
319
|
if (
|
|
320
|
-
bindingPackageVersion !== '1.1.
|
|
320
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
321
321
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
322
322
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
323
323
|
) {
|
|
324
324
|
throw new Error(
|
|
325
|
-
`Native binding package version mismatch, expected 1.1.
|
|
325
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
326
326
|
)
|
|
327
327
|
}
|
|
328
328
|
return binding
|
|
@@ -339,12 +339,12 @@ function requireNative() {
|
|
|
339
339
|
const binding = require('@query-graph/core-linux-x64-gnu')
|
|
340
340
|
const bindingPackageVersion = require('@query-graph/core-linux-x64-gnu/package.json').version
|
|
341
341
|
if (
|
|
342
|
-
bindingPackageVersion !== '1.1.
|
|
342
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
343
343
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
344
344
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
345
345
|
) {
|
|
346
346
|
throw new Error(
|
|
347
|
-
`Native binding package version mismatch, expected 1.1.
|
|
347
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
348
348
|
)
|
|
349
349
|
}
|
|
350
350
|
return binding
|
|
@@ -363,12 +363,12 @@ function requireNative() {
|
|
|
363
363
|
const binding = require('@query-graph/core-linux-arm64-musl')
|
|
364
364
|
const bindingPackageVersion = require('@query-graph/core-linux-arm64-musl/package.json').version
|
|
365
365
|
if (
|
|
366
|
-
bindingPackageVersion !== '1.1.
|
|
366
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
367
367
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
368
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
369
369
|
) {
|
|
370
370
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 1.1.
|
|
371
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
372
|
)
|
|
373
373
|
}
|
|
374
374
|
return binding
|
|
@@ -385,12 +385,12 @@ function requireNative() {
|
|
|
385
385
|
const binding = require('@query-graph/core-linux-arm64-gnu')
|
|
386
386
|
const bindingPackageVersion = require('@query-graph/core-linux-arm64-gnu/package.json').version
|
|
387
387
|
if (
|
|
388
|
-
bindingPackageVersion !== '1.1.
|
|
388
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
389
389
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
390
390
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
391
391
|
) {
|
|
392
392
|
throw new Error(
|
|
393
|
-
`Native binding package version mismatch, expected 1.1.
|
|
393
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
394
394
|
)
|
|
395
395
|
}
|
|
396
396
|
return binding
|
|
@@ -409,12 +409,12 @@ function requireNative() {
|
|
|
409
409
|
const binding = require('@query-graph/core-linux-arm-musleabihf')
|
|
410
410
|
const bindingPackageVersion = require('@query-graph/core-linux-arm-musleabihf/package.json').version
|
|
411
411
|
if (
|
|
412
|
-
bindingPackageVersion !== '1.1.
|
|
412
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
413
413
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
414
414
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
415
415
|
) {
|
|
416
416
|
throw new Error(
|
|
417
|
-
`Native binding package version mismatch, expected 1.1.
|
|
417
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
418
418
|
)
|
|
419
419
|
}
|
|
420
420
|
return binding
|
|
@@ -431,12 +431,12 @@ function requireNative() {
|
|
|
431
431
|
const binding = require('@query-graph/core-linux-arm-gnueabihf')
|
|
432
432
|
const bindingPackageVersion = require('@query-graph/core-linux-arm-gnueabihf/package.json').version
|
|
433
433
|
if (
|
|
434
|
-
bindingPackageVersion !== '1.1.
|
|
434
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
435
435
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
436
436
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
437
437
|
) {
|
|
438
438
|
throw new Error(
|
|
439
|
-
`Native binding package version mismatch, expected 1.1.
|
|
439
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
440
440
|
)
|
|
441
441
|
}
|
|
442
442
|
return binding
|
|
@@ -455,12 +455,12 @@ function requireNative() {
|
|
|
455
455
|
const binding = require('@query-graph/core-linux-loong64-musl')
|
|
456
456
|
const bindingPackageVersion = require('@query-graph/core-linux-loong64-musl/package.json').version
|
|
457
457
|
if (
|
|
458
|
-
bindingPackageVersion !== '1.1.
|
|
458
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
459
459
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
460
460
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
461
461
|
) {
|
|
462
462
|
throw new Error(
|
|
463
|
-
`Native binding package version mismatch, expected 1.1.
|
|
463
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
464
464
|
)
|
|
465
465
|
}
|
|
466
466
|
return binding
|
|
@@ -477,12 +477,12 @@ function requireNative() {
|
|
|
477
477
|
const binding = require('@query-graph/core-linux-loong64-gnu')
|
|
478
478
|
const bindingPackageVersion = require('@query-graph/core-linux-loong64-gnu/package.json').version
|
|
479
479
|
if (
|
|
480
|
-
bindingPackageVersion !== '1.1.
|
|
480
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
481
481
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
482
482
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
483
483
|
) {
|
|
484
484
|
throw new Error(
|
|
485
|
-
`Native binding package version mismatch, expected 1.1.
|
|
485
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
486
486
|
)
|
|
487
487
|
}
|
|
488
488
|
return binding
|
|
@@ -501,12 +501,12 @@ function requireNative() {
|
|
|
501
501
|
const binding = require('@query-graph/core-linux-riscv64-musl')
|
|
502
502
|
const bindingPackageVersion = require('@query-graph/core-linux-riscv64-musl/package.json').version
|
|
503
503
|
if (
|
|
504
|
-
bindingPackageVersion !== '1.1.
|
|
504
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
505
505
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
506
506
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
507
507
|
) {
|
|
508
508
|
throw new Error(
|
|
509
|
-
`Native binding package version mismatch, expected 1.1.
|
|
509
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
510
510
|
)
|
|
511
511
|
}
|
|
512
512
|
return binding
|
|
@@ -523,12 +523,12 @@ function requireNative() {
|
|
|
523
523
|
const binding = require('@query-graph/core-linux-riscv64-gnu')
|
|
524
524
|
const bindingPackageVersion = require('@query-graph/core-linux-riscv64-gnu/package.json').version
|
|
525
525
|
if (
|
|
526
|
-
bindingPackageVersion !== '1.1.
|
|
526
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
527
527
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
528
528
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
529
529
|
) {
|
|
530
530
|
throw new Error(
|
|
531
|
-
`Native binding package version mismatch, expected 1.1.
|
|
531
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
532
532
|
)
|
|
533
533
|
}
|
|
534
534
|
return binding
|
|
@@ -546,12 +546,12 @@ function requireNative() {
|
|
|
546
546
|
const binding = require('@query-graph/core-linux-ppc64-gnu')
|
|
547
547
|
const bindingPackageVersion = require('@query-graph/core-linux-ppc64-gnu/package.json').version
|
|
548
548
|
if (
|
|
549
|
-
bindingPackageVersion !== '1.1.
|
|
549
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
550
550
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
551
551
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
552
552
|
) {
|
|
553
553
|
throw new Error(
|
|
554
|
-
`Native binding package version mismatch, expected 1.1.
|
|
554
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
555
555
|
)
|
|
556
556
|
}
|
|
557
557
|
return binding
|
|
@@ -568,12 +568,12 @@ function requireNative() {
|
|
|
568
568
|
const binding = require('@query-graph/core-linux-s390x-gnu')
|
|
569
569
|
const bindingPackageVersion = require('@query-graph/core-linux-s390x-gnu/package.json').version
|
|
570
570
|
if (
|
|
571
|
-
bindingPackageVersion !== '1.1.
|
|
571
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
572
572
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
573
573
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
574
574
|
) {
|
|
575
575
|
throw new Error(
|
|
576
|
-
`Native binding package version mismatch, expected 1.1.
|
|
576
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
577
577
|
)
|
|
578
578
|
}
|
|
579
579
|
return binding
|
|
@@ -594,12 +594,12 @@ function requireNative() {
|
|
|
594
594
|
const binding = require('@query-graph/core-openharmony-arm64')
|
|
595
595
|
const bindingPackageVersion = require('@query-graph/core-openharmony-arm64/package.json').version
|
|
596
596
|
if (
|
|
597
|
-
bindingPackageVersion !== '1.1.
|
|
597
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
598
598
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
599
599
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
600
600
|
) {
|
|
601
601
|
throw new Error(
|
|
602
|
-
`Native binding package version mismatch, expected 1.1.
|
|
602
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
603
603
|
)
|
|
604
604
|
}
|
|
605
605
|
return binding
|
|
@@ -616,12 +616,12 @@ function requireNative() {
|
|
|
616
616
|
const binding = require('@query-graph/core-openharmony-x64')
|
|
617
617
|
const bindingPackageVersion = require('@query-graph/core-openharmony-x64/package.json').version
|
|
618
618
|
if (
|
|
619
|
-
bindingPackageVersion !== '1.1.
|
|
619
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
620
620
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
621
621
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
622
622
|
) {
|
|
623
623
|
throw new Error(
|
|
624
|
-
`Native binding package version mismatch, expected 1.1.
|
|
624
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
625
625
|
)
|
|
626
626
|
}
|
|
627
627
|
return binding
|
|
@@ -638,12 +638,12 @@ function requireNative() {
|
|
|
638
638
|
const binding = require('@query-graph/core-openharmony-arm')
|
|
639
639
|
const bindingPackageVersion = require('@query-graph/core-openharmony-arm/package.json').version
|
|
640
640
|
if (
|
|
641
|
-
bindingPackageVersion !== '1.1.
|
|
641
|
+
bindingPackageVersion !== '1.1.9' &&
|
|
642
642
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
643
643
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
|
|
644
644
|
) {
|
|
645
645
|
throw new Error(
|
|
646
|
-
`Native binding package version mismatch, expected 1.1.
|
|
646
|
+
`Native binding package version mismatch, expected 1.1.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
647
647
|
)
|
|
648
648
|
}
|
|
649
649
|
return binding
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@query-graph/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Native query graph planner and SQL compiler for Node.js",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/*"
|
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
},
|
|
142
142
|
"packageManager": "yarn@4.13.0",
|
|
143
143
|
"optionalDependencies": {
|
|
144
|
-
"@query-graph/core-win32-x64-msvc": "1.1.
|
|
145
|
-
"@query-graph/core-darwin-x64": "1.1.
|
|
146
|
-
"@query-graph/core-linux-x64-gnu": "1.1.
|
|
147
|
-
"@query-graph/core-darwin-arm64": "1.1.
|
|
144
|
+
"@query-graph/core-win32-x64-msvc": "1.1.9",
|
|
145
|
+
"@query-graph/core-darwin-x64": "1.1.9",
|
|
146
|
+
"@query-graph/core-linux-x64-gnu": "1.1.9",
|
|
147
|
+
"@query-graph/core-darwin-arm64": "1.1.9"
|
|
148
148
|
}
|
|
149
149
|
}
|
package/types/authoring.d.ts
CHANGED
|
@@ -529,7 +529,11 @@ export function project<
|
|
|
529
529
|
|
|
530
530
|
export function projectObject<const Path extends string | readonly string[], const Value extends ExpressionInput>(
|
|
531
531
|
configuration: ProjectionObjectConfiguration<Path, Value>,
|
|
532
|
-
): TypedProjectionObject<
|
|
532
|
+
): TypedProjectionObject<
|
|
533
|
+
ConfigurationPath<Path>,
|
|
534
|
+
InputNullability<Value>,
|
|
535
|
+
[Value] extends [FieldExpression<infer Source, infer _Field>] ? Source : string
|
|
536
|
+
>
|
|
533
537
|
|
|
534
538
|
export function dimension<
|
|
535
539
|
const Path extends string | readonly string[],
|
package/types/model.d.ts
CHANGED
|
@@ -255,6 +255,7 @@ declare const typedProjectionNullabilityType: unique symbol
|
|
|
255
255
|
declare const typedProjectionDefaultType: unique symbol
|
|
256
256
|
declare const typedProjectionObjectPathType: unique symbol
|
|
257
257
|
declare const typedProjectionObjectNullabilityType: unique symbol
|
|
258
|
+
declare const typedProjectionObjectPresenceSourceType: unique symbol
|
|
258
259
|
|
|
259
260
|
export interface ProjectionTypeMetadata<
|
|
260
261
|
Path extends string = string,
|
|
@@ -271,15 +272,18 @@ export interface ProjectionTypeMetadata<
|
|
|
271
272
|
export interface ProjectionObjectTypeMetadata<
|
|
272
273
|
Path extends string = string,
|
|
273
274
|
Nullability extends NullabilityExpression = NullabilityExpression,
|
|
275
|
+
PresenceSource extends string = string,
|
|
274
276
|
> {
|
|
275
277
|
readonly [typedProjectionObjectPathType]: Path
|
|
276
278
|
readonly [typedProjectionObjectNullabilityType]: Nullability
|
|
279
|
+
readonly [typedProjectionObjectPresenceSourceType]: PresenceSource
|
|
277
280
|
}
|
|
278
281
|
|
|
279
282
|
export type TypedProjectionObject<
|
|
280
283
|
Path extends string = string,
|
|
281
284
|
Nullability extends NullabilityExpression = NullabilityExpression,
|
|
282
|
-
|
|
285
|
+
PresenceSource extends string = string,
|
|
286
|
+
> = ProjectionObjectDefinition<Path, Nullability> & ProjectionObjectTypeMetadata<Path, Nullability, PresenceSource>
|
|
283
287
|
|
|
284
288
|
export type TypedProjectionField<
|
|
285
289
|
Path extends string = string,
|
|
@@ -435,6 +439,8 @@ export type TableName =
|
|
|
435
439
|
catalog?: string
|
|
436
440
|
schema?: string
|
|
437
441
|
name: string
|
|
442
|
+
/** Oracle database link name, without the leading @. Not supported by SQL Server. */
|
|
443
|
+
databaseLink?: string
|
|
438
444
|
}
|
|
439
445
|
|
|
440
446
|
export interface SourceMapping {
|
package/types/result.d.ts
CHANGED
|
@@ -25,6 +25,22 @@ import type { BatchQuery, BatchRelation, ComposedQueryGraph } from './compositio
|
|
|
25
25
|
|
|
26
26
|
type BooleanOr<Value extends boolean> = true extends Value ? true : false
|
|
27
27
|
|
|
28
|
+
type IsUnion<Value, Whole = Value> = Value extends unknown ? ([Whole] extends [Value] ? false : true) : never
|
|
29
|
+
|
|
30
|
+
type SingleStringLiteral<Value extends string> = string extends Value
|
|
31
|
+
? never
|
|
32
|
+
: true extends IsUnion<Value>
|
|
33
|
+
? never
|
|
34
|
+
: Value
|
|
35
|
+
|
|
36
|
+
type SourceIsPresent<Source extends string, PresentSources extends string> = [SingleStringLiteral<Source>] extends [
|
|
37
|
+
never,
|
|
38
|
+
]
|
|
39
|
+
? false
|
|
40
|
+
: [Source] extends [PresentSources]
|
|
41
|
+
? true
|
|
42
|
+
: false
|
|
43
|
+
|
|
28
44
|
type BatchQueryGraph<Query extends BatchQuery> =
|
|
29
45
|
Query extends BatchQuery<infer Child, infer _KeyPath, infer _KeyParameter> ? Child : never
|
|
30
46
|
|
|
@@ -116,6 +132,7 @@ type CombineAllNullability<Left extends boolean, Right extends boolean> = [Left]
|
|
|
116
132
|
type EvaluateAnyNullability<
|
|
117
133
|
Definition extends GraphDefinitionInput,
|
|
118
134
|
Values,
|
|
135
|
+
PresentSources extends string,
|
|
119
136
|
Depth extends readonly unknown[],
|
|
120
137
|
> = Values extends readonly []
|
|
121
138
|
? false
|
|
@@ -124,16 +141,17 @@ type EvaluateAnyNullability<
|
|
|
124
141
|
...infer Rest extends readonly NullabilityExpression[],
|
|
125
142
|
]
|
|
126
143
|
? BooleanOr<
|
|
127
|
-
| EvaluateNullability<Definition, First, readonly [...Depth, unknown]>
|
|
128
|
-
| EvaluateAnyNullability<Definition, Rest, readonly [...Depth, unknown]>
|
|
144
|
+
| EvaluateNullability<Definition, First, PresentSources, readonly [...Depth, unknown]>
|
|
145
|
+
| EvaluateAnyNullability<Definition, Rest, PresentSources, readonly [...Depth, unknown]>
|
|
129
146
|
>
|
|
130
147
|
: Values extends readonly (infer Value extends NullabilityExpression)[]
|
|
131
|
-
? BooleanOr<EvaluateNullability<Definition, Value, readonly [...Depth, unknown]>>
|
|
148
|
+
? BooleanOr<EvaluateNullability<Definition, Value, PresentSources, readonly [...Depth, unknown]>>
|
|
132
149
|
: boolean
|
|
133
150
|
|
|
134
151
|
type EvaluateAllNullability<
|
|
135
152
|
Definition extends GraphDefinitionInput,
|
|
136
153
|
Values,
|
|
154
|
+
PresentSources extends string,
|
|
137
155
|
Depth extends readonly unknown[],
|
|
138
156
|
> = Values extends readonly []
|
|
139
157
|
? true
|
|
@@ -142,14 +160,15 @@ type EvaluateAllNullability<
|
|
|
142
160
|
...infer Rest extends readonly NullabilityExpression[],
|
|
143
161
|
]
|
|
144
162
|
? CombineAllNullability<
|
|
145
|
-
EvaluateNullability<Definition, First, readonly [...Depth, unknown]>,
|
|
146
|
-
EvaluateAllNullability<Definition, Rest, readonly [...Depth, unknown]>
|
|
163
|
+
EvaluateNullability<Definition, First, PresentSources, readonly [...Depth, unknown]>,
|
|
164
|
+
EvaluateAllNullability<Definition, Rest, PresentSources, readonly [...Depth, unknown]>
|
|
147
165
|
>
|
|
148
166
|
: boolean
|
|
149
167
|
|
|
150
168
|
type EvaluateNullability<
|
|
151
169
|
Definition extends GraphDefinitionInput,
|
|
152
170
|
Formula extends NullabilityExpression,
|
|
171
|
+
PresentSources extends string = never,
|
|
153
172
|
Depth extends readonly unknown[] = readonly [],
|
|
154
173
|
> = Depth['length'] extends 16
|
|
155
174
|
? boolean
|
|
@@ -158,11 +177,16 @@ type EvaluateNullability<
|
|
|
158
177
|
: Formula extends boolean
|
|
159
178
|
? Formula
|
|
160
179
|
: Formula extends SourceFieldNullability<infer Source, infer FieldNullable>
|
|
161
|
-
? BooleanOr<
|
|
180
|
+
? BooleanOr<
|
|
181
|
+
| FieldNullable
|
|
182
|
+
| (SourceIsPresent<Source, PresentSources> extends true
|
|
183
|
+
? false
|
|
184
|
+
: SourceOuterNullable<Definition, Source, never, Depth>)
|
|
185
|
+
>
|
|
162
186
|
: Formula extends AnyNullability<infer Values>
|
|
163
|
-
? EvaluateAnyNullability<Definition, Values, Depth>
|
|
187
|
+
? EvaluateAnyNullability<Definition, Values, PresentSources, Depth>
|
|
164
188
|
: Formula extends AllNullability<infer Values>
|
|
165
|
-
? EvaluateAllNullability<Definition, Values, Depth>
|
|
189
|
+
? EvaluateAllNullability<Definition, Values, PresentSources, Depth>
|
|
166
190
|
: boolean
|
|
167
191
|
|
|
168
192
|
type ProjectionFieldPath<Field> =
|
|
@@ -186,16 +210,59 @@ type ProjectionObjectNullability<Object> =
|
|
|
186
210
|
? Nullability
|
|
187
211
|
: boolean
|
|
188
212
|
|
|
213
|
+
// Only a direct field presence proves its source exists, and only inside that object.
|
|
214
|
+
type ProjectionObjectPresenceSource<Object> = [Object] extends [
|
|
215
|
+
ProjectionObjectTypeMetadata<infer _Path, infer _Nullability, infer Source>,
|
|
216
|
+
]
|
|
217
|
+
? SingleStringLiteral<Source>
|
|
218
|
+
: never
|
|
219
|
+
|
|
220
|
+
type EnclosingObjectPath<Object, Path extends string> = Object extends ProjectionObjectDefinition
|
|
221
|
+
? Path extends `${SingleStringLiteral<ProjectionObjectPath<Object>>}.${string}`
|
|
222
|
+
? SingleStringLiteral<ProjectionObjectPath<Object>>
|
|
223
|
+
: never
|
|
224
|
+
: never
|
|
225
|
+
|
|
226
|
+
type ProjectionObjectAtPath<Object, Path extends string> = Object extends ProjectionObjectDefinition
|
|
227
|
+
? ProjectionObjectPath<Object> extends Path
|
|
228
|
+
? Object
|
|
229
|
+
: never
|
|
230
|
+
: never
|
|
231
|
+
|
|
232
|
+
type PresentSourcesAtPath<
|
|
233
|
+
Definition extends GraphDefinitionInput,
|
|
234
|
+
Path extends string,
|
|
235
|
+
ObjectPath = EnclosingObjectPath<DefinitionProjectionObject<Definition>, Path>,
|
|
236
|
+
> = [SingleStringLiteral<Path>] extends [never]
|
|
237
|
+
? never
|
|
238
|
+
: ObjectPath extends string
|
|
239
|
+
? ProjectionObjectPresenceSource<ProjectionObjectAtPath<DefinitionProjectionObject<Definition>, ObjectPath>>
|
|
240
|
+
: never
|
|
241
|
+
|
|
189
242
|
type ProjectionObjectIsNullable<Definition extends GraphDefinitionInput, Object> =
|
|
190
|
-
true extends EvaluateNullability<
|
|
243
|
+
true extends EvaluateNullability<
|
|
244
|
+
Definition,
|
|
245
|
+
ProjectionObjectNullability<Object>,
|
|
246
|
+
PresentSourcesAtPath<Definition, ProjectionObjectPath<Object>>
|
|
247
|
+
>
|
|
248
|
+
? true
|
|
249
|
+
: false
|
|
191
250
|
|
|
192
251
|
type ProjectionFieldValue<Definition extends GraphDefinitionInput, Field, TypeMap extends ScalarOutputTypeMap> =
|
|
193
252
|
Field extends ProjectionTypeMetadata<infer _Path, infer Type, infer Nullability, infer _SelectedByDefault>
|
|
194
|
-
? true extends EvaluateNullability<
|
|
253
|
+
? true extends EvaluateNullability<
|
|
254
|
+
Definition,
|
|
255
|
+
Nullability,
|
|
256
|
+
PresentSourcesAtPath<Definition, ProjectionFieldPath<Field>>
|
|
257
|
+
>
|
|
195
258
|
? TypeMap[Type] | null
|
|
196
259
|
: TypeMap[Type]
|
|
197
260
|
: Field extends ProjectionFieldDefinition<infer _Path, infer Type, infer Nullability, infer _SelectedByDefault>
|
|
198
|
-
? true extends EvaluateNullability<
|
|
261
|
+
? true extends EvaluateNullability<
|
|
262
|
+
Definition,
|
|
263
|
+
Nullability,
|
|
264
|
+
PresentSourcesAtPath<Definition, ProjectionFieldPath<Field>>
|
|
265
|
+
>
|
|
199
266
|
? TypeMap[Type] | null
|
|
200
267
|
: TypeMap[Type]
|
|
201
268
|
: never
|