@nongt/visql-core 0.4.2 → 0.6.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/README.md +1 -1
- package/dist/{core-api-BRJV9MUQ.js → core-api-Bg_I2ak0.js} +437 -426
- package/dist/core.js +2 -2
- package/dist/{issueLocation-CWUdTtCh.js → issueLocation-CD9XckYv.js} +1276 -1193
- package/dist/types/core/i18n/defaultMessages.d.ts +2 -0
- package/dist/types/core/queryValidation.d.ts +5 -2
- package/dist/types/core/schema.d.ts +7 -0
- package/package.json +14 -1
|
@@ -325,8 +325,10 @@ export declare const DEFAULT_MESSAGES: {
|
|
|
325
325
|
issueUnionTypes: string;
|
|
326
326
|
issueSharedOrder: string;
|
|
327
327
|
issueUnusedShared: string;
|
|
328
|
+
issueJoinOnlyColumn: string;
|
|
328
329
|
issueUnknownTableNamed: (table: string) => string;
|
|
329
330
|
issueUnknownColumnNamed: (table: string, column: string) => string;
|
|
331
|
+
issueJoinOnlyColumnNamed: (column: string) => string;
|
|
330
332
|
issueTableNotInQueryNamed: (table: string) => string;
|
|
331
333
|
issueUnqualifiedFieldNamed: (column: string) => string;
|
|
332
334
|
issueAmbiguousTableNamed: (table: string) => string;
|
|
@@ -131,8 +131,11 @@ export type QueryIssueKind =
|
|
|
131
131
|
* `shared` — or is itself: a shared query uses only those before it. */
|
|
132
132
|
| 'sharedOrder'
|
|
133
133
|
/** A warning: a shared query used nowhere. It changes no row. */
|
|
134
|
-
| 'unusedShared'
|
|
135
|
-
|
|
134
|
+
| 'unusedShared'
|
|
135
|
+
/** A join-only column (a key, issue 234) used outside a join's ON or an
|
|
136
|
+
* EXISTS's link, and not in a sub query's SELECT or GROUP BY. */
|
|
137
|
+
| 'joinOnlyColumn';
|
|
138
|
+
export declare const QUERY_ISSUE_KINDS: readonly ["invalidStructure", "duplicateId", "unknownTable", "unknownColumn", "tableNotInQuery", "unqualifiedField", "incomplete", "argCount", "ambiguousTable", "duplicateTableName", "derivedColumnName", "unknownFunction", "joinOrder", "distinctSort", "notGrouped", "unknownAggregate", "misplacedAggregate", "paramConflict", "fanOut", "crossJoin", "unlinkedJoin", "drillAcrossOutOfStep", "drillAcrossFilterMixed", "tooLong", "dialectUnsupported", "subqueryColumns", "notInSubquery", "noLimit", "limitTooHigh", "typeMismatch", "invalidPattern", "unionColumns", "unionTypes", "sharedOrder", "unusedShared", "joinOnlyColumn"];
|
|
136
139
|
/** The kinds that are warnings: the query can run with them. Only these
|
|
137
140
|
* can be hidden (ValidateQueryOptions' hideWarnings). */
|
|
138
141
|
export declare const QUERY_WARNING_KINDS: readonly ["fanOut", "crossJoin", "unlinkedJoin", "drillAcrossFilterMixed", "notInSubquery", "noLimit", "limitTooHigh", "typeMismatch", "unknownAggregate", "unusedShared"];
|
|
@@ -27,6 +27,13 @@ export interface TableColumn {
|
|
|
27
27
|
* (`<`, `>`) compares the text: only a form from the largest unit down
|
|
28
28
|
* (`YYYY-MM-DD`, `HH:mm`) orders as the dates and times do. */
|
|
29
29
|
format?: string;
|
|
30
|
+
/** A key, for joining tables only (issue 234): the editor uses it in a
|
|
31
|
+
* join's ON and an EXISTS's link (from `relations`), but never offers it
|
|
32
|
+
* as a value, a condition, a group or a sort key. A sub query may select
|
|
33
|
+
* it (and group by it), to be joined by it outside, where that column is
|
|
34
|
+
* join-only too. `validateQuery` reports one used anywhere else
|
|
35
|
+
* (`joinOnlyColumn`). */
|
|
36
|
+
joinOnly?: boolean;
|
|
30
37
|
}
|
|
31
38
|
export interface ColumnOption {
|
|
32
39
|
value: string | number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nongt/visql-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -40,5 +40,18 @@
|
|
|
40
40
|
"types": "./dist/types/fixtures.d.ts",
|
|
41
41
|
"import": "./dist/fixtures.js"
|
|
42
42
|
}
|
|
43
|
+
},
|
|
44
|
+
"typesVersions": {
|
|
45
|
+
"*": {
|
|
46
|
+
"core": [
|
|
47
|
+
"./dist/types/core-api.d.ts"
|
|
48
|
+
],
|
|
49
|
+
"sql-import": [
|
|
50
|
+
"./dist/types/sql-import.d.ts"
|
|
51
|
+
],
|
|
52
|
+
"fixtures": [
|
|
53
|
+
"./dist/types/fixtures.d.ts"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
43
56
|
}
|
|
44
57
|
}
|