@coldsmirk/inkstone-sql 0.24.0 → 0.25.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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Schema-aware SQL editing intelligence for Monaco: lexical statement reading under per-dialect noise profiles, catalog-driven completion / hover / signature help, unified-placeholder awareness, `sql-formatter` integration, and a drop-in React `<SqlEditor>`.
4
4
 
5
- Part of [inkstone](https://github.com/coldsmirk/inkstone). Extracted from dragoman's SQL console; built for the [**polyglot**](https://github.com/coldsmirk/polyglot) unified-placeholder surface — the SQL its scanner rebinds (`?` positional / `:name` named, `??` and `::` escapes) across `postgres` / `mysql` / `oracle` / `sqlserver` / `dm` / `kingbase` (OceanBase's MySQL mode rides `mysql`).
5
+ Part of [inkstone](https://github.com/coldsmirk/inkstone). Extracted from dragoman's SQL console; built for the [**polyglot**](https://github.com/coldsmirk/polyglot) unified-placeholder surface — the SQL its scanner rebinds (`?` positional / `:name` named, `??` and `::` escapes) across `postgres` / `mysql` / `oracle` / `sqlserver` / `dm` / `kingbase` / `doris` (OceanBase's MySQL mode rides `mysql`; Doris reads as MySQL but backticks any name past ASCII).
6
6
 
7
7
  ## Entries
8
8
 
@@ -10,9 +10,12 @@
10
10
  * PostgreSQL-protocol database with no surface of its own as `postgres`, and 达梦 (`dm`) carries
11
11
  * Oracle's idiom wherever it documents Oracle compatibility. KingbaseES (`kingbase`) earned its
12
12
  * own kind when the engine grew one — the vendor's own driver behind a PostgreSQL surface — and
13
- * reads here as the Postgres idiom throughout, mirroring its engine profile flag for flag.
13
+ * reads here as the Postgres idiom throughout, mirroring its engine profile flag for flag. Apache
14
+ * Doris (`doris`, StarRocks and SelectDB with it) speaks MySQL's protocol and grammar and reads
15
+ * here as the MySQL idiom throughout, but its own parser admits no identifier past ASCII bare —
16
+ * `患者` must be backticked where MySQL takes it as written — so it earned a kind for its spelling.
14
17
  */
15
- type SqlKind = "postgres" | "mysql" | "oracle" | "sqlserver" | "dm" | "kingbase";
18
+ type SqlKind = "postgres" | "mysql" | "oracle" | "sqlserver" | "dm" | "kingbase" | "doris";
16
19
  /**
17
20
  * One table or view as the catalog reports it. Names carry the vendor's own casing — that casing
18
21
  * is information, and everything downstream preserves it.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CatalogTable, S as CatalogFunction, _ as readCall, a as createSqlAssist, b as runnableStatement, c as SqlSource, d as CallRead, f as IdentifierRead, g as TableRef, h as StatementRead, i as SqlSignatureHelp, l as createSqlSchema, m as StatementContext, n as SqlCompletionCandidate, o as SqlCatalog, p as Runnable, r as SqlHoverCard, s as SqlSchema, t as SqlAssist, u as qualifiedName, v as readIdentifier, w as SqlKind, x as CatalogColumn, y as readStatement } from "./assist-D3ScprYR.js";
1
+ import { C as CatalogTable, S as CatalogFunction, _ as readCall, a as createSqlAssist, b as runnableStatement, c as SqlSource, d as CallRead, f as IdentifierRead, g as TableRef, h as StatementRead, i as SqlSignatureHelp, l as createSqlSchema, m as StatementContext, n as SqlCompletionCandidate, o as SqlCatalog, p as Runnable, r as SqlHoverCard, s as SqlSchema, t as SqlAssist, u as qualifiedName, v as readIdentifier, w as SqlKind, x as CatalogColumn, y as readStatement } from "./assist-DTWNM9if.js";
2
2
  //#region src/functions.d.ts
3
3
  /**
4
4
  * The function vocabulary this bench speaks: the curated floor this project wrote
package/dist/index.js CHANGED
@@ -151,39 +151,41 @@ const POSTGRES$1 = dialect([
151
151
  fn("jsonb_agg", "jsonb_agg(expr)", "Aggregate: collects each row's value into a JSON array."),
152
152
  fn("jsonb_build_object", "jsonb_build_object(key, value, …)", "Builds a JSON object from alternating key and value arguments.")
153
153
  ]);
154
+ const MYSQL = dialect([
155
+ "limit",
156
+ "offset",
157
+ "ignore",
158
+ "replace",
159
+ "duplicate",
160
+ "key",
161
+ "interval",
162
+ "straight_join",
163
+ "true",
164
+ "false"
165
+ ], [
166
+ fn("now", "now()", "Current date and time."),
167
+ fn("curdate", "curdate()", "Current date."),
168
+ fn("curtime", "curtime()", "Current time."),
169
+ fn("ifnull", "ifnull(value, fallback)", "The second argument when the first is NULL."),
170
+ fn("if", "if(condition, then, else)", "Ternary choice."),
171
+ fn("date_format", "date_format(date, format)", "Formats a date through a format string."),
172
+ fn("str_to_date", "str_to_date(text, format)", "Parses text into a date through a format string."),
173
+ fn("date_add", "date_add(date, interval n unit)", "Adds an interval, as in `date_add(d, interval 7 day)`."),
174
+ fn("date_sub", "date_sub(date, interval n unit)", "Subtracts an interval."),
175
+ fn("concat", "concat(value, …)", "Joins the arguments as text; NULL in any of them makes the whole result NULL."),
176
+ fn("concat_ws", "concat_ws(separator, value, …)", "Joins with a separator, skipping NULLs."),
177
+ SUBSTRING,
178
+ fn("length", "length(text)", "Bytes in the string; `char_length` counts characters."),
179
+ GREATEST,
180
+ LEAST,
181
+ fn("group_concat", "group_concat(expr)", "Aggregate: joins each row's value into one string; takes `separator '…'`."),
182
+ fn("json_extract", "json_extract(json, path)", "Reads a JSON path, as in `'$.id'`.")
183
+ ]);
154
184
  const SQL_DIALECTS = {
155
185
  postgres: POSTGRES$1,
156
186
  kingbase: POSTGRES$1,
157
- mysql: dialect([
158
- "limit",
159
- "offset",
160
- "ignore",
161
- "replace",
162
- "duplicate",
163
- "key",
164
- "interval",
165
- "straight_join",
166
- "true",
167
- "false"
168
- ], [
169
- fn("now", "now()", "Current date and time."),
170
- fn("curdate", "curdate()", "Current date."),
171
- fn("curtime", "curtime()", "Current time."),
172
- fn("ifnull", "ifnull(value, fallback)", "The second argument when the first is NULL."),
173
- fn("if", "if(condition, then, else)", "Ternary choice."),
174
- fn("date_format", "date_format(date, format)", "Formats a date through a format string."),
175
- fn("str_to_date", "str_to_date(text, format)", "Parses text into a date through a format string."),
176
- fn("date_add", "date_add(date, interval n unit)", "Adds an interval, as in `date_add(d, interval 7 day)`."),
177
- fn("date_sub", "date_sub(date, interval n unit)", "Subtracts an interval."),
178
- fn("concat", "concat(value, …)", "Joins the arguments as text; NULL in any of them makes the whole result NULL."),
179
- fn("concat_ws", "concat_ws(separator, value, …)", "Joins with a separator, skipping NULLs."),
180
- SUBSTRING,
181
- fn("length", "length(text)", "Bytes in the string; `char_length` counts characters."),
182
- GREATEST,
183
- LEAST,
184
- fn("group_concat", "group_concat(expr)", "Aggregate: joins each row's value into one string; takes `separator '…'`."),
185
- fn("json_extract", "json_extract(json, path)", "Reads a JSON path, as in `'$.id'`.")
186
- ]),
187
+ mysql: MYSQL,
188
+ doris: MYSQL,
187
189
  oracle: ORACLE$1,
188
190
  sqlserver: dialect([
189
191
  "top",
@@ -342,6 +344,12 @@ const SPELLINGS = {
342
344
  regular: /^(?!\d+$)[\w$\u{0080}-\u{FFFF}]+$/u,
343
345
  reserved: MYSQL_RESERVED
344
346
  },
347
+ doris: {
348
+ open: "`",
349
+ close: "`",
350
+ regular: /^(?!\d+$)\w+$/u,
351
+ reserved: MYSQL_RESERVED
352
+ },
345
353
  oracle: ORACLE,
346
354
  sqlserver: {
347
355
  open: "[",
@@ -441,6 +449,14 @@ const NOISE_PROFILES = {
441
449
  lineCommentNeedsSpace: true,
442
450
  backtickIdentifiers: true
443
451
  },
452
+ doris: {
453
+ ...BASE,
454
+ backslashEscapes: true,
455
+ doubleQuotedStrings: true,
456
+ hashLineComments: true,
457
+ lineCommentNeedsSpace: true,
458
+ backtickIdentifiers: true
459
+ },
444
460
  oracle: {
445
461
  ...BASE,
446
462
  alternativeQuoting: true
@@ -1140,6 +1156,7 @@ function createSqlCompletion(kind, schema, functions) {
1140
1156
  const DIALECTS = {
1141
1157
  postgres: "postgresql",
1142
1158
  mysql: "mysql",
1159
+ doris: "mysql",
1143
1160
  oracle: "plsql",
1144
1161
  dm: "plsql",
1145
1162
  sqlserver: "transactsql",
@@ -1413,6 +1430,7 @@ const QUESTION_IS_NATIVE = /* @__PURE__ */ new Set(["mysql", "dm"]);
1413
1430
  const NATIVE_GROUP = {
1414
1431
  postgres: "dollarDigits",
1415
1432
  mysql: null,
1433
+ doris: null,
1416
1434
  oracle: "colonDigits",
1417
1435
  sqlserver: "atDigits",
1418
1436
  dm: null,
package/dist/monaco.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as SqlAssist } from "./assist-D3ScprYR.js";
1
+ import { t as SqlAssist } from "./assist-DTWNM9if.js";
2
2
  import * as monacoEditor from "monaco-editor";
3
3
  import { IDisposable } from "monaco-editor";
4
4
  //#region src/monaco.d.ts
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as SqlAssist } from "./assist-D3ScprYR.js";
1
+ import { t as SqlAssist } from "./assist-DTWNM9if.js";
2
2
  import { MonacoModule } from "./monaco.js";
3
3
  import { ReactNode } from "react";
4
4
  import { editor } from "monaco-editor";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-sql",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Schema-aware SQL editing intelligence for Monaco: lexical statement reading under per-dialect noise profiles, catalog-driven completion/hover/signature help, unified-placeholder awareness, formatting, and a drop-in React SQL editor.",
5
5
  "keywords": [
6
6
  "sql",
@@ -49,12 +49,12 @@
49
49
  "monaco-editor": "^0.56.0",
50
50
  "react": "^19.2.8",
51
51
  "react-dom": "^19.2.8",
52
- "@coldsmirk/inkstone-react": "^0.24.0"
52
+ "@coldsmirk/inkstone-react": "^0.25.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "monaco-editor": "^0.56.0",
56
56
  "react": ">=19",
57
- "@coldsmirk/inkstone-react": "^0.24.0"
57
+ "@coldsmirk/inkstone-react": "^0.25.0"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@coldsmirk/inkstone-react": {