@rex0220/kintone-sql-tools 3.76.0 → 3.78.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.
@@ -137,8 +137,13 @@
137
137
  ],
138
138
  "format": "esm"
139
139
  },
140
+ "src/core/projectedNameResolution.ts": {
141
+ "bytes": 603,
142
+ "imports": [],
143
+ "format": "esm"
144
+ },
140
145
  "src/core/aggregateDependencyValidation.ts": {
141
- "bytes": 17726,
146
+ "bytes": 17909,
142
147
  "imports": [
143
148
  {
144
149
  "path": "src/core/grouping.ts",
@@ -149,12 +154,17 @@
149
154
  "path": "src/core/optimization/plainGroupByPlan.ts",
150
155
  "kind": "import-statement",
151
156
  "original": "./optimization/plainGroupByPlan"
157
+ },
158
+ {
159
+ "path": "src/core/projectedNameResolution.ts",
160
+ "kind": "import-statement",
161
+ "original": "./projectedNameResolution"
152
162
  }
153
163
  ],
154
164
  "format": "esm"
155
165
  },
156
166
  "src/core/groupingValidation.ts": {
157
- "bytes": 11523,
167
+ "bytes": 11558,
158
168
  "imports": [
159
169
  {
160
170
  "path": "src/core/grouping.ts",
@@ -175,7 +185,7 @@
175
185
  "format": "esm"
176
186
  },
177
187
  "src/converter/selectToKintone.ts": {
178
- "bytes": 30101,
188
+ "bytes": 30353,
179
189
  "imports": [
180
190
  {
181
191
  "path": "../types/ast",
@@ -206,12 +216,17 @@
206
216
  "path": "src/core/groupingValidation.ts",
207
217
  "kind": "import-statement",
208
218
  "original": "../core/groupingValidation"
219
+ },
220
+ {
221
+ "path": "src/core/projectedNameResolution.ts",
222
+ "kind": "import-statement",
223
+ "original": "../core/projectedNameResolution"
209
224
  }
210
225
  ],
211
226
  "format": "esm"
212
227
  },
213
228
  "src/core/cteInlining.ts": {
214
- "bytes": 3111,
229
+ "bytes": 3031,
215
230
  "imports": [
216
231
  {
217
232
  "path": "src/converter/selectToKintone.ts",
@@ -222,6 +237,11 @@
222
237
  "path": "src/core/grouping.ts",
223
238
  "kind": "import-statement",
224
239
  "original": "./grouping"
240
+ },
241
+ {
242
+ "path": "src/core/aggregateDependencyValidation.ts",
243
+ "kind": "import-statement",
244
+ "original": "./aggregateDependencyValidation"
225
245
  }
226
246
  ],
227
247
  "format": "esm"
@@ -570,8 +590,13 @@
570
590
  ],
571
591
  "format": "esm"
572
592
  },
593
+ "src/core/expressionSemantics.ts": {
594
+ "bytes": 3798,
595
+ "imports": [],
596
+ "format": "esm"
597
+ },
573
598
  "src/engine/evalWhere.ts": {
574
- "bytes": 21083,
599
+ "bytes": 20942,
575
600
  "imports": [
576
601
  {
577
602
  "path": "src/types/ast.ts",
@@ -612,6 +637,11 @@
612
637
  "path": "src/core/aggregateExpression.ts",
613
638
  "kind": "import-statement",
614
639
  "original": "../core/aggregateExpression"
640
+ },
641
+ {
642
+ "path": "src/core/expressionSemantics.ts",
643
+ "kind": "import-statement",
644
+ "original": "../core/expressionSemantics"
615
645
  }
616
646
  ],
617
647
  "format": "esm"
@@ -1056,8 +1086,14 @@
1056
1086
  "format": "esm"
1057
1087
  },
1058
1088
  "src/core/optimization/canonicalOrderPlanner.ts": {
1059
- "bytes": 4885,
1060
- "imports": [],
1089
+ "bytes": 5042,
1090
+ "imports": [
1091
+ {
1092
+ "path": "src/core/projectedNameResolution.ts",
1093
+ "kind": "import-statement",
1094
+ "original": "../projectedNameResolution"
1095
+ }
1096
+ ],
1061
1097
  "format": "esm"
1062
1098
  },
1063
1099
  "src/core/optimization/korderPlanner.ts": {
@@ -1098,7 +1134,7 @@
1098
1134
  "format": "esm"
1099
1135
  },
1100
1136
  "src/engine/process.ts": {
1101
- "bytes": 89720,
1137
+ "bytes": 90912,
1102
1138
  "imports": [
1103
1139
  {
1104
1140
  "path": "src/core/optimization/crossJoinRowPlan.ts",
@@ -1149,6 +1185,16 @@
1149
1185
  "path": "src/core/groupingValidation.ts",
1150
1186
  "kind": "import-statement",
1151
1187
  "original": "../core/groupingValidation"
1188
+ },
1189
+ {
1190
+ "path": "src/core/expressionSemantics.ts",
1191
+ "kind": "import-statement",
1192
+ "original": "../core/expressionSemantics"
1193
+ },
1194
+ {
1195
+ "path": "src/core/projectedNameResolution.ts",
1196
+ "kind": "import-statement",
1197
+ "original": "../core/projectedNameResolution"
1152
1198
  }
1153
1199
  ],
1154
1200
  "format": "esm"
@@ -1446,7 +1492,7 @@
1446
1492
  "format": "esm"
1447
1493
  },
1448
1494
  "src/execute.ts": {
1449
- "bytes": 635459,
1495
+ "bytes": 649459,
1450
1496
  "imports": [
1451
1497
  {
1452
1498
  "path": "src/lexer/lexer.ts",
@@ -1543,6 +1589,16 @@
1543
1589
  "kind": "import-statement",
1544
1590
  "original": "./core/scalarCompare"
1545
1591
  },
1592
+ {
1593
+ "path": "src/core/expressionSemantics.ts",
1594
+ "kind": "import-statement",
1595
+ "original": "./core/expressionSemantics"
1596
+ },
1597
+ {
1598
+ "path": "src/core/projectedNameResolution.ts",
1599
+ "kind": "import-statement",
1600
+ "original": "./core/projectedNameResolution"
1601
+ },
1546
1602
  {
1547
1603
  "path": "src/core/exactDecimal.ts",
1548
1604
  "kind": "import-statement",
@@ -2234,17 +2290,20 @@
2234
2290
  "src/core/optimization/plainGroupByPlan.ts": {
2235
2291
  "bytesInOutput": 3124
2236
2292
  },
2293
+ "src/core/projectedNameResolution.ts": {
2294
+ "bytesInOutput": 102
2295
+ },
2237
2296
  "src/core/aggregateDependencyValidation.ts": {
2238
- "bytesInOutput": 8228
2297
+ "bytesInOutput": 8267
2239
2298
  },
2240
2299
  "src/core/groupingValidation.ts": {
2241
- "bytesInOutput": 3811
2300
+ "bytesInOutput": 3833
2242
2301
  },
2243
2302
  "src/converter/selectToKintone.ts": {
2244
- "bytesInOutput": 10148
2303
+ "bytesInOutput": 10224
2245
2304
  },
2246
2305
  "src/core/cteInlining.ts": {
2247
- "bytesInOutput": 1224
2306
+ "bytesInOutput": 1164
2248
2307
  },
2249
2308
  "src/core/fieldSemantics.ts": {
2250
2309
  "bytesInOutput": 1369
@@ -2306,8 +2365,11 @@
2306
2365
  "src/engine/evalFunc.ts": {
2307
2366
  "bytesInOutput": 11626
2308
2367
  },
2368
+ "src/core/expressionSemantics.ts": {
2369
+ "bytesInOutput": 1598
2370
+ },
2309
2371
  "src/engine/evalWhere.ts": {
2310
- "bytesInOutput": 6296
2372
+ "bytesInOutput": 6091
2311
2373
  },
2312
2374
  "src/core/dmlCustomCheck.ts": {
2313
2375
  "bytesInOutput": 1251
@@ -2388,7 +2450,7 @@
2388
2450
  "bytesInOutput": 246
2389
2451
  },
2390
2452
  "src/core/optimization/canonicalOrderPlanner.ts": {
2391
- "bytesInOutput": 1784
2453
+ "bytesInOutput": 1884
2392
2454
  },
2393
2455
  "src/core/optimization/korderPlanner.ts": {
2394
2456
  "bytesInOutput": 2244
@@ -2406,7 +2468,7 @@
2406
2468
  "bytesInOutput": 1223
2407
2469
  },
2408
2470
  "src/engine/process.ts": {
2409
- "bytesInOutput": 27972
2471
+ "bytesInOutput": 27958
2410
2472
  },
2411
2473
  "src/converter/subtableAdapter.ts": {
2412
2474
  "bytesInOutput": 643
@@ -2478,7 +2540,7 @@
2478
2540
  "bytesInOutput": 412
2479
2541
  },
2480
2542
  "src/execute.ts": {
2481
- "bytesInOutput": 244228
2543
+ "bytesInOutput": 247328
2482
2544
  },
2483
2545
  "src/engine-library/errors.ts": {
2484
2546
  "bytesInOutput": 1441
@@ -2544,7 +2606,7 @@
2544
2606
  "bytesInOutput": 127
2545
2607
  }
2546
2608
  },
2547
- "bytes": 691330
2609
+ "bytes": 696088
2548
2610
  }
2549
2611
  }
2550
2612
  }
@@ -0,0 +1,56 @@
1
+ export type ExportEncoding = "utf8" | "sjis";
2
+ export interface CsvExportColumnMeta {
3
+ readonly fieldType?: string;
4
+ }
5
+ export interface CsvExportInput {
6
+ readonly columns: readonly string[];
7
+ readonly rows: readonly Readonly<Record<string, string | null | undefined>>[];
8
+ readonly columnMeta?: ReadonlyMap<string, CsvExportColumnMeta>;
9
+ }
10
+ export interface ExportTextEncoder {
11
+ readonly encoding: "sjis";
12
+ encode(text: string): Uint8Array;
13
+ }
14
+ export interface CsvExportOptions {
15
+ readonly encoding?: ExportEncoding;
16
+ readonly timezone?: string;
17
+ readonly encoder?: ExportTextEncoder;
18
+ }
19
+ export interface CsvExportReceipt {
20
+ readonly rows: number;
21
+ readonly columns: number;
22
+ readonly bytes: number;
23
+ readonly encoding: ExportEncoding;
24
+ }
25
+ export interface CsvExportResult {
26
+ readonly text: string;
27
+ readonly data: Uint8Array;
28
+ readonly receipt: CsvExportReceipt;
29
+ }
30
+ export type ExportSerializerErrorCode = "ExportSinkDuplicateHeaderError" | "ExportSinkUnsupportedColumnError" | "ExportSinkInvalidValueError" | "ExportSinkInvalidTimezoneError" | "ExportSinkEncoderRequiredError" | "ExportSinkEncodingError" | "ExportSinkInvalidEncoderResultError";
31
+ export declare class ExportSerializerError extends Error {
32
+ readonly code: ExportSerializerErrorCode;
33
+ readonly cause?: unknown;
34
+ constructor(code: ExportSerializerErrorCode, message: string, cause?: unknown);
35
+ }
36
+ export declare class ExportSinkDuplicateHeaderError extends ExportSerializerError {
37
+ constructor(message: string);
38
+ }
39
+ export declare class ExportSinkUnsupportedColumnError extends ExportSerializerError {
40
+ constructor(message: string);
41
+ }
42
+ export declare class ExportSinkInvalidValueError extends ExportSerializerError {
43
+ constructor(message: string);
44
+ }
45
+ export declare class ExportSinkInvalidTimezoneError extends ExportSerializerError {
46
+ constructor(message: string, cause?: unknown);
47
+ }
48
+ export declare class ExportSinkEncoderRequiredError extends ExportSerializerError {
49
+ constructor(message: string);
50
+ }
51
+ export declare class ExportSinkEncodingError extends ExportSerializerError {
52
+ constructor(message: string, cause?: unknown);
53
+ }
54
+ export declare class ExportSinkInvalidEncoderResultError extends ExportSerializerError {
55
+ constructor(message: string);
56
+ }
@@ -0,0 +1,5 @@
1
+ import type { ExecutionContext, FlowCsvExportInput, FlowCsvExportOptions, FlowCsvExportResult, FlowExportSinkStatus, StatementResult } from "./publicTypes";
2
+ export declare function serializeCsvExport(input: FlowCsvExportInput, options?: FlowCsvExportOptions): FlowCsvExportResult;
3
+ export declare function serializeSelectResultAsCsv(statement: StatementResult, options?: FlowCsvExportOptions): FlowCsvExportResult;
4
+ export declare function exportSinkStatus(context: ExecutionContext, name: string): FlowExportSinkStatus;
5
+ export declare function serializeExportSink(context: ExecutionContext, name: string, options?: FlowCsvExportOptions): FlowCsvExportResult;
@@ -11,5 +11,6 @@ export declare function previewStatement(statement: Statement, context: Executio
11
11
  export declare function executeStatement(statement: Statement, context: ExecutionContext): Promise<StatementResult>;
12
12
  export declare function disposeExecutionContext(context: ExecutionContext): Promise<void>;
13
13
  export { isDmlResult } from "./publicTypes";
14
+ export { exportSinkStatus, serializeCsvExport, serializeExportSink, serializeSelectResultAsCsv, } from "./exportSinks";
14
15
  export { createImportSourceResolver, createKintoneClient, FlowImportProviderError, KsqlFlowError };
15
- export type { CreateExecutionContextOptions, CreateKintoneClientConfig, Diagnostic, DiagnosticCode, ExecutionContext, ExplainScriptOptions, ExplainScriptResult, FieldInfo, FlowImportProviderErrorCode, FlowImportSourceLoader, FlowImportSourceMaterializedInfo, FlowImportSourcePayload, FlowImportSourceResolver, FlowNamedImportSource, FlowChunkWrittenInfo, FlowDeleteResult, FlowDmlResult, FlowInsertResult, FlowKintoneClient, KintoneNativeUpdateKey, KintoneNativeUpsertRecord, KintoneNativeUpsertParams, KintoneNativeUpsertRecordResult, KintoneNativeUpsertResult, FlowUpdateResult, FlowUpsertResult, ImportEncoding, ParseScriptOptions, ParseScriptResult, PreviewResult, PreviewSample, PreviewStatementOptions, SchemaResolver, ScriptHeaderMeta, Statement, StatementResult, StatementResultKind, ValidateScriptOptions, } from "./publicTypes";
16
+ export type { CreateExecutionContextOptions, CreateKintoneClientConfig, Diagnostic, DiagnosticCode, ExecutionContext, ExportEncoding, ExplainScriptOptions, ExplainScriptResult, FieldInfo, FlowImportProviderErrorCode, FlowCsvExportColumnMeta, FlowCsvExportInput, FlowCsvExportOptions, FlowCsvExportReceipt, FlowCsvExportResult, FlowExportSinkStatus, FlowExportTextEncoder, FlowImportSourceLoader, FlowImportSourceMaterializedInfo, FlowImportSourcePayload, FlowImportSourceResolver, FlowNamedImportSource, FlowNamedExportSink, FlowChunkWrittenInfo, FlowDeleteResult, FlowDmlResult, FlowInsertResult, FlowKintoneClient, KintoneNativeUpdateKey, KintoneNativeUpsertRecord, KintoneNativeUpsertParams, KintoneNativeUpsertRecordResult, KintoneNativeUpsertResult, FlowUpdateResult, FlowUpsertResult, ImportEncoding, ParseScriptOptions, ParseScriptResult, PreviewResult, PreviewSample, PreviewStatementOptions, SchemaResolver, ScriptHeaderMeta, Statement, StatementResult, StatementResultKind, ValidateScriptOptions, } from "./publicTypes";
@@ -139,6 +139,19 @@ export interface FlowNamedImportSource {
139
139
  readonly name: string;
140
140
  readonly loader: FlowImportSourceLoader;
141
141
  }
142
+ /** Browser-neutral CSV export types shared with the engine serializer. */
143
+ export type ExportEncoding = import("../export/types").ExportEncoding;
144
+ export type FlowCsvExportColumnMeta = import("../export/types").CsvExportColumnMeta;
145
+ export type FlowCsvExportInput = import("../export/types").CsvExportInput;
146
+ export type FlowExportTextEncoder = import("../export/types").ExportTextEncoder;
147
+ export type FlowCsvExportOptions = import("../export/types").CsvExportOptions;
148
+ export type FlowCsvExportReceipt = import("../export/types").CsvExportReceipt;
149
+ export type FlowCsvExportResult = import("../export/types").CsvExportResult;
150
+ export interface FlowNamedExportSink {
151
+ /** Exact, case-sensitive temp-table name without the leading #. */
152
+ readonly name: string;
153
+ }
154
+ export type FlowExportSinkStatus = "materialized" | "not-created" | "failed" | "incomplete";
142
155
  export interface FlowImportSourceMaterializedInfo {
143
156
  /** バッチ内の文 index。StatementResult.index と同じ0始まり。 */
144
157
  readonly statementIndex: number;
@@ -218,6 +231,8 @@ export interface CreateExecutionContextOptions extends ParseScriptOptions {
218
231
  asOf?: Date;
219
232
  timezone?: string;
220
233
  continueOnError?: boolean;
234
+ /** Named CREATE TEMP TABLE outputs made available to the export API. */
235
+ exportSinks?: readonly FlowNamedExportSink[];
221
236
  /** Named, path-free source resolver. It never enables IMPORT implicitly. */
222
237
  importSource?: FlowImportSourceResolver;
223
238
  /**