@nongt/visql-core 0.6.0 → 0.7.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.
@@ -1,7 +1,7 @@
1
1
  var kt = Object.defineProperty;
2
2
  var Ct = (o, T, U) => T in o ? kt(o, T, { enumerable: !0, configurable: !0, writable: !0, value: U }) : o[T] = U;
3
3
  var gt = (o, T, U) => Ct(o, typeof T != "symbol" ? T + "" : T, U);
4
- import { c as Dt, d as nt, p as It, D as Ut, e as bt, g as Rt, j as Mt, q as qt, k as Nt, l as wt, m as xt, n as Ft, t as $t, o as Bt, r as Wt } from "./schema-z95dxLxu.js";
4
+ import { c as Dt, d as nt, p as It, D as Ut, e as bt, g as Rt, j as Mt, q as qt, k as Nt, l as wt, m as xt, n as Ft, t as $t, o as Bt, r as Wt } from "./schema-DFC26AhZ.js";
5
5
  import { t as Pt, f as _t, a as Gt } from "./calendarDate-CYlr9TvX.js";
6
6
  function Lt(o, T, U = T) {
7
7
  const L = o.slice(0, T);
@@ -113,6 +113,8 @@ export declare const DEFAULT_MESSAGES: {
113
113
  openUnionBranch: (table: string) => string;
114
114
  removeUnionBranch: (table: string) => string;
115
115
  joinTableGroup: string;
116
+ /** The heading over tables in no group, when others have one. */
117
+ otherTablesGroup: string;
116
118
  /** Free-form unions (issue 153): a new one, the query as one's first
117
119
  * query, another query for one, and a new query's canvas. */
118
120
  createUnion: string;
@@ -9,6 +9,13 @@ export interface Table {
9
9
  name: string;
10
10
  label: string;
11
11
  columns: TableColumn[];
12
+ /** The heading the table pickers list it under, such as its business
13
+ * area. Groups come in the order of their first table in the schema. */
14
+ group?: string;
15
+ /** A line under the label in the table pickers. The search matches it. */
16
+ description?: string;
17
+ /** Anything the host's own code needs about the table. Never read here. */
18
+ meta?: unknown;
12
19
  }
13
20
  export interface TableColumn {
14
21
  name: string;
@@ -75,6 +82,18 @@ export declare function filterSchema(schema: DatabaseSchema, tableFilter?: (tabl
75
82
  /** Every table in the schema, sorted by label — the canonical source for both
76
83
  * FieldView's column picker and FromFlowNode's table pickers. */
77
84
  export declare function allTables(schema: DatabaseSchema): Table[];
85
+ /** One heading's tables in a table picker: `group` undefined for the
86
+ * tables in no group. */
87
+ export interface TableGroup {
88
+ group: string | undefined;
89
+ tables: Table[];
90
+ }
91
+ /** `tables` as a table picker lists them (issue 245): the groups in the
92
+ * order of their first table in `order` (the whole schema, whose order the
93
+ * host decides, so every picker has its groups in the same order), the
94
+ * tables in each sorted by label, and the tables in no group last. With no
95
+ * group at all, one list sorted by label, as before. */
96
+ export declare function tableGroups(tables: readonly Table[], groupOf?: (table: Table) => string | undefined, order?: readonly Table[]): TableGroup[];
78
97
  export declare function findTable(schema: DatabaseSchema, name: string): Table | undefined;
79
98
  /** Every foreign key touching `tableName`, in either direction — whether it
80
99
  * holds the key or is referenced by one. */
@@ -14,7 +14,7 @@ export { relativeDateLabel } from './core/relativeDates.js';
14
14
  export { QUERY_FORMAT_VERSION, QueryFormatError, loadQuery, saveQuery, type StoredQuery, } from './core/storedQuery.js';
15
15
  export type { ResolveName } from './core/resolveNames.js';
16
16
  export { astToParameterizedSql, astToSql, DIALECTS, DIALECT_LABELS, type ParameterizedSql, type ParameterizedSqlOptions, type SqlDialect, } from './core/sqlGen.js';
17
- export { EMPTY_SCHEMA, filterSchema, validateSchema, type DatabaseColumnType, type DatabaseSchema, type ColumnOption, type Relation, type SchemaIssue, type SchemaIssueKind, type Table, type TableColumn, } from './core/schema.js';
17
+ export { EMPTY_SCHEMA, filterSchema, validateSchema, type DatabaseColumnType, type DatabaseSchema, type ColumnOption, type Relation, type SchemaIssue, type SchemaIssueKind, type Table, type TableColumn, type TableGroup, } from './core/schema.js';
18
18
  export { QUERY_ISSUE_KINDS, QUERY_WARNING_KINDS, validateQuery, type QueryIssue, type QueryIssueKind, type QueryWarningKind, type QueryIssueSeverity, type ValidateQueryOptions, } from './core/queryValidation.js';
19
19
  export { default as issueLocation, type IssueLocationStep } from './core/issueLocation.js';
20
20
  export { DEFAULT_FUNCTIONS, functionsForDialect, type ArgDef, type ArgKind, type FunctionRegistry, type FunctionSignature, } from './core/functionRegistry.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nongt/visql-core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "The query logic of @nongt/visql, for a backend: load, check, scope, write SQL, import SQL. No React, no dependencies.",
5
5
  "keywords": [
6
6
  "sql",