@graphenedata/cli 0.0.8 → 0.0.10
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/cli.ts +4 -8
- package/dist/cli/cli.js +85 -106
- package/dist/docs/graphene.md +8 -8
- package/dist/ui/internal/queryEngine.ts +4 -2
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -24,8 +24,7 @@ program.hook('preAction', async () => {
|
|
|
24
24
|
loadConfig(process.cwd())
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
program
|
|
28
|
-
.command('compile')
|
|
27
|
+
program.command('compile')
|
|
29
28
|
.description('Translate a query to SQL and print it')
|
|
30
29
|
.argument('[input]', 'Path to file, a raw string, or "-" for stdin')
|
|
31
30
|
.action(async (input: string | undefined) => {
|
|
@@ -36,8 +35,7 @@ program
|
|
|
36
35
|
console.log(toSql(queries[0]))
|
|
37
36
|
})
|
|
38
37
|
|
|
39
|
-
program
|
|
40
|
-
.command('run')
|
|
38
|
+
program.command('run')
|
|
41
39
|
.description('Run a query against your database')
|
|
42
40
|
.argument('[input]', 'Path to file, a raw string, or "-" for stdin')
|
|
43
41
|
.action(async (input: string | undefined) => {
|
|
@@ -84,8 +82,7 @@ program.command('schema')
|
|
|
84
82
|
console.log(')')
|
|
85
83
|
})
|
|
86
84
|
|
|
87
|
-
program
|
|
88
|
-
.command('serve')
|
|
85
|
+
program.command('serve')
|
|
89
86
|
.description('Run the local server')
|
|
90
87
|
.option('--bg', 'Run the server in the background')
|
|
91
88
|
.action(async (options: {bg?: boolean}) => {
|
|
@@ -103,8 +100,7 @@ program.command('stop')
|
|
|
103
100
|
.description('Stop the local server')
|
|
104
101
|
.action(async () => { await stopGrapheneIfRunning() })
|
|
105
102
|
|
|
106
|
-
program
|
|
107
|
-
.command('check')
|
|
103
|
+
program.command('check')
|
|
108
104
|
.description('Check the project for errors, optionally capturing a page screenshot')
|
|
109
105
|
.argument('[mdFile]', 'Markdown file to check (e.g., index.md)')
|
|
110
106
|
.option('-c, --chart <chartTitle>', 'Title of a specific chart to capture')
|
package/dist/cli/cli.js
CHANGED
|
@@ -175,21 +175,18 @@ var init_config = __esm({
|
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
// ../lang/functionDefs.ts
|
|
178
|
-
import { DUCKDB_DIALECT_FUNCTIONS, GlobalNameSpace, DialectNameSpace, getDialect } from "@graphenedata/malloy";
|
|
178
|
+
import { DUCKDB_DIALECT_FUNCTIONS, GlobalNameSpace, DialectNameSpace, getDialect, registerDialect, StandardSQLDialect, expandBlueprintMap } from "@graphenedata/malloy";
|
|
179
179
|
function findOverloads(name, dialect) {
|
|
180
180
|
if (!dialectNamespaces.has(dialect)) {
|
|
181
|
-
|
|
182
|
-
dialectNamespaces.set(dialect, new DialectNameSpace(d));
|
|
181
|
+
dialectNamespaces.set(dialect, new DialectNameSpace(getDialect(dialect)));
|
|
183
182
|
}
|
|
184
183
|
let res = dialectNamespaces.get(dialect).getEntry(name) || globalNamespace.getEntry(name);
|
|
185
184
|
return res?.entry ? res.entry.overloads : [];
|
|
186
185
|
}
|
|
187
|
-
var globalNamespace, dialectNamespaces
|
|
186
|
+
var BIGQUERY_DIALECT_FUNCTIONS, BigQueryDialect, globalNamespace, dialectNamespaces;
|
|
188
187
|
var init_functionDefs = __esm({
|
|
189
188
|
"../lang/functionDefs.ts"() {
|
|
190
189
|
"use strict";
|
|
191
|
-
globalNamespace = new GlobalNameSpace();
|
|
192
|
-
dialectNamespaces = /* @__PURE__ */ new Map();
|
|
193
190
|
Object.assign(DUCKDB_DIALECT_FUNCTIONS, {
|
|
194
191
|
"count_if": {
|
|
195
192
|
takes: { "value": "boolean" },
|
|
@@ -315,6 +312,18 @@ var init_functionDefs = __esm({
|
|
|
315
312
|
}
|
|
316
313
|
}
|
|
317
314
|
};
|
|
315
|
+
BigQueryDialect = class extends StandardSQLDialect {
|
|
316
|
+
constructor() {
|
|
317
|
+
super();
|
|
318
|
+
this.name = "bigquery";
|
|
319
|
+
}
|
|
320
|
+
getDialectFunctions() {
|
|
321
|
+
return expandBlueprintMap(BIGQUERY_DIALECT_FUNCTIONS);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
registerDialect(new BigQueryDialect());
|
|
325
|
+
globalNamespace = new GlobalNameSpace();
|
|
326
|
+
dialectNamespaces = /* @__PURE__ */ new Map();
|
|
318
327
|
}
|
|
319
328
|
});
|
|
320
329
|
|
|
@@ -939,6 +948,15 @@ function analyzeExpression(expr, scope) {
|
|
|
939
948
|
if (!isExtractUnit(units)) return diag(expr, "Not a valid unit to extract", errExpr2);
|
|
940
949
|
return { node: "extract", type: "number", units, e, isAgg: false };
|
|
941
950
|
}
|
|
951
|
+
case "CastExpression":
|
|
952
|
+
case "TypeCastExpression": {
|
|
953
|
+
let innerExpr = expr.getChild("Expression") || expr.firstChild;
|
|
954
|
+
let e = analyzeExpression(innerExpr, scope);
|
|
955
|
+
let targetTypeStr = txt(expr.getChild("CastType"));
|
|
956
|
+
let type = convertDataType(targetTypeStr);
|
|
957
|
+
if (!type) return diag(expr.getChild("CastType"), `Unsupported cast type: ${targetTypeStr}`, errExpr2);
|
|
958
|
+
return { node: "cast", safe: false, e, dstSQLType: targetTypeStr.toUpperCase(), type, isAgg: e.isAgg };
|
|
959
|
+
}
|
|
942
960
|
case "FunctionCall":
|
|
943
961
|
return analyzeFunctionCall(expr, scope);
|
|
944
962
|
case "Parenthetical":
|
|
@@ -1168,6 +1186,8 @@ function convertDataType(dataType) {
|
|
|
1168
1186
|
return "string";
|
|
1169
1187
|
case "INTEGER":
|
|
1170
1188
|
return "number";
|
|
1189
|
+
case "NUMERIC":
|
|
1190
|
+
return "number";
|
|
1171
1191
|
case "FLOAT":
|
|
1172
1192
|
return "number";
|
|
1173
1193
|
case "FLOAT64":
|
|
@@ -1231,36 +1251,36 @@ var table, primary_key, join, as, on, or, and, like, not, _in, from, inner, left
|
|
|
1231
1251
|
var init_parser_terms = __esm({
|
|
1232
1252
|
"../lang/parser.terms.js"() {
|
|
1233
1253
|
"use strict";
|
|
1234
|
-
table =
|
|
1235
|
-
primary_key =
|
|
1236
|
-
join =
|
|
1237
|
-
as =
|
|
1238
|
-
on =
|
|
1239
|
-
or =
|
|
1240
|
-
and =
|
|
1241
|
-
like =
|
|
1242
|
-
not =
|
|
1243
|
-
_in =
|
|
1244
|
-
from =
|
|
1245
|
-
inner =
|
|
1246
|
-
left =
|
|
1247
|
-
right =
|
|
1248
|
-
full =
|
|
1249
|
-
cross =
|
|
1250
|
-
select =
|
|
1251
|
-
where =
|
|
1252
|
-
group =
|
|
1253
|
-
by =
|
|
1254
|
-
order =
|
|
1255
|
-
asc =
|
|
1256
|
-
desc =
|
|
1257
|
-
limit =
|
|
1258
|
-
offset =
|
|
1259
|
-
is =
|
|
1260
|
-
_null =
|
|
1261
|
-
exists =
|
|
1262
|
-
_true =
|
|
1263
|
-
_false =
|
|
1254
|
+
table = 5;
|
|
1255
|
+
primary_key = 11;
|
|
1256
|
+
join = 15;
|
|
1257
|
+
as = 21;
|
|
1258
|
+
on = 24;
|
|
1259
|
+
or = 33;
|
|
1260
|
+
and = 37;
|
|
1261
|
+
like = 46;
|
|
1262
|
+
not = 48;
|
|
1263
|
+
_in = 58;
|
|
1264
|
+
from = 63;
|
|
1265
|
+
inner = 69;
|
|
1266
|
+
left = 71;
|
|
1267
|
+
right = 73;
|
|
1268
|
+
full = 75;
|
|
1269
|
+
cross = 77;
|
|
1270
|
+
select = 80;
|
|
1271
|
+
where = 87;
|
|
1272
|
+
group = 90;
|
|
1273
|
+
by = 92;
|
|
1274
|
+
order = 98;
|
|
1275
|
+
asc = 102;
|
|
1276
|
+
desc = 104;
|
|
1277
|
+
limit = 107;
|
|
1278
|
+
offset = 109;
|
|
1279
|
+
is = 112;
|
|
1280
|
+
_null = 114;
|
|
1281
|
+
exists = 132;
|
|
1282
|
+
_true = 136;
|
|
1283
|
+
_false = 138;
|
|
1264
1284
|
}
|
|
1265
1285
|
});
|
|
1266
1286
|
|
|
@@ -1316,24 +1336,24 @@ var init_parser = __esm({
|
|
|
1316
1336
|
"../lang/parser.js"() {
|
|
1317
1337
|
"use strict";
|
|
1318
1338
|
init_tokens();
|
|
1319
|
-
spec_Identifier = { __proto__: null, table:
|
|
1339
|
+
spec_Identifier = { __proto__: null, table: 10, primary_key: 22, join: 30, one: 34, many: 38, as: 42, on: 48, or: 66, and: 74, like: 92, not: 96, in: 116, from: 126, inner: 138, left: 142, right: 146, full: 150, cross: 154, select: 160, distinct: 164, where: 174, group: 180, by: 184, having: 190, order: 196, asc: 204, desc: 208, limit: 214, offset: 218, is: 224, null: 228, case: 238, when: 244, then: 248, else: 254, end: 258, exists: 264, true: 272, false: 276, count: 286, extract: 292, cast: 300, extend: 318 };
|
|
1320
1340
|
parser = LRParser.deserialize({
|
|
1321
1341
|
version: 14,
|
|
1322
|
-
states: "
|
|
1323
|
-
stateData: "
|
|
1324
|
-
goto: "
|
|
1325
|
-
nodeNames: "\u26A0
|
|
1326
|
-
maxTerm:
|
|
1342
|
+
states: "HzQYQPOOOOQO'#C_'#C_OOQO'#Dl'#DlOwQPO'#DkOOQO'#D}'#D}O#WQPO'#D|OOQO'#EU'#EUOOQO'#EX'#EXO#_QPO'#EWOOQO'#E^'#E^OOQO'#Ea'#EaO#_QPO'#E`OOQO'#Ej'#EjO#dQPO'#EiOOQO'#Fv'#FvO$QQPO'#DjO$_QPO'#C^OOQO'#Fp'#FpO$_QPO'#FoO$dQPO'#FrQYQPOOQ%XQPO'#FrO%^QPO'#ETO%^QPO'#E]O(qQPO'#CbO({QPO'#CbO)QQPO'#DnO#iQPO'#DpO*_QPO'#DoOOQO'#GW'#GWO,QQPO,5:VO,tQPO'#CbO.WQPO'#CbO/pQPO'#EROOQO'#D]'#D]O0jQPO'#DpOOQO'#EP'#EPOOQO'#ES'#ESOOQO'#ER'#ERO1TQPO,5:hO!PQPO,5:hOOQO'#Eq'#EqOOQO'#Et'#EtOOQO'#Ev'#EvO1xQPO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Q$c#dQ$q#oQ$s#qQ$y#tW%i$[%h&}'dQ%p$pQ%u$vQ&f%cY&k%f&i&n'Z'^Q&q%rQ&s%vQ'Q&WQ'R&XQ'S&YQ'T&ZQ'U&[Q'W&aR'Y&gQnRQ$R!|R%d$S!z!]Tfgsx|!^!b#Q#`#a#b#c#d#h#o#q#t$[$g$p$v$z%c%f%h%l%m%r%v%x&W&X&Y&Z&[&a&g&i&n&}'Z'^'dX%W#z#|%Z%aT%`#|%a",
|
|
1345
|
+
nodeNames: "\u26A0 Program TableStatement Kw Identifier table Ref ColumnDef DataType PrimaryKey Kw primary_key JoinDef JoinType Kw join Kw one Kw many Kw as Alias Kw on BinaryExpression = ComputedDef TypeCastExpression :: CastType BinaryExpression Kw or TypeCastExpression BinaryExpression Kw and ComparisonOp != <> < > <= >= Kw like Kw not AddOp + - MulOp * / % InExpression Kw in InValueList QueryStatement FromClause Kw from TableName Subquery SubqueryExpression JoinClause Kw inner Kw left Kw right Kw full Kw cross SelectClause Kw select Kw distinct SelectItem Wildcard WhereClause Kw where GroupByClause Kw group Kw by HavingClause Kw having OrderByClause Kw order OrderItem Number Kw asc Kw desc LimitClause Kw limit Kw offset NullTestExpression Kw is Kw null UnaryExpression UnaryOperator CaseExpression Kw case WhenClause Kw when Kw then ElseClause Kw else Kw end ExistsExpression Kw exists String Boolean Kw true Kw false Null FunctionCall Count Kw count ExtractExpression Kw extract ExtractUnit CastExpression Kw cast Param Parenthetical InExpression NullTestExpression : ViewStatement ExtendStatement Kw extend",
|
|
1346
|
+
maxTerm: 187,
|
|
1327
1347
|
nodeProps: [
|
|
1328
|
-
["group", -
|
|
1348
|
+
["group", -13, 6, 100, 115, 117, 130, 133, 134, 139, 140, 141, 144, 148, 151, "Expression Expression", -11, 25, 28, 31, 34, 35, 56, 66, 110, 152, 153, 154, "Expression", -2, 64, 65, "TablePrimary"]
|
|
1329
1349
|
],
|
|
1330
|
-
skippedNodes: [0
|
|
1350
|
+
skippedNodes: [0],
|
|
1331
1351
|
repeatNodeCount: 10,
|
|
1332
|
-
tokenData: "*
|
|
1352
|
+
tokenData: "*w~RoX^#Spq#Sqr#wrs$Stu$quv%cwx%hxy&Qyz&Vz{&[{|&a|}&f}!O&k!O!P'[!P!Q'a!Q![(p![!])Z!]!^)h!^!_)m!_!`*S!`!a*X!c!}*f#T#o*f#y#z#S$f$g#S#BY#BZ#S$IS$I_#S$I|$JO#S$JT$JU#S$KV$KW#S&FU&FV#S~#XY$r~X^#Spq#S#y#z#S$f$g#S#BY#BZ#S$IS$I_#S$I|$JO#S$JT$JU#S$KV$KW#S&FU&FV#S~#zP!_!`#}~$SOw~~$VTOr$Srs$fs;'S$S;'S;=`$k<%lO$S~$kO#y~~$nP;=`<%l$S~$tS!Q![%Q!c!}%Q#R#S%Q#T#o%Q~%VS$]~!Q![%Q!c!}%Q#R#S%Q#T#o%Q~%hO!X~~%kTOw%hwx$fx;'S%h;'S;=`%z<%lO%h~%}P;=`<%l%h~&VO$u~~&[O${~~&aO!V~~&fO!S~~&kO$y~~&pP!T~}!O&s~&xS$s~OY&sZ;'S&s;'S;=`'U<%lO&s~'XP;=`<%l&s~'aO$t~~'fP!W~z{'i~'lTOz'iz{'{{;'S'i;'S;=`(j<%lO'i~(OVOz'iz{'{{!P'i!P!Q(e!Q;'S'i;'S;=`(j<%lO'i~(jO$s~~(mP;=`<%l'i~(uQ#W~!O!P({!Q![(p~)OP!Q![)R~)WP#W~!Q![)R~)`P$a~![!])c~)hOm~~)mO%Q~~)rQy~!_!`)x!`!a)}~)}O{~~*SOx~~*XOj~~*^Pz~!_!`*a~*fO|~~*kSS~!Q![*f!c!}*f#R#S*f#T#o*f",
|
|
1333
1353
|
tokenizers: [0],
|
|
1334
|
-
topRules: { "Program": [0,
|
|
1335
|
-
specialized: [{ term:
|
|
1336
|
-
tokenPrec:
|
|
1354
|
+
topRules: { "Program": [0, 1] },
|
|
1355
|
+
specialized: [{ term: 4, get: (value, stack) => specializeIdentifier(value, stack) << 1, external: specializeIdentifier }, { term: 4, get: (value) => spec_Identifier[value] || -1 }],
|
|
1356
|
+
tokenPrec: 3489
|
|
1337
1357
|
});
|
|
1338
1358
|
}
|
|
1339
1359
|
});
|
|
@@ -1506,63 +1526,33 @@ var init_markdown = __esm({
|
|
|
1506
1526
|
});
|
|
1507
1527
|
|
|
1508
1528
|
// ../lang/snowflake.ts
|
|
1509
|
-
function uppercaseMalloyQuery(query) {
|
|
1510
|
-
query.baseTableName = uppercaseIdentifier(query.baseTableName);
|
|
1511
|
-
for (let stage of query.pipeline || []) {
|
|
1512
|
-
let fields = stage.queryFields || [];
|
|
1513
|
-
fields.forEach((field) => uppercaseColumnField(field));
|
|
1514
|
-
let filters = stage.filterList || [];
|
|
1515
|
-
filters.forEach((filter) => uppercaseExpression(filter?.e));
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
1529
|
function uppercaseTable(table2) {
|
|
1519
1530
|
if (table2.upperCased) return;
|
|
1520
1531
|
table2.upperCased = true;
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
if (table2.tablePath) table2.tablePath = uppercaseQualified(table2.tablePath);
|
|
1525
|
-
table2.fields?.forEach((field) => uppercaseField(field));
|
|
1526
|
-
if (table2.query) uppercaseMalloyQuery(table2.query);
|
|
1532
|
+
if (table2.query) return;
|
|
1533
|
+
table2.tablePath = uppercaseIdentifier(table2.tablePath);
|
|
1534
|
+
table2.fields.forEach(uppercaseField);
|
|
1527
1535
|
}
|
|
1528
1536
|
function uppercaseField(field) {
|
|
1529
|
-
if (
|
|
1530
|
-
if (
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
if (field.structPath) field.structPath = field.structPath.map(uppercaseIdentifier);
|
|
1535
|
-
if (field.path) field.path = field.path.map(uppercaseIdentifier);
|
|
1536
|
-
if (field.onExpression) uppercaseExpression(field.onExpression);
|
|
1537
|
-
uppercaseTable(field);
|
|
1538
|
-
} else {
|
|
1539
|
-
uppercaseColumnField(field);
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
function uppercaseColumnField(field) {
|
|
1543
|
-
if (!field) return;
|
|
1537
|
+
if (isJoinField(field)) return uppercaseTable(field);
|
|
1538
|
+
if (field.upperCased) return;
|
|
1539
|
+
field.upperCased = true;
|
|
1540
|
+
if (field.e) return uppercaseExpression(field.e);
|
|
1541
|
+
field.as = field.name;
|
|
1544
1542
|
field.name = uppercaseIdentifier(field.name);
|
|
1545
|
-
if (field.path) field.path = field.path.map(uppercaseIdentifier);
|
|
1546
|
-
if (field.structPath) field.structPath = field.structPath.map(uppercaseIdentifier);
|
|
1547
|
-
if (field.tableName) field.tableName = uppercaseQualified(field.tableName);
|
|
1548
|
-
if (field.tablePath) field.tablePath = uppercaseQualified(field.tablePath);
|
|
1549
|
-
if (field.e) uppercaseExpression(field.e);
|
|
1550
1543
|
}
|
|
1551
1544
|
function uppercaseExpression(expr) {
|
|
1552
1545
|
if (!expr) return;
|
|
1553
1546
|
walkExpression(expr, (node) => {
|
|
1554
|
-
if (
|
|
1555
|
-
|
|
1547
|
+
if (node.type == "field") {
|
|
1548
|
+
node.path = node.path.map(uppercaseIdentifier);
|
|
1549
|
+
}
|
|
1556
1550
|
});
|
|
1557
1551
|
}
|
|
1558
1552
|
function uppercaseIdentifier(value) {
|
|
1559
1553
|
if (!value) return value || "";
|
|
1560
1554
|
return value.toString().toUpperCase();
|
|
1561
1555
|
}
|
|
1562
|
-
function uppercaseQualified(value) {
|
|
1563
|
-
if (!value) return value;
|
|
1564
|
-
return value.split(".").map((part) => part.startsWith('"') && part.endsWith('"') ? part : uppercaseIdentifier(part)).join(".");
|
|
1565
|
-
}
|
|
1566
1556
|
function isJoinField(field) {
|
|
1567
1557
|
return !!field?.join;
|
|
1568
1558
|
}
|
|
@@ -1574,7 +1564,7 @@ var init_snowflake = __esm({
|
|
|
1574
1564
|
});
|
|
1575
1565
|
|
|
1576
1566
|
// ../lang/core.ts
|
|
1577
|
-
import {
|
|
1567
|
+
import { QueryModel } from "@graphenedata/malloy";
|
|
1578
1568
|
import { readFile } from "node:fs/promises";
|
|
1579
1569
|
import { glob } from "glob";
|
|
1580
1570
|
import path2 from "node:path";
|
|
@@ -1635,7 +1625,6 @@ function toSql(query, params = {}) {
|
|
|
1635
1625
|
}));
|
|
1636
1626
|
query = structuredClone(query);
|
|
1637
1627
|
fillInParams(query, params);
|
|
1638
|
-
if (config.dialect == "snowflake") uppercaseMalloyQuery(query);
|
|
1639
1628
|
let visited = /* @__PURE__ */ new Set();
|
|
1640
1629
|
function setStructRefs(obj) {
|
|
1641
1630
|
if (!obj || typeof obj !== "object" || visited.has(obj)) return;
|
|
@@ -1655,7 +1644,6 @@ function toSql(query, params = {}) {
|
|
|
1655
1644
|
});
|
|
1656
1645
|
return qm.compileQuery(query).sql;
|
|
1657
1646
|
}
|
|
1658
|
-
var BigQueryDialect;
|
|
1659
1647
|
var init_core = __esm({
|
|
1660
1648
|
"../lang/core.ts"() {
|
|
1661
1649
|
"use strict";
|
|
@@ -1663,20 +1651,10 @@ var init_core = __esm({
|
|
|
1663
1651
|
init_params();
|
|
1664
1652
|
init_util();
|
|
1665
1653
|
init_config();
|
|
1666
|
-
init_functionDefs();
|
|
1667
1654
|
init_parser();
|
|
1668
1655
|
init_markdown();
|
|
1669
1656
|
init_snowflake();
|
|
1670
|
-
|
|
1671
|
-
constructor() {
|
|
1672
|
-
super();
|
|
1673
|
-
this.name = "bigquery";
|
|
1674
|
-
}
|
|
1675
|
-
getDialectFunctions() {
|
|
1676
|
-
return expandBlueprintMap(BIGQUERY_DIALECT_FUNCTIONS);
|
|
1677
|
-
}
|
|
1678
|
-
};
|
|
1679
|
-
registerDialect(new BigQueryDialect());
|
|
1657
|
+
init_functionDefs();
|
|
1680
1658
|
}
|
|
1681
1659
|
});
|
|
1682
1660
|
|
|
@@ -2118,7 +2096,7 @@ async function startLoopback() {
|
|
|
2118
2096
|
await new Promise((r) => server.listen(0, "127.0.0.1", () => r()));
|
|
2119
2097
|
let addr = server.address();
|
|
2120
2098
|
if (!addr || typeof addr !== "object") throw new Error("Couldnt start oauth callback server");
|
|
2121
|
-
let redirectBase = `http://
|
|
2099
|
+
let redirectBase = `http://127.0.0.1:${addr.port}`;
|
|
2122
2100
|
let waitForCode = new Promise((resolve) => {
|
|
2123
2101
|
server.on("request", (req, res) => {
|
|
2124
2102
|
let url = new URL(req.url || "/", redirectBase);
|
|
@@ -2214,7 +2192,7 @@ var init_auth = __esm({
|
|
|
2214
2192
|
"auth.ts"() {
|
|
2215
2193
|
"use strict";
|
|
2216
2194
|
init_config();
|
|
2217
|
-
AUTH_CLIENT_ID = "connected-app-test-
|
|
2195
|
+
AUTH_CLIENT_ID = "connected-app-test-75eae3e8-efa1-454d-8ad0-66288c750872";
|
|
2218
2196
|
AUTH_SCOPES = "offline_access";
|
|
2219
2197
|
cfgDir = process.env.XDG_CONFIG_HOME || path5.join(os2.homedir(), ".config");
|
|
2220
2198
|
credsPath = path5.join(cfgDir, "graphene", "credentials.json");
|
|
@@ -2489,7 +2467,7 @@ var init_snowflake2 = __esm({
|
|
|
2489
2467
|
order by ordinal_position
|
|
2490
2468
|
`);
|
|
2491
2469
|
return res.rows.map((row) => {
|
|
2492
|
-
return { name: String(row["column_name"]), dataType: String(row["data_type"]) };
|
|
2470
|
+
return { name: String(row["column_name"]).toLowerCase(), dataType: String(row["data_type"]) };
|
|
2493
2471
|
});
|
|
2494
2472
|
}
|
|
2495
2473
|
};
|
|
@@ -2685,6 +2663,7 @@ async function createConfig() {
|
|
|
2685
2663
|
optimizeDeps: {
|
|
2686
2664
|
noDiscovery: process.env.NODE_ENV == "test",
|
|
2687
2665
|
// tests manually optimize before starting test workers
|
|
2666
|
+
exclude: ["virtual:nav"],
|
|
2688
2667
|
include: [
|
|
2689
2668
|
"@graphenedata/cli > svelte",
|
|
2690
2669
|
"@graphenedata/cli > ssf",
|
package/dist/docs/graphene.md
CHANGED
|
@@ -575,8 +575,8 @@ Here's an example:
|
|
|
575
575
|
|----------|-------------|----------|---------|---------|
|
|
576
576
|
| data | Query name, wrapped in curly braces | true | query name | - |
|
|
577
577
|
| x | Column or expression to use for the x-axis of the chart | false | column name, stored expression name, GSQL expression | First column |
|
|
578
|
-
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | false | column name, stored expression name, GSQL expression, list of any combination of these | Any non-assigned numeric columns |
|
|
579
|
-
| y2 | Column(s) or expression(s) to include on a secondary y-axis. | false | column name, stored expression name, GSQL expression, list of any combination of these | - |
|
|
578
|
+
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | false | column name, stored expression name, GSQL expression, list of any combination of these e.g. `"col1, my_expr"` | Any non-assigned numeric columns |
|
|
579
|
+
| y2 | Column(s) or expression(s) to include on a secondary y-axis. | false | column name, stored expression name, GSQL expression, list of any combination of these e.g. `"col1, my_expr"` | - |
|
|
580
580
|
| y2SeriesType | Chart type to apply to the series on the y2 axis | false | `bar`, `line`, `scatter` | `bar` |
|
|
581
581
|
| series | Column or expression to use to define the series (groups) in a multi-series chart. Use when values of a particular column dictate the multiple series to plot, eg. `country` would create a series for every distinct country in the column. | false | column name, stored expression name, GSQL expression | - |
|
|
582
582
|
| sort | Whether to apply default sort to your data. Default sort is x ascending for number and date x-axes, and y descending for category x-axes | false | `true`, `false` | `true` |
|
|
@@ -598,7 +598,7 @@ Here's an example:
|
|
|
598
598
|
| outlineWidth | Width of line surrounding each bar | number | `0` |
|
|
599
599
|
| outlineColor | Color to use for outline if outlineWidth > 0 | CSS name, hexademical, RGB, HSL | - |
|
|
600
600
|
| colorPalette | List of custom colors to use for the chart | list of color strings (CSS name, hexademical, RGB, HSL) e.g. `"#cf0d06, #eb5752, #e88a87"` | built-in color palette |
|
|
601
|
-
| seriesOrder | Apply a specific order to the series in a multi-series chart. | list of series names in the order they should be used in the chart `"Canada, US"` | default order implied by the data |
|
|
601
|
+
| seriesOrder | Apply a specific order to the series in a multi-series chart. | list of series names in the order they should be used in the chart e.g. `"Canada, US"` | default order implied by the data |
|
|
602
602
|
| leftPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | number | - |
|
|
603
603
|
| rightPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | number | - |
|
|
604
604
|
| xLabelWrap | Whether to wrap x-axis labels when there is not enough space. Default behaviour is to truncate the labels. | `true`, `false` | `false` |
|
|
@@ -723,8 +723,8 @@ Here's an example:
|
|
|
723
723
|
|------|-------------|----------|---------|---------|
|
|
724
724
|
| data | Query name, wrapped in curly braces | true | query name | - |
|
|
725
725
|
| x | Column or expression to use for the x-axis of the chart | true | column name, stored expression name, GSQL expression | - |
|
|
726
|
-
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | true | column name, stored expression name, GSQL expression, list of any combination of these | - |
|
|
727
|
-
| y2 | Column(s) or expression(s) to include on a secondary y-axis. | false | column name, stored expression name, GSQL expression, list of any combination of these | - |
|
|
726
|
+
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | true | column name, stored expression name, GSQL expression, list of any combination of these e.g. `"col1, my_expr"` | - |
|
|
727
|
+
| y2 | Column(s) or expression(s) to include on a secondary y-axis. | false | column name, stored expression name, GSQL expression, list of any combination of these e.g. `"col1, my_expr"` | - |
|
|
728
728
|
| y2SeriesType | Chart type to apply to the series on the y2 axis | false | `line`, `bar`, `scatter` | `line` |
|
|
729
729
|
| series | Column or expression to use to define the series (groups) in a multi-series chart. Use when values of a particular column dictate the multiple series to plot, eg. `country` would create a series for every distinct country in the column. | false | column name, stored expression name, GSQL expression | - |
|
|
730
730
|
| sort | Whether to apply default sort to your data. Default is x ascending for number and date x-axes, and y descending for category x-axes | false | `true`, `false` | `true` |
|
|
@@ -750,7 +750,7 @@ Here's an example:
|
|
|
750
750
|
| markerShape | Shape to use if markers=true | false | `circle`, `emptyCircle`, `rect`, `triangle`, `diamond` | `circle` |
|
|
751
751
|
| markerSize | Size of each shape (in pixels) | false | number | `8` |
|
|
752
752
|
| colorPalette | List of custom colors to use for the chart | false | list of color strings (CSS name, hexademical, RGB, HSL) e.g. `"#cf0d06, #eb5752, #e88a87"` | - |
|
|
753
|
-
| seriesOrder | Apply a specific order to the series in a multi-series chart. | false | list of series names in the order they should be used in the chart `"Canada, US"` | default order implied by the data |
|
|
753
|
+
| seriesOrder | Apply a specific order to the series in a multi-series chart. | false | list of series names in the order they should be used in the chart e.g. `"Canada, US"` | default order implied by the data |
|
|
754
754
|
| labels | Show value labels | false | `true`, `false` | `false` |
|
|
755
755
|
| labelSize | Font size of value labels | false | number | `11` |
|
|
756
756
|
| labelPosition | Where label will appear on your series | false | `above`, `middle`, `below` | `above` |
|
|
@@ -832,7 +832,7 @@ Here's an example:
|
|
|
832
832
|
|------|-------------|----------|---------|---------|
|
|
833
833
|
| data | Query name, wrapped in curly braces | true | query name | - |
|
|
834
834
|
| x | Column or expression to use for the x-axis of the chart | true | column name, stored expression name, GSQL expression | First column |
|
|
835
|
-
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | true | column name, stored expression name, GSQL expression, list of any combination of these | Any non-assigned numeric columns |
|
|
835
|
+
| y | Column(s) or expression(s) to use for the y-axis of the chart. Each will create its own series. Consider a split axis with `y2` if there is a difference of scale or unit of measure between the series. | true | column name, stored expression name, GSQL expression, list of any combination of these e.g. `"col1, my_expr"` | Any non-assigned numeric columns |
|
|
836
836
|
| series | Column or expression to use to define the series (groups) in a multi-series chart. Use when values of a particular column dictate the multiple series to plot, eg. `country` would create a series for every distinct country in the column. | false | column name, stored expression name, GSQL expression | - |
|
|
837
837
|
| sort | Whether to apply default sort to your data. Default sort is x ascending for number and date x-axes, and y descending for category x-axes | false | `true`, `false` | `true` |
|
|
838
838
|
| type | Grouping method to use for multi-series charts | false | `stacked`, `stacked100` | `stacked` |
|
|
@@ -854,7 +854,7 @@ Here's an example:
|
|
|
854
854
|
| fillOpacity | % of the full color that should be rendered, with remainder being transparent | false | number (0 to 1) | `0.7` |
|
|
855
855
|
| line | Show line on top of the area | false | `true`, `false` | `true` |
|
|
856
856
|
| colorPalette | List of custom colors to use for the chart | false | list of color strings (CSS name, hexademical, RGB, HSL) e.g. `"#cf0d06, #eb5752, #e88a87"` | built-in color palette |
|
|
857
|
-
| seriesOrder | Apply a specific order to the series in a multi-series chart. | false | list of series names in the order they should be used in the chart `"Canada, US"` | default order implied by the data |
|
|
857
|
+
| seriesOrder | Apply a specific order to the series in a multi-series chart. | false | list of series names in the order they should be used in the chart e.g. `"Canada, US"` | default order implied by the data |
|
|
858
858
|
| leftPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | false | number | - |
|
|
859
859
|
| rightPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | false | number | - |
|
|
860
860
|
| xLabelWrap | Whether to wrap x-axis labels when there is not enough space. Default behaviour is to truncate the labels. | false | `true`, `false` | `false` |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The query engine gathers query requests and inputs from components, and issues requests to the server.
|
|
2
2
|
// When inputs change, it takes care of notifying affected components and requesting new data.
|
|
3
3
|
|
|
4
|
-
import {cacheRead, cacheWrite, getHashes} from './clientCache'
|
|
4
|
+
import {cacheRead, cacheWrite, getHashes} from './clientCache.ts'
|
|
5
5
|
import {errorProvider} from './telemetry.ts'
|
|
6
6
|
|
|
7
7
|
interface QueryResult {
|
|
@@ -36,6 +36,8 @@ function registerQuery (name: string, contents: string) {
|
|
|
36
36
|
queries.push({name, contents, loading: false, fields: new Map(), errors: []})
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
const getRoutePath = () => typeof window === 'undefined' ? '/' : (window.location.pathname || '/')
|
|
40
|
+
|
|
39
41
|
function updateParam (name: string, value: any) {
|
|
40
42
|
params[name] = value
|
|
41
43
|
runAll() // for now, do the easy thing and reload it all
|
|
@@ -79,7 +81,7 @@ async function runNode (n: QueryNode) {
|
|
|
79
81
|
let response = await fetch('/_api/query', {
|
|
80
82
|
method: 'POST',
|
|
81
83
|
headers: {'Content-Type': 'application/json'},
|
|
82
|
-
body: JSON.stringify({params, gsql, hashes}),
|
|
84
|
+
body: JSON.stringify({params, gsql, hashes, routePath: getRoutePath()}),
|
|
83
85
|
})
|
|
84
86
|
let hash = response.headers.get('ETag') || ''
|
|
85
87
|
|