@nongt/visql 0.3.0 → 0.4.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.
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { D as e, E as r, M as o, b as n, f as i, a as d, h as t, i as u, v as l } from "./schema-z95dxLxu.js";
2
- import { M as m, a as E, b as T, Q as y, I as c, S as h, d as p, p as Q, e as _, f as U, g as b, c as A, h as M, K as N, B as D, q as I, k as B, t as f, v, m as L, G as C, H as R, w as F, r as G, x as q, i as x, C as H, E as P, F as g, y as k, s as O, z as X, A as Y, j, o as J, l as w, n as K, u as z, J as W } from "./issueLocation-Cw5sttQL.js";
2
+ import { M as m, a as E, b as T, Q as y, I as c, S as h, d as p, p as Q, e as _, f as U, g as b, c as A, h as M, K as N, B as D, q as I, k as B, t as f, v, m as L, G as C, H as R, w as F, r as G, x as q, i as x, C as H, E as P, F as g, y as k, s as O, z as X, A as Y, j, o as J, l as w, n as K, u as z, J as W } from "./issueLocation-CWUdTtCh.js";
3
3
  import { c as Z, f as $, i as aa } from "./calendarDate-CYlr9TvX.js";
4
- import { D as ea, q as ra, Q as oa, n as na, S as ia, c as da, d as ta, e as ua, f as la, g as Sa, a as ma, b as Ea, h as Ta, o as ya, r as ca, i as ha, p as pa, s as Qa, j as _a, k as Ua, l as ba, m as Aa, u as Ma } from "./core-api-CBN6rAQG.js";
4
+ import { D as ea, q as ra, Q as oa, n as na, S as ia, c as da, d as ta, e as ua, f as la, g as Sa, a as ma, b as Ea, h as Ta, o as ya, r as ca, i as ha, p as pa, s as Qa, j as _a, k as Ua, l as ba, m as Aa, u as Ma } from "./core-api-DcJQGdVP.js";
5
5
  export {
6
6
  e as DEFAULT_FUNCTIONS,
7
7
  ea as DIALECTS,
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { P as Q, f as U, a as D } from "./PipelineEditor-DNZkDSaY.js";
1
+ import { P as Q, f as U, a as D } from "./PipelineEditor-BoFPDUmi.js";
2
2
  import { D as b, E as x, M as B, b as F, f as I, a as v, h as L, i as P, v as R } from "./schema-z95dxLxu.js";
3
- import { D as k, M as q, a as C, b as G, Q as H, I as w, S as X, d as W, p as Y, e as j, f as J, g as z, c as K, h as V, K as Z, B as $, q as ee, k as ae, t as se, v as te, m as re, G as ne, H as oe, w as ie, r as de, x as ce, i as ue, C as le, E as fe, F as me, y as he, s as pe, z as Se, A as Ee, j as Te, o as ge, l as Ne, n as _e, u as ye, J as Ae } from "./issueLocation-Cw5sttQL.js";
3
+ import { D as k, M as q, a as C, b as G, Q as H, I as w, S as X, d as W, p as Y, e as j, f as J, g as z, c as K, h as V, K as Z, B as $, q as ee, k as ae, t as se, v as te, m as re, G as ne, H as oe, w as ie, r as de, x as ce, i as ue, C as le, E as fe, F as me, y as he, s as pe, z as Se, A as Ee, j as Te, o as ge, l as Ne, n as _e, u as ye, J as Ae } from "./issueLocation-CWUdTtCh.js";
4
4
  import { c as Ue, f as De, i as Me } from "./calendarDate-CYlr9TvX.js";
5
- import { w as m, a as h, b as p } from "./core-api-CBN6rAQG.js";
6
- import { D as xe, q as Be, Q as Fe, n as Ie, S as ve, c as Le, d as Pe, e as Re, f as Oe, g as ke, h as qe, o as Ce, r as Ge, i as He, p as we, s as Xe, j as We, k as Ye, l as je, m as Je, u as ze } from "./core-api-CBN6rAQG.js";
5
+ import { w as m, a as h, b as p } from "./core-api-DcJQGdVP.js";
6
+ import { D as xe, q as Be, Q as Fe, n as Ie, S as ve, c as Le, d as Pe, e as Re, f as Oe, g as ke, h as qe, o as Ce, r as Ge, i as He, p as we, s as Xe, j as We, k as Ye, l as je, m as Je, u as ze } from "./core-api-DcJQGdVP.js";
7
7
  import { D as Ve } from "./tokens-BTaVMSOx.js";
8
8
  function T(n, s, e = {}) {
9
9
  const a = { paths: [] }, t = m(a, () => e.parameterized ? h(n, s, e).sql : p(n, s, e));
@@ -3123,7 +3123,7 @@ export {
3123
3123
  ti as a8,
3124
3124
  ls as a9,
3125
3125
  ne as aA,
3126
- de as aB,
3126
+ Ee as aB,
3127
3127
  Ve as aC,
3128
3128
  ke as aD,
3129
3129
  en as aE,
package/dist/mui.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as n, jsxs as P } from "react/jsx-runtime";
2
2
  import { useMemo as H, useState as w, useRef as A, useLayoutEffect as G } from "react";
3
- import { P as K } from "./PipelineEditor-DNZkDSaY.js";
3
+ import { P as K } from "./PipelineEditor-BoFPDUmi.js";
4
4
  import Q from "@emotion/cache";
5
5
  import { CacheProvider as U } from "@emotion/react";
6
6
  import { TextField as R, Menu as J, ListSubheader as _, MenuItem as $, Box as y, createFilterOptions as X, Autocomplete as D, Select as Y, InputBase as Z, Button as ee, IconButton as te, Tooltip as oe, Chip as re } from "@mui/material";
@@ -131,6 +131,7 @@ export type PipelineAction = {
131
131
  } | {
132
132
  type: 'clearPaging';
133
133
  };
134
+ export declare function generateJoinId(): string;
134
135
  /** Every distinct table referenced by a field in `ast` (deduplicated, in first-seen
135
136
  * order) — used to auto-add tables to the pipeline as a WHERE condition references
136
137
  * them. Only fields with an explicit `.table` count — an unqualified field doesn't
@@ -18,7 +18,10 @@ export declare class ScopeError extends Error {
18
18
  readonly path: (string | number)[];
19
19
  /** The table it reads that needs scope. */
20
20
  readonly table: string;
21
- constructor(path: (string | number)[], table: string, missing: string);
21
+ /** The alias that copy of the table goes by, when it has one (a self
22
+ * join reads a table more than once, issue 216). */
23
+ readonly alias?: string;
24
+ constructor(path: (string | number)[], table: string, missing: string, alias?: string);
22
25
  }
23
26
  /** `query` with `rule.condition` in **every** body that reads a table
24
27
  * `rule.requires` accepts (issue 151): the query itself, each derived
@@ -35,11 +38,14 @@ export declare class ScopeError extends Error {
35
38
  * left out is exactly the leak.
36
39
  * Call it after validateQuery, on the checked query. */
37
40
  export declare function scopeQuery(schema: DatabaseSchema, query: QueryPipeline, rule: ScopeRule): QueryPipeline;
38
- /** Every body of `query` that reads a table `rule.requires` accepts without
39
- * `rule.condition` ANDed at the top of its WHERE — where it is, and the
40
- * table. Empty: `query` is scoped everywhere (see scopeQuery). For a query
41
- * built or received some other way. */
42
- export declare function unscopedBodies(query: QueryPipeline, rule: ScopeRule): {
41
+ /** Every copy of a table `rule.requires` accepts, in every body of `query`,
42
+ * that isn't scoped: the condition's tables not joined through it, or the
43
+ * condition naming them not ANDed at the top of its WHERE — where it is,
44
+ * the table, and the alias that copy goes by (a self join reads a table
45
+ * more than once, issue 216). Empty: `query` is scoped everywhere (see
46
+ * scopeQuery). For a query built or received some other way. */
47
+ export declare function unscopedBodies(schema: DatabaseSchema, query: QueryPipeline, rule: ScopeRule): {
43
48
  path: (string | number)[];
44
49
  table: string;
50
+ alias?: string;
45
51
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nongt/visql",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A visual SQL query editor for React: build a whole query on a node canvas, store it as JSON, turn it into SQL.",
5
5
  "keywords": [
6
6
  "sql",