From 6a8c5d98f17a993441d6ee4280e4ce3ba2e1d456 Mon Sep 17 00:00:00 2001 From: rahulmahadik Date: Fri, 14 Aug 2026 01:30:30 +0800 Subject: [PATCH 1/2] Version core 0.6.3 --- .changeset/identifier-and-semantic-floors.md | 39 ------------------- packages/core/CHANGELOG.md | 40 ++++++++++++++++++++ packages/core/package.json | 2 +- 3 files changed, 41 insertions(+), 40 deletions(-) delete mode 100644 .changeset/identifier-and-semantic-floors.md diff --git a/.changeset/identifier-and-semantic-floors.md b/.changeset/identifier-and-semantic-floors.md deleted file mode 100644 index 6758cbf..0000000 --- a/.changeset/identifier-and-semantic-floors.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -'@asksql/core': patch ---- - -Quote the identifiers a database would not read back as itself. A mixed-case Postgres schema failed -every query, because an unquoted name folds to lower case and resolves to nothing; Oracle folds the -other way, and MySQL on Linux compares table names case-sensitively. Table and column names are now -quoted from the catalog before the query is validated. A name that is already correct is left -untouched, so MySQL output is unchanged, and a name spelled two ways across the catalog is skipped -rather than guessed. A table named like a parser keyword, such as `order` or `Nulls`, also works now: -the bare form could not be parsed at all and the question failed after three attempts. - -Reserved words now come from each database itself, through `pg_get_keywords()`, -`information_schema.KEYWORDS`, `V$RESERVED_WORDS` and `duckdb_keywords()`, rather than one shared list -that applied MySQL's rules to Postgres and missed most of MySQL's own: MySQL reserves 262 words where -the shared list had about a hundred. Regenerate with `node tools/generate-sql-keywords.mjs`. - -Quoting knows where a word is syntax rather than a name, so `CAST(x AS DATE)` and -`EXTRACT(MONTH FROM d)` are left alone, and a CTE is still recognised once its name is quoted. - -When a database rejects a name, the corrected query is derived from the catalog rather than from a -second model call, and the table repair names the closest match it already knew. - -Tell the model which database and schema it is connected to. Without that it wrote -`table_schema = 'your_database_name'` against `information_schema` and returned nothing at all, which -reads as an empty database rather than an error. Structure questions also get a correct catalog query -for the engine to build on. - -Say what is actually wrong when a statement will not parse. An apostrophe inside a value, as in -`'O'Brien'`, only produced "could not parse", so the model returned the same statement until it ran -out of attempts; it is now told to double the quote. - -Reject `AVG(SUM(x))` before it reaches the database. Nested aggregates are invalid everywhere, so the -query is repaired rather than run and failed. - -Fix two false alarms. A `UNION ALL` of per-table counts was blocked as a hallucinated column, because -each branch's columns were judged against every branch's tables; per-table row counts now work. Index -columns arrived already quoted from introspection and were quoted a second time, so every prompt -carried `"""ColumnName"""`. diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index ea2dd18..e266fde 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,45 @@ # @asksql/core +## 0.6.3 + +### Patch Changes + +- 8582dc9: Quote the identifiers a database would not read back as itself. A mixed-case Postgres schema failed + every query, because an unquoted name folds to lower case and resolves to nothing; Oracle folds the + other way, and MySQL on Linux compares table names case-sensitively. Table and column names are now + quoted from the catalog before the query is validated. A name that is already correct is left + untouched, so MySQL output is unchanged, and a name spelled two ways across the catalog is skipped + rather than guessed. A table named like a parser keyword, such as `order` or `Nulls`, also works now: + the bare form could not be parsed at all and the question failed after three attempts. + + Reserved words now come from each database itself, through `pg_get_keywords()`, + `information_schema.KEYWORDS`, `V$RESERVED_WORDS` and `duckdb_keywords()`, rather than one shared list + that applied MySQL's rules to Postgres and missed most of MySQL's own: MySQL reserves 262 words where + the shared list had about a hundred. Regenerate with `node tools/generate-sql-keywords.mjs`. + + Quoting knows where a word is syntax rather than a name, so `CAST(x AS DATE)` and + `EXTRACT(MONTH FROM d)` are left alone, and a CTE is still recognised once its name is quoted. + + When a database rejects a name, the corrected query is derived from the catalog rather than from a + second model call, and the table repair names the closest match it already knew. + + Tell the model which database and schema it is connected to. Without that it wrote + `table_schema = 'your_database_name'` against `information_schema` and returned nothing at all, which + reads as an empty database rather than an error. Structure questions also get a correct catalog query + for the engine to build on. + + Say what is actually wrong when a statement will not parse. An apostrophe inside a value, as in + `'O'Brien'`, only produced "could not parse", so the model returned the same statement until it ran + out of attempts; it is now told to double the quote. + + Reject `AVG(SUM(x))` before it reaches the database. Nested aggregates are invalid everywhere, so the + query is repaired rather than run and failed. + + Fix two false alarms. A `UNION ALL` of per-table counts was blocked as a hallucinated column, because + each branch's columns were judged against every branch's tables; per-table row counts now work. Index + columns arrived already quoted from introspection and were quoted a second time, so every prompt + carried `"""ColumnName"""`. + ## 0.6.2 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 04e8a8d..2dcaf8f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@asksql/core", - "version": "0.6.2", + "version": "0.6.3", "description": "AskSQL engine: schema catalog, AST SQL guard, prompt pipeline, LLM orchestration. Zero database drivers.", "type": "module", "main": "./dist/index.js", From b427b999f6f43092e67c4fff013aca57c805e3df Mon Sep 17 00:00:00 2001 From: rahulmahadik Date: Fri, 14 Aug 2026 01:31:48 +0800 Subject: [PATCH 2/2] Version the browser extension 0.3.1 The store will not accept a resubmission of an unchanged package, so clearing the certification rejection needs a new version. It also carries this release's core fixes. --- packages/browser-extension/CHANGELOG.md | 12 ++++++++++++ packages/browser-extension/manifest.json | 2 +- packages/browser-extension/package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/browser-extension/CHANGELOG.md b/packages/browser-extension/CHANGELOG.md index 677ed87..81962e3 100644 --- a/packages/browser-extension/CHANGELOG.md +++ b/packages/browser-extension/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to the browser extension are documented here. Versions match `manifest.json`. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.1] - 2026-08-14 + +### Fixed +- Questions about structure no longer invent a database name. Without being told which database it + is connected to, the model wrote `table_schema = 'your_database_name'` and returned nothing, which + reads as an empty database rather than an error. +- `AVG(SUM(x))` is repaired instead of run. Nested aggregates are invalid in every engine. +- An apostrophe inside a value, as in `'O'Brien'`, produced only "could not parse", so the model + returned the same statement until it ran out of attempts. It is now told to double the quote. +- Per-table row counts work again. A `UNION ALL` across tables was blocked as a hallucinated column, + because each branch's columns were judged against every branch's tables. + ## [0.3.0] - 2026-08-09 ### Fixed diff --git a/packages/browser-extension/manifest.json b/packages/browser-extension/manifest.json index 8a2c481..a12b7d3 100644 --- a/packages/browser-extension/manifest.json +++ b/packages/browser-extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "AskSQL", "short_name": "AskSQL", - "version": "0.3.0", + "version": "0.3.1", "description": "Ask your database questions in plain language. Read-only by design, zero telemetry. Query files in-browser or your AskSQL server.", "minimum_chrome_version": "116", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk17oLrOl3oNPAgteUmUQDhUJJo+lxrQDt7baBBxmyQ3w3nE1g7IOZVGtq6q+gItzvs8aJAe+dHKanZynRWJfeK8zqCiBNDzyMqnRpAMOOtvKlJJOTqe9N9Lj/RJgxRgfylPnYJoPNXMAPd2y4ceeJX6yj0GpTPiS9AIfTO6p6WXB9YGWl5gdwjhGuYEAB+S7vD+M8yaCCn8C1b2+ne0yboTf/3nUyh6XysrAPafNCMlUbU1qBjAQGNJgXdsbRtWfaIbKorKhN4tWgsc3SsXZBdIxXsz/oL3EMzspjWjTEIrf/n5p1q3kNJ+SQ40SunWXdjDY4q/LnPnGmQFCUona7wIDAQAB", diff --git a/packages/browser-extension/package.json b/packages/browser-extension/package.json index e17361b..c8966d3 100644 --- a/packages/browser-extension/package.json +++ b/packages/browser-extension/package.json @@ -2,7 +2,7 @@ "name": "asksql-browser-extension", "private": true, "type": "module", - "version": "0.3.0", + "version": "0.3.1", "description": "AskSQL for Chromium browsers (Edge + Chrome): zero-backend DuckDB-WASM file chat and @asksql/server sidecar mode in a Manifest V3 side panel.", "scripts": { "fetch-duckdb-extensions": "node scripts/fetch-duckdb-extensions.mjs",