@polyglot-sql/sdk 0.4.2 → 0.4.4
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 +5 -0
- package/dist/cdn/polyglot.esm.js +1468 -1468
- package/dist/index.cjs +61 -61
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +65 -65
- package/dist/index.node.js +61 -61
- package/dist/manual.js +65 -65
- package/dist/polyglot_sql.wasm +0 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5055,6 +5055,67 @@ function intersect(left, right) {
|
|
|
5055
5055
|
function except(left, right) {
|
|
5056
5056
|
return left.except(right);
|
|
5057
5057
|
}
|
|
5058
|
+
function diff(source, target, dialect = "generic", options = {}) {
|
|
5059
|
+
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5060
|
+
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
5061
|
+
return JSON.parse(resultJson);
|
|
5062
|
+
}
|
|
5063
|
+
function hasChanges(edits) {
|
|
5064
|
+
return edits.some((e) => e.type !== "keep");
|
|
5065
|
+
}
|
|
5066
|
+
function changesOnly(edits) {
|
|
5067
|
+
return edits.filter((e) => e.type !== "keep");
|
|
5068
|
+
}
|
|
5069
|
+
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5070
|
+
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
5071
|
+
return JSON.parse(resultJson);
|
|
5072
|
+
}
|
|
5073
|
+
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5074
|
+
const resultJson = lineage_sql_with_schema$1(
|
|
5075
|
+
sql,
|
|
5076
|
+
column,
|
|
5077
|
+
JSON.stringify(schema),
|
|
5078
|
+
dialect,
|
|
5079
|
+
trimSelects
|
|
5080
|
+
);
|
|
5081
|
+
return JSON.parse(resultJson);
|
|
5082
|
+
}
|
|
5083
|
+
function getSourceTables(column, sql, dialect = "generic") {
|
|
5084
|
+
const resultJson = source_tables$1(sql, column, dialect);
|
|
5085
|
+
return JSON.parse(resultJson);
|
|
5086
|
+
}
|
|
5087
|
+
function normalizeOptions(options) {
|
|
5088
|
+
return {
|
|
5089
|
+
dialect: "generic",
|
|
5090
|
+
datasetMappings: {},
|
|
5091
|
+
...options
|
|
5092
|
+
};
|
|
5093
|
+
}
|
|
5094
|
+
function openLineageColumnLineage(sql, options) {
|
|
5095
|
+
const resultJson = openlineage_column_lineage$1(
|
|
5096
|
+
sql,
|
|
5097
|
+
JSON.stringify(normalizeOptions(options))
|
|
5098
|
+
);
|
|
5099
|
+
return JSON.parse(resultJson);
|
|
5100
|
+
}
|
|
5101
|
+
function openLineageJobEvent(sql, options) {
|
|
5102
|
+
const resultJson = openlineage_job_event$1(
|
|
5103
|
+
sql,
|
|
5104
|
+
JSON.stringify(normalizeOptions(options))
|
|
5105
|
+
);
|
|
5106
|
+
return JSON.parse(resultJson);
|
|
5107
|
+
}
|
|
5108
|
+
function openLineageRunEvent(sql, options) {
|
|
5109
|
+
const resultJson = openlineage_run_event$1(
|
|
5110
|
+
sql,
|
|
5111
|
+
JSON.stringify(normalizeOptions(options))
|
|
5112
|
+
);
|
|
5113
|
+
return JSON.parse(resultJson);
|
|
5114
|
+
}
|
|
5115
|
+
function plan(sql, dialect = "generic") {
|
|
5116
|
+
const resultJson = plan$2(sql, dialect);
|
|
5117
|
+
return JSON.parse(resultJson);
|
|
5118
|
+
}
|
|
5058
5119
|
function validateSemantics(expr, options) {
|
|
5059
5120
|
const errors = [];
|
|
5060
5121
|
if (getExprType(expr) === "select") {
|
|
@@ -5206,67 +5267,6 @@ function validate(sql, dialect = "generic", options = {}) {
|
|
|
5206
5267
|
errors: allErrors
|
|
5207
5268
|
};
|
|
5208
5269
|
}
|
|
5209
|
-
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5210
|
-
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
5211
|
-
return JSON.parse(resultJson);
|
|
5212
|
-
}
|
|
5213
|
-
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5214
|
-
const resultJson = lineage_sql_with_schema$1(
|
|
5215
|
-
sql,
|
|
5216
|
-
column,
|
|
5217
|
-
JSON.stringify(schema),
|
|
5218
|
-
dialect,
|
|
5219
|
-
trimSelects
|
|
5220
|
-
);
|
|
5221
|
-
return JSON.parse(resultJson);
|
|
5222
|
-
}
|
|
5223
|
-
function getSourceTables(column, sql, dialect = "generic") {
|
|
5224
|
-
const resultJson = source_tables$1(sql, column, dialect);
|
|
5225
|
-
return JSON.parse(resultJson);
|
|
5226
|
-
}
|
|
5227
|
-
function normalizeOptions(options) {
|
|
5228
|
-
return {
|
|
5229
|
-
dialect: "generic",
|
|
5230
|
-
datasetMappings: {},
|
|
5231
|
-
...options
|
|
5232
|
-
};
|
|
5233
|
-
}
|
|
5234
|
-
function openLineageColumnLineage(sql, options) {
|
|
5235
|
-
const resultJson = openlineage_column_lineage$1(
|
|
5236
|
-
sql,
|
|
5237
|
-
JSON.stringify(normalizeOptions(options))
|
|
5238
|
-
);
|
|
5239
|
-
return JSON.parse(resultJson);
|
|
5240
|
-
}
|
|
5241
|
-
function openLineageJobEvent(sql, options) {
|
|
5242
|
-
const resultJson = openlineage_job_event$1(
|
|
5243
|
-
sql,
|
|
5244
|
-
JSON.stringify(normalizeOptions(options))
|
|
5245
|
-
);
|
|
5246
|
-
return JSON.parse(resultJson);
|
|
5247
|
-
}
|
|
5248
|
-
function openLineageRunEvent(sql, options) {
|
|
5249
|
-
const resultJson = openlineage_run_event$1(
|
|
5250
|
-
sql,
|
|
5251
|
-
JSON.stringify(normalizeOptions(options))
|
|
5252
|
-
);
|
|
5253
|
-
return JSON.parse(resultJson);
|
|
5254
|
-
}
|
|
5255
|
-
function diff(source, target, dialect = "generic", options = {}) {
|
|
5256
|
-
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5257
|
-
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
5258
|
-
return JSON.parse(resultJson);
|
|
5259
|
-
}
|
|
5260
|
-
function hasChanges(edits) {
|
|
5261
|
-
return edits.some((e) => e.type !== "keep");
|
|
5262
|
-
}
|
|
5263
|
-
function changesOnly(edits) {
|
|
5264
|
-
return edits.filter((e) => e.type !== "keep");
|
|
5265
|
-
}
|
|
5266
|
-
function plan(sql, dialect = "generic") {
|
|
5267
|
-
const resultJson = plan$2(sql, dialect);
|
|
5268
|
-
return JSON.parse(resultJson);
|
|
5269
|
-
}
|
|
5270
5270
|
var Dialect = /* @__PURE__ */ ((Dialect2) => {
|
|
5271
5271
|
Dialect2["Generic"] = "generic";
|
|
5272
5272
|
Dialect2["PostgreSQL"] = "postgresql";
|
package/dist/index.d.cts
CHANGED
|
@@ -4151,6 +4151,14 @@ declare type ExecuteStatement = {
|
|
|
4151
4151
|
* Named parameters: @param=value pairs
|
|
4152
4152
|
*/
|
|
4153
4153
|
parameters: Array<ExecuteParameter>;
|
|
4154
|
+
/**
|
|
4155
|
+
* Positional prepared statement arguments, used by PostgreSQL EXECUTE name(...).
|
|
4156
|
+
*/
|
|
4157
|
+
arguments?: Array<Expression>;
|
|
4158
|
+
/**
|
|
4159
|
+
* Whether this statement represents PostgreSQL-style prepared statement execution.
|
|
4160
|
+
*/
|
|
4161
|
+
prepared?: boolean;
|
|
4154
4162
|
/**
|
|
4155
4163
|
* Trailing clause text (e.g. WITH RESULT SETS ((...)))
|
|
4156
4164
|
*/
|
|
@@ -5090,6 +5098,8 @@ declare type Expression = {
|
|
|
5090
5098
|
"command": Command;
|
|
5091
5099
|
} | {
|
|
5092
5100
|
"kill": Kill;
|
|
5101
|
+
} | {
|
|
5102
|
+
"prepare": PrepareStatement;
|
|
5093
5103
|
} | {
|
|
5094
5104
|
"execute": ExecuteStatement;
|
|
5095
5105
|
} | {
|
|
@@ -8951,6 +8961,8 @@ export declare interface LineageNode {
|
|
|
8951
8961
|
source: Expression;
|
|
8952
8962
|
downstream: LineageNode[];
|
|
8953
8963
|
source_name: string;
|
|
8964
|
+
source_kind: LineageSourceKind;
|
|
8965
|
+
source_alias?: string;
|
|
8954
8966
|
reference_node_name: string;
|
|
8955
8967
|
}
|
|
8956
8968
|
|
|
@@ -8961,6 +8973,8 @@ export declare interface LineageResult {
|
|
|
8961
8973
|
error?: string;
|
|
8962
8974
|
}
|
|
8963
8975
|
|
|
8976
|
+
export declare type LineageSourceKind = 'root' | 'table' | 'derived_table' | 'cte' | 'virtual' | 'unknown';
|
|
8977
|
+
|
|
8964
8978
|
/**
|
|
8965
8979
|
* Trace the lineage of a column through a SQL query using schema metadata.
|
|
8966
8980
|
*
|
|
@@ -10663,6 +10677,25 @@ declare type Predict = {
|
|
|
10663
10677
|
params_struct: Expression | null;
|
|
10664
10678
|
};
|
|
10665
10679
|
|
|
10680
|
+
/**
|
|
10681
|
+
* PREPARE statement (PostgreSQL/generic prepared statement definition)
|
|
10682
|
+
* Syntax: PREPARE name [(type, ...)] AS statement
|
|
10683
|
+
*/
|
|
10684
|
+
declare type PrepareStatement = {
|
|
10685
|
+
/**
|
|
10686
|
+
* The prepared statement name.
|
|
10687
|
+
*/
|
|
10688
|
+
name: Identifier;
|
|
10689
|
+
/**
|
|
10690
|
+
* Optional PostgreSQL parameter type list.
|
|
10691
|
+
*/
|
|
10692
|
+
parameter_types?: Array<DataType>;
|
|
10693
|
+
/**
|
|
10694
|
+
* The statement to execute when the prepared statement is invoked.
|
|
10695
|
+
*/
|
|
10696
|
+
statement: Expression;
|
|
10697
|
+
};
|
|
10698
|
+
|
|
10666
10699
|
/**
|
|
10667
10700
|
* PreviousDay
|
|
10668
10701
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -4151,6 +4151,14 @@ declare type ExecuteStatement = {
|
|
|
4151
4151
|
* Named parameters: @param=value pairs
|
|
4152
4152
|
*/
|
|
4153
4153
|
parameters: Array<ExecuteParameter>;
|
|
4154
|
+
/**
|
|
4155
|
+
* Positional prepared statement arguments, used by PostgreSQL EXECUTE name(...).
|
|
4156
|
+
*/
|
|
4157
|
+
arguments?: Array<Expression>;
|
|
4158
|
+
/**
|
|
4159
|
+
* Whether this statement represents PostgreSQL-style prepared statement execution.
|
|
4160
|
+
*/
|
|
4161
|
+
prepared?: boolean;
|
|
4154
4162
|
/**
|
|
4155
4163
|
* Trailing clause text (e.g. WITH RESULT SETS ((...)))
|
|
4156
4164
|
*/
|
|
@@ -5090,6 +5098,8 @@ declare type Expression = {
|
|
|
5090
5098
|
"command": Command;
|
|
5091
5099
|
} | {
|
|
5092
5100
|
"kill": Kill;
|
|
5101
|
+
} | {
|
|
5102
|
+
"prepare": PrepareStatement;
|
|
5093
5103
|
} | {
|
|
5094
5104
|
"execute": ExecuteStatement;
|
|
5095
5105
|
} | {
|
|
@@ -8951,6 +8961,8 @@ export declare interface LineageNode {
|
|
|
8951
8961
|
source: Expression;
|
|
8952
8962
|
downstream: LineageNode[];
|
|
8953
8963
|
source_name: string;
|
|
8964
|
+
source_kind: LineageSourceKind;
|
|
8965
|
+
source_alias?: string;
|
|
8954
8966
|
reference_node_name: string;
|
|
8955
8967
|
}
|
|
8956
8968
|
|
|
@@ -8961,6 +8973,8 @@ export declare interface LineageResult {
|
|
|
8961
8973
|
error?: string;
|
|
8962
8974
|
}
|
|
8963
8975
|
|
|
8976
|
+
export declare type LineageSourceKind = 'root' | 'table' | 'derived_table' | 'cte' | 'virtual' | 'unknown';
|
|
8977
|
+
|
|
8964
8978
|
/**
|
|
8965
8979
|
* Trace the lineage of a column through a SQL query using schema metadata.
|
|
8966
8980
|
*
|
|
@@ -10663,6 +10677,25 @@ declare type Predict = {
|
|
|
10663
10677
|
params_struct: Expression | null;
|
|
10664
10678
|
};
|
|
10665
10679
|
|
|
10680
|
+
/**
|
|
10681
|
+
* PREPARE statement (PostgreSQL/generic prepared statement definition)
|
|
10682
|
+
* Syntax: PREPARE name [(type, ...)] AS statement
|
|
10683
|
+
*/
|
|
10684
|
+
declare type PrepareStatement = {
|
|
10685
|
+
/**
|
|
10686
|
+
* The prepared statement name.
|
|
10687
|
+
*/
|
|
10688
|
+
name: Identifier;
|
|
10689
|
+
/**
|
|
10690
|
+
* Optional PostgreSQL parameter type list.
|
|
10691
|
+
*/
|
|
10692
|
+
parameter_types?: Array<DataType>;
|
|
10693
|
+
/**
|
|
10694
|
+
* The statement to execute when the prepared statement is invoked.
|
|
10695
|
+
*/
|
|
10696
|
+
statement: Expression;
|
|
10697
|
+
};
|
|
10698
|
+
|
|
10666
10699
|
/**
|
|
10667
10700
|
* PreviousDay
|
|
10668
10701
|
*/
|
package/dist/index.js
CHANGED
|
@@ -5523,6 +5523,71 @@ function except(left, right) {
|
|
|
5523
5523
|
return left.except(right);
|
|
5524
5524
|
}
|
|
5525
5525
|
|
|
5526
|
+
function diff(source, target, dialect = "generic", options = {}) {
|
|
5527
|
+
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5528
|
+
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
5529
|
+
return JSON.parse(resultJson);
|
|
5530
|
+
}
|
|
5531
|
+
function hasChanges(edits) {
|
|
5532
|
+
return edits.some((e) => e.type !== "keep");
|
|
5533
|
+
}
|
|
5534
|
+
function changesOnly(edits) {
|
|
5535
|
+
return edits.filter((e) => e.type !== "keep");
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5538
|
+
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5539
|
+
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
5540
|
+
return JSON.parse(resultJson);
|
|
5541
|
+
}
|
|
5542
|
+
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5543
|
+
const resultJson = lineage_sql_with_schema$1(
|
|
5544
|
+
sql,
|
|
5545
|
+
column,
|
|
5546
|
+
JSON.stringify(schema),
|
|
5547
|
+
dialect,
|
|
5548
|
+
trimSelects
|
|
5549
|
+
);
|
|
5550
|
+
return JSON.parse(resultJson);
|
|
5551
|
+
}
|
|
5552
|
+
function getSourceTables(column, sql, dialect = "generic") {
|
|
5553
|
+
const resultJson = source_tables$1(sql, column, dialect);
|
|
5554
|
+
return JSON.parse(resultJson);
|
|
5555
|
+
}
|
|
5556
|
+
|
|
5557
|
+
function normalizeOptions(options) {
|
|
5558
|
+
return {
|
|
5559
|
+
dialect: "generic",
|
|
5560
|
+
datasetMappings: {},
|
|
5561
|
+
...options
|
|
5562
|
+
};
|
|
5563
|
+
}
|
|
5564
|
+
function openLineageColumnLineage(sql, options) {
|
|
5565
|
+
const resultJson = openlineage_column_lineage$1(
|
|
5566
|
+
sql,
|
|
5567
|
+
JSON.stringify(normalizeOptions(options))
|
|
5568
|
+
);
|
|
5569
|
+
return JSON.parse(resultJson);
|
|
5570
|
+
}
|
|
5571
|
+
function openLineageJobEvent(sql, options) {
|
|
5572
|
+
const resultJson = openlineage_job_event$1(
|
|
5573
|
+
sql,
|
|
5574
|
+
JSON.stringify(normalizeOptions(options))
|
|
5575
|
+
);
|
|
5576
|
+
return JSON.parse(resultJson);
|
|
5577
|
+
}
|
|
5578
|
+
function openLineageRunEvent(sql, options) {
|
|
5579
|
+
const resultJson = openlineage_run_event$1(
|
|
5580
|
+
sql,
|
|
5581
|
+
JSON.stringify(normalizeOptions(options))
|
|
5582
|
+
);
|
|
5583
|
+
return JSON.parse(resultJson);
|
|
5584
|
+
}
|
|
5585
|
+
|
|
5586
|
+
function plan(sql, dialect = "generic") {
|
|
5587
|
+
const resultJson = plan$2(sql, dialect);
|
|
5588
|
+
return JSON.parse(resultJson);
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5526
5591
|
function validateSemantics(expr, options) {
|
|
5527
5592
|
const errors = [];
|
|
5528
5593
|
if (getExprType(expr) === "select") {
|
|
@@ -5678,71 +5743,6 @@ function validate(sql, dialect = "generic", options = {}) {
|
|
|
5678
5743
|
};
|
|
5679
5744
|
}
|
|
5680
5745
|
|
|
5681
|
-
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5682
|
-
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
5683
|
-
return JSON.parse(resultJson);
|
|
5684
|
-
}
|
|
5685
|
-
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5686
|
-
const resultJson = lineage_sql_with_schema$1(
|
|
5687
|
-
sql,
|
|
5688
|
-
column,
|
|
5689
|
-
JSON.stringify(schema),
|
|
5690
|
-
dialect,
|
|
5691
|
-
trimSelects
|
|
5692
|
-
);
|
|
5693
|
-
return JSON.parse(resultJson);
|
|
5694
|
-
}
|
|
5695
|
-
function getSourceTables(column, sql, dialect = "generic") {
|
|
5696
|
-
const resultJson = source_tables$1(sql, column, dialect);
|
|
5697
|
-
return JSON.parse(resultJson);
|
|
5698
|
-
}
|
|
5699
|
-
|
|
5700
|
-
function normalizeOptions(options) {
|
|
5701
|
-
return {
|
|
5702
|
-
dialect: "generic",
|
|
5703
|
-
datasetMappings: {},
|
|
5704
|
-
...options
|
|
5705
|
-
};
|
|
5706
|
-
}
|
|
5707
|
-
function openLineageColumnLineage(sql, options) {
|
|
5708
|
-
const resultJson = openlineage_column_lineage$1(
|
|
5709
|
-
sql,
|
|
5710
|
-
JSON.stringify(normalizeOptions(options))
|
|
5711
|
-
);
|
|
5712
|
-
return JSON.parse(resultJson);
|
|
5713
|
-
}
|
|
5714
|
-
function openLineageJobEvent(sql, options) {
|
|
5715
|
-
const resultJson = openlineage_job_event$1(
|
|
5716
|
-
sql,
|
|
5717
|
-
JSON.stringify(normalizeOptions(options))
|
|
5718
|
-
);
|
|
5719
|
-
return JSON.parse(resultJson);
|
|
5720
|
-
}
|
|
5721
|
-
function openLineageRunEvent(sql, options) {
|
|
5722
|
-
const resultJson = openlineage_run_event$1(
|
|
5723
|
-
sql,
|
|
5724
|
-
JSON.stringify(normalizeOptions(options))
|
|
5725
|
-
);
|
|
5726
|
-
return JSON.parse(resultJson);
|
|
5727
|
-
}
|
|
5728
|
-
|
|
5729
|
-
function diff(source, target, dialect = "generic", options = {}) {
|
|
5730
|
-
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5731
|
-
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
5732
|
-
return JSON.parse(resultJson);
|
|
5733
|
-
}
|
|
5734
|
-
function hasChanges(edits) {
|
|
5735
|
-
return edits.some((e) => e.type !== "keep");
|
|
5736
|
-
}
|
|
5737
|
-
function changesOnly(edits) {
|
|
5738
|
-
return edits.filter((e) => e.type !== "keep");
|
|
5739
|
-
}
|
|
5740
|
-
|
|
5741
|
-
function plan(sql, dialect = "generic") {
|
|
5742
|
-
const resultJson = plan$2(sql, dialect);
|
|
5743
|
-
return JSON.parse(resultJson);
|
|
5744
|
-
}
|
|
5745
|
-
|
|
5746
5746
|
var Dialect = /* @__PURE__ */ ((Dialect2) => {
|
|
5747
5747
|
Dialect2["Generic"] = "generic";
|
|
5748
5748
|
Dialect2["PostgreSQL"] = "postgresql";
|
package/dist/index.node.js
CHANGED
|
@@ -4884,6 +4884,67 @@ function intersect(left, right) {
|
|
|
4884
4884
|
function except(left, right) {
|
|
4885
4885
|
return left.except(right);
|
|
4886
4886
|
}
|
|
4887
|
+
function diff(source, target, dialect = "generic", options = {}) {
|
|
4888
|
+
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
4889
|
+
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
4890
|
+
return JSON.parse(resultJson);
|
|
4891
|
+
}
|
|
4892
|
+
function hasChanges(edits) {
|
|
4893
|
+
return edits.some((e) => e.type !== "keep");
|
|
4894
|
+
}
|
|
4895
|
+
function changesOnly(edits) {
|
|
4896
|
+
return edits.filter((e) => e.type !== "keep");
|
|
4897
|
+
}
|
|
4898
|
+
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
4899
|
+
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
4900
|
+
return JSON.parse(resultJson);
|
|
4901
|
+
}
|
|
4902
|
+
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
4903
|
+
const resultJson = lineage_sql_with_schema$1(
|
|
4904
|
+
sql,
|
|
4905
|
+
column,
|
|
4906
|
+
JSON.stringify(schema),
|
|
4907
|
+
dialect,
|
|
4908
|
+
trimSelects
|
|
4909
|
+
);
|
|
4910
|
+
return JSON.parse(resultJson);
|
|
4911
|
+
}
|
|
4912
|
+
function getSourceTables(column, sql, dialect = "generic") {
|
|
4913
|
+
const resultJson = source_tables$1(sql, column, dialect);
|
|
4914
|
+
return JSON.parse(resultJson);
|
|
4915
|
+
}
|
|
4916
|
+
function normalizeOptions(options) {
|
|
4917
|
+
return {
|
|
4918
|
+
dialect: "generic",
|
|
4919
|
+
datasetMappings: {},
|
|
4920
|
+
...options
|
|
4921
|
+
};
|
|
4922
|
+
}
|
|
4923
|
+
function openLineageColumnLineage(sql, options) {
|
|
4924
|
+
const resultJson = openlineage_column_lineage$1(
|
|
4925
|
+
sql,
|
|
4926
|
+
JSON.stringify(normalizeOptions(options))
|
|
4927
|
+
);
|
|
4928
|
+
return JSON.parse(resultJson);
|
|
4929
|
+
}
|
|
4930
|
+
function openLineageJobEvent(sql, options) {
|
|
4931
|
+
const resultJson = openlineage_job_event$1(
|
|
4932
|
+
sql,
|
|
4933
|
+
JSON.stringify(normalizeOptions(options))
|
|
4934
|
+
);
|
|
4935
|
+
return JSON.parse(resultJson);
|
|
4936
|
+
}
|
|
4937
|
+
function openLineageRunEvent(sql, options) {
|
|
4938
|
+
const resultJson = openlineage_run_event$1(
|
|
4939
|
+
sql,
|
|
4940
|
+
JSON.stringify(normalizeOptions(options))
|
|
4941
|
+
);
|
|
4942
|
+
return JSON.parse(resultJson);
|
|
4943
|
+
}
|
|
4944
|
+
function plan(sql, dialect = "generic") {
|
|
4945
|
+
const resultJson = plan$2(sql, dialect);
|
|
4946
|
+
return JSON.parse(resultJson);
|
|
4947
|
+
}
|
|
4887
4948
|
function validateSemantics(expr, options) {
|
|
4888
4949
|
const errors = [];
|
|
4889
4950
|
if (getExprType(expr) === "select") {
|
|
@@ -5035,67 +5096,6 @@ function validate(sql, dialect = "generic", options = {}) {
|
|
|
5035
5096
|
errors: allErrors
|
|
5036
5097
|
};
|
|
5037
5098
|
}
|
|
5038
|
-
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5039
|
-
const resultJson = lineage_sql$1(sql, column, dialect, trimSelects);
|
|
5040
|
-
return JSON.parse(resultJson);
|
|
5041
|
-
}
|
|
5042
|
-
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5043
|
-
const resultJson = lineage_sql_with_schema$1(
|
|
5044
|
-
sql,
|
|
5045
|
-
column,
|
|
5046
|
-
JSON.stringify(schema),
|
|
5047
|
-
dialect,
|
|
5048
|
-
trimSelects
|
|
5049
|
-
);
|
|
5050
|
-
return JSON.parse(resultJson);
|
|
5051
|
-
}
|
|
5052
|
-
function getSourceTables(column, sql, dialect = "generic") {
|
|
5053
|
-
const resultJson = source_tables$1(sql, column, dialect);
|
|
5054
|
-
return JSON.parse(resultJson);
|
|
5055
|
-
}
|
|
5056
|
-
function normalizeOptions(options) {
|
|
5057
|
-
return {
|
|
5058
|
-
dialect: "generic",
|
|
5059
|
-
datasetMappings: {},
|
|
5060
|
-
...options
|
|
5061
|
-
};
|
|
5062
|
-
}
|
|
5063
|
-
function openLineageColumnLineage(sql, options) {
|
|
5064
|
-
const resultJson = openlineage_column_lineage$1(
|
|
5065
|
-
sql,
|
|
5066
|
-
JSON.stringify(normalizeOptions(options))
|
|
5067
|
-
);
|
|
5068
|
-
return JSON.parse(resultJson);
|
|
5069
|
-
}
|
|
5070
|
-
function openLineageJobEvent(sql, options) {
|
|
5071
|
-
const resultJson = openlineage_job_event$1(
|
|
5072
|
-
sql,
|
|
5073
|
-
JSON.stringify(normalizeOptions(options))
|
|
5074
|
-
);
|
|
5075
|
-
return JSON.parse(resultJson);
|
|
5076
|
-
}
|
|
5077
|
-
function openLineageRunEvent(sql, options) {
|
|
5078
|
-
const resultJson = openlineage_run_event$1(
|
|
5079
|
-
sql,
|
|
5080
|
-
JSON.stringify(normalizeOptions(options))
|
|
5081
|
-
);
|
|
5082
|
-
return JSON.parse(resultJson);
|
|
5083
|
-
}
|
|
5084
|
-
function diff(source, target, dialect = "generic", options = {}) {
|
|
5085
|
-
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5086
|
-
const resultJson = diff_sql$1(source, target, dialect, deltaOnly, f, t);
|
|
5087
|
-
return JSON.parse(resultJson);
|
|
5088
|
-
}
|
|
5089
|
-
function hasChanges(edits) {
|
|
5090
|
-
return edits.some((e) => e.type !== "keep");
|
|
5091
|
-
}
|
|
5092
|
-
function changesOnly(edits) {
|
|
5093
|
-
return edits.filter((e) => e.type !== "keep");
|
|
5094
|
-
}
|
|
5095
|
-
function plan(sql, dialect = "generic") {
|
|
5096
|
-
const resultJson = plan$2(sql, dialect);
|
|
5097
|
-
return JSON.parse(resultJson);
|
|
5098
|
-
}
|
|
5099
5099
|
var Dialect = /* @__PURE__ */ ((Dialect2) => {
|
|
5100
5100
|
Dialect2["Generic"] = "generic";
|
|
5101
5101
|
Dialect2["PostgreSQL"] = "postgresql";
|
package/dist/manual.js
CHANGED
|
@@ -5158,6 +5158,71 @@ function except(left, right) {
|
|
|
5158
5158
|
return left.except(right);
|
|
5159
5159
|
}
|
|
5160
5160
|
|
|
5161
|
+
function diff(source, target, dialect = "generic", options = {}) {
|
|
5162
|
+
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5163
|
+
const resultJson = diff_sql(source, target, dialect, deltaOnly, f, t);
|
|
5164
|
+
return JSON.parse(resultJson);
|
|
5165
|
+
}
|
|
5166
|
+
function hasChanges(edits) {
|
|
5167
|
+
return edits.some((e) => e.type !== "keep");
|
|
5168
|
+
}
|
|
5169
|
+
function changesOnly(edits) {
|
|
5170
|
+
return edits.filter((e) => e.type !== "keep");
|
|
5171
|
+
}
|
|
5172
|
+
|
|
5173
|
+
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5174
|
+
const resultJson = lineage_sql(sql, column, dialect, trimSelects);
|
|
5175
|
+
return JSON.parse(resultJson);
|
|
5176
|
+
}
|
|
5177
|
+
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5178
|
+
const resultJson = lineage_sql_with_schema(
|
|
5179
|
+
sql,
|
|
5180
|
+
column,
|
|
5181
|
+
JSON.stringify(schema),
|
|
5182
|
+
dialect,
|
|
5183
|
+
trimSelects
|
|
5184
|
+
);
|
|
5185
|
+
return JSON.parse(resultJson);
|
|
5186
|
+
}
|
|
5187
|
+
function getSourceTables(column, sql, dialect = "generic") {
|
|
5188
|
+
const resultJson = source_tables(sql, column, dialect);
|
|
5189
|
+
return JSON.parse(resultJson);
|
|
5190
|
+
}
|
|
5191
|
+
|
|
5192
|
+
function normalizeOptions(options) {
|
|
5193
|
+
return {
|
|
5194
|
+
dialect: "generic",
|
|
5195
|
+
datasetMappings: {},
|
|
5196
|
+
...options
|
|
5197
|
+
};
|
|
5198
|
+
}
|
|
5199
|
+
function openLineageColumnLineage(sql, options) {
|
|
5200
|
+
const resultJson = openlineage_column_lineage(
|
|
5201
|
+
sql,
|
|
5202
|
+
JSON.stringify(normalizeOptions(options))
|
|
5203
|
+
);
|
|
5204
|
+
return JSON.parse(resultJson);
|
|
5205
|
+
}
|
|
5206
|
+
function openLineageJobEvent(sql, options) {
|
|
5207
|
+
const resultJson = openlineage_job_event(
|
|
5208
|
+
sql,
|
|
5209
|
+
JSON.stringify(normalizeOptions(options))
|
|
5210
|
+
);
|
|
5211
|
+
return JSON.parse(resultJson);
|
|
5212
|
+
}
|
|
5213
|
+
function openLineageRunEvent(sql, options) {
|
|
5214
|
+
const resultJson = openlineage_run_event(
|
|
5215
|
+
sql,
|
|
5216
|
+
JSON.stringify(normalizeOptions(options))
|
|
5217
|
+
);
|
|
5218
|
+
return JSON.parse(resultJson);
|
|
5219
|
+
}
|
|
5220
|
+
|
|
5221
|
+
function plan(sql, dialect = "generic") {
|
|
5222
|
+
const resultJson = plan$1(sql, dialect);
|
|
5223
|
+
return JSON.parse(resultJson);
|
|
5224
|
+
}
|
|
5225
|
+
|
|
5161
5226
|
function validateSemantics(expr, options) {
|
|
5162
5227
|
const errors = [];
|
|
5163
5228
|
if (getExprType(expr) === "select") {
|
|
@@ -5313,71 +5378,6 @@ function validate(sql, dialect = "generic", options = {}) {
|
|
|
5313
5378
|
};
|
|
5314
5379
|
}
|
|
5315
5380
|
|
|
5316
|
-
function lineage(column, sql, dialect = "generic", trimSelects = false) {
|
|
5317
|
-
const resultJson = lineage_sql(sql, column, dialect, trimSelects);
|
|
5318
|
-
return JSON.parse(resultJson);
|
|
5319
|
-
}
|
|
5320
|
-
function lineageWithSchema(column, sql, schema, dialect = "generic", trimSelects = false) {
|
|
5321
|
-
const resultJson = lineage_sql_with_schema(
|
|
5322
|
-
sql,
|
|
5323
|
-
column,
|
|
5324
|
-
JSON.stringify(schema),
|
|
5325
|
-
dialect,
|
|
5326
|
-
trimSelects
|
|
5327
|
-
);
|
|
5328
|
-
return JSON.parse(resultJson);
|
|
5329
|
-
}
|
|
5330
|
-
function getSourceTables(column, sql, dialect = "generic") {
|
|
5331
|
-
const resultJson = source_tables(sql, column, dialect);
|
|
5332
|
-
return JSON.parse(resultJson);
|
|
5333
|
-
}
|
|
5334
|
-
|
|
5335
|
-
function normalizeOptions(options) {
|
|
5336
|
-
return {
|
|
5337
|
-
dialect: "generic",
|
|
5338
|
-
datasetMappings: {},
|
|
5339
|
-
...options
|
|
5340
|
-
};
|
|
5341
|
-
}
|
|
5342
|
-
function openLineageColumnLineage(sql, options) {
|
|
5343
|
-
const resultJson = openlineage_column_lineage(
|
|
5344
|
-
sql,
|
|
5345
|
-
JSON.stringify(normalizeOptions(options))
|
|
5346
|
-
);
|
|
5347
|
-
return JSON.parse(resultJson);
|
|
5348
|
-
}
|
|
5349
|
-
function openLineageJobEvent(sql, options) {
|
|
5350
|
-
const resultJson = openlineage_job_event(
|
|
5351
|
-
sql,
|
|
5352
|
-
JSON.stringify(normalizeOptions(options))
|
|
5353
|
-
);
|
|
5354
|
-
return JSON.parse(resultJson);
|
|
5355
|
-
}
|
|
5356
|
-
function openLineageRunEvent(sql, options) {
|
|
5357
|
-
const resultJson = openlineage_run_event(
|
|
5358
|
-
sql,
|
|
5359
|
-
JSON.stringify(normalizeOptions(options))
|
|
5360
|
-
);
|
|
5361
|
-
return JSON.parse(resultJson);
|
|
5362
|
-
}
|
|
5363
|
-
|
|
5364
|
-
function diff(source, target, dialect = "generic", options = {}) {
|
|
5365
|
-
const { deltaOnly = false, f = 0.6, t = 0.6 } = options;
|
|
5366
|
-
const resultJson = diff_sql(source, target, dialect, deltaOnly, f, t);
|
|
5367
|
-
return JSON.parse(resultJson);
|
|
5368
|
-
}
|
|
5369
|
-
function hasChanges(edits) {
|
|
5370
|
-
return edits.some((e) => e.type !== "keep");
|
|
5371
|
-
}
|
|
5372
|
-
function changesOnly(edits) {
|
|
5373
|
-
return edits.filter((e) => e.type !== "keep");
|
|
5374
|
-
}
|
|
5375
|
-
|
|
5376
|
-
function plan(sql, dialect = "generic") {
|
|
5377
|
-
const resultJson = plan$1(sql, dialect);
|
|
5378
|
-
return JSON.parse(resultJson);
|
|
5379
|
-
}
|
|
5380
|
-
|
|
5381
5381
|
var Dialect = /* @__PURE__ */ ((Dialect2) => {
|
|
5382
5382
|
Dialect2["Generic"] = "generic";
|
|
5383
5383
|
Dialect2["PostgreSQL"] = "postgresql";
|
package/dist/polyglot_sql.wasm
CHANGED
|
Binary file
|