@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 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
- let d = getDialect(dialect);
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, BIGQUERY_DIALECT_FUNCTIONS;
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 = 6;
1235
- primary_key = 12;
1236
- join = 16;
1237
- as = 22;
1238
- on = 25;
1239
- or = 31;
1240
- and = 34;
1241
- like = 43;
1242
- not = 45;
1243
- _in = 55;
1244
- from = 60;
1245
- inner = 66;
1246
- left = 68;
1247
- right = 70;
1248
- full = 72;
1249
- cross = 74;
1250
- select = 77;
1251
- where = 84;
1252
- group = 87;
1253
- by = 89;
1254
- order = 95;
1255
- asc = 99;
1256
- desc = 101;
1257
- limit = 104;
1258
- offset = 106;
1259
- is = 109;
1260
- _null = 111;
1261
- exists = 129;
1262
- _true = 133;
1263
- _false = 135;
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: 12, primary_key: 24, join: 32, one: 36, many: 40, as: 44, on: 50, or: 62, and: 68, like: 86, not: 90, in: 110, from: 120, inner: 132, left: 136, right: 140, full: 144, cross: 148, select: 154, distinct: 158, where: 168, group: 174, by: 178, having: 184, order: 190, asc: 198, desc: 202, limit: 208, offset: 212, is: 218, null: 222, case: 232, when: 238, then: 242, else: 248, end: 252, exists: 258, true: 266, false: 270, count: 280, extract: 286, extend: 306 };
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: "G`QYQPOOOOQO'#C`'#C`OOQO'#Di'#DiOwQPO'#DhOOQO'#Dz'#DzO#TQPO'#DyOOQO'#ER'#EROOQO'#EU'#EUO#[QPO'#ETOOQO'#EZ'#EZOOQO'#E^'#E^O#[QPO'#E]OOQO'#Eg'#EgO#aQPO'#EfOOQO'#Fp'#FpO#}QPO'#DgO$[QPO'#C_OOQO'#Fj'#FjO$[QPO'#FiO$aQPO'#FlQYQPOOQ%UQPO'#FlO%ZQPO'#EQO%ZQPO'#EYO(hQPO'#CcO(rQPO'#CcO(wQPO'#DkO#fQPO'#DmO*UQPO'#DlOOQO'#GP'#GPO+wQPO,5:SO,kQPO'#CcO-zQPO'#CcOOQO'#DY'#DYO.SQP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R&Z%YT%R#v%SX%O#v#x%S%YbxTw!`#R$U$s%a%b%pQ!hfQ!igQ#QrQ#h|Q#o!]Q$Q#OQ$^#aQ$_#bQ$`#cQ$a#dQ$b#eQ$k#lQ$m#nW%d$Z%c&r'WQ%i$jQ%n$pQ&]%[Y&b%_&`&e'O'RQ&h%kQ&j%oQ&u%}Q&v&OQ&w&PQ&x&QQ&y&RQ&{&WR&}&^QnRQ#}!zR%]$O!x![Tfgrw|!]!`#O#R#a#b#c#d#e#l#n$U$Z$j$p$s%[%_%a%b%c%k%o%p%}&O&P&Q&R&W&^&`&e&r'O'R'WX%P#v#x%S%YT%X#x%Y",
1325
- nodeNames: "\u26A0 Comment 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 BinaryExpression Kw or 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 Param Parenthetical InExpression NullTestExpression : ViewStatement ExtendStatement Kw extend",
1326
- maxTerm: 180,
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$Q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[$p$v%U%Z%a%c%f%h%r%v&W&X&Y&Z&[&a&g&i&n&y&}'Z'^'d'g'hbpTx!b#h$g$z%l%m%xT!nipQ%Z#zR&_%ZQ%e$US&h%e&mR&m%id_Odks#p$[%]%h&}'dR!e_Q#PnR$T#PQ#iwU$h#i$i${Q$i#jR${#uQ%Q#wR%{%QQ#n|Q$j#kT$k#n$jQ%a#|R&d%aT%Y#z%ZX%V#z#|%Z%abqTx!b#h$g$z%l%m%xQ!jfQ!kgQ#gsQ#k|Q#r!^Q$U#QQ$_#`Q$`#aQ$a#bQ$b#cQ$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", -12, 7, 97, 112, 114, 127, 130, 131, 136, 137, 138, 141, 145, "Expression Expression", -9, 26, 29, 32, 53, 63, 107, 146, 147, 148, "Expression", -2, 61, 62, "TablePrimary"]
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, 1],
1350
+ skippedNodes: [0],
1331
1351
  repeatNodeCount: 10,
1332
- tokenData: "*o~RoX^#Spq#Sqr#wrs$Stu$quv%cwx%hxy&Qyz&Vz{&[{|&a|}&f}!O&k!O!P'[!P!Q'a!Q![(p![!])Z!]!^)`!^!_)e!_!`)z!`!a*P!c!}*^#T#o*^#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$l~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!_!`#}~$SOt~~$VTOr$Srs$fs;'S$S;'S;=`$k<%lO$S~$kO#v~~$nP;=`<%l$S~$tS!Q![%Q!c!}%Q#R#S%Q#T#o%Q~%VS$V~!Q![%Q!c!}%Q#R#S%Q#T#o%Q~%hO!U~~%kTOw%hwx$fx;'S%h;'S;=`%z<%lO%h~%}P;=`<%l%h~&VO$n~~&[O$t~~&aO!S~~&fO!P~~&kO$r~~&pP!Q~}!O&s~&xSP~OY&sZ;'S&s;'S;=`'U<%lO&s~'XP;=`<%l&s~'aO$m~~'fP!T~z{'i~'lTOz'iz{'{{;'S'i;'S;=`(j<%lO'i~(OVOz'iz{'{{!P'i!P!Q(e!Q;'S'i;'S;=`(j<%lO'i~(jOP~~(mP;=`<%l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entifier(value, stack) << 1, external: specializeIdentifier }, { term: 5, get: (value) => spec_Identifier[value] || -1 }],
1336
- tokenPrec: 2964
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
- table2.name = uppercaseIdentifier(table2.name);
1522
- if (table2.primaryKey) table2.primaryKey = uppercaseIdentifier(table2.primaryKey);
1523
- if (table2.tableName) table2.tableName = uppercaseQualified(table2.tableName);
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 (!field) return;
1530
- if (isJoinField(field)) {
1531
- field.name = uppercaseIdentifier(field.name);
1532
- if (field.tableName) field.tableName = uppercaseQualified(field.tableName);
1533
- if (field.tablePath) field.tablePath = uppercaseQualified(field.tablePath);
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 (Array.isArray(node.path)) node.path = node.path.map(uppercaseIdentifier);
1555
- if (Array.isArray(node.structPath)) node.structPath = node.structPath.map(uppercaseIdentifier);
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 { registerDialect, StandardSQLDialect, QueryModel, expandBlueprintMap } from "@graphenedata/malloy";
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
- BigQueryDialect = class extends StandardSQLDialect {
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://localhost:${addr.port}`;
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-4685a2a0-1cb9-4a81-a6bf-01a3efe7b981";
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",
@@ -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
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "cli.ts",
4
4
  "type": "module",
5
5
  "author": "Graphene Systems Inc",
6
- "version": "0.0.8",
6
+ "version": "0.0.10",
7
7
  "license": "Elastic-2.0",
8
8
  "engines": {
9
9
  "node": ">=16"