@wavehouse/chtypes 0.2.2 → 0.3.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/CHANGELOG.md +47 -0
- package/dist/discover.d.ts +12 -4
- package/dist/discover.d.ts.map +1 -1
- package/dist/discover.js +13 -16
- package/dist/discover.js.map +1 -1
- package/dist/errors.d.ts +10 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +10 -5
- package/dist/errors.js.map +1 -1
- package/dist/ffi.d.ts +39 -3
- package/dist/ffi.d.ts.map +1 -1
- package/dist/ffi.js +132 -7
- package/dist/ffi.js.map +1 -1
- package/dist/format.d.ts +27 -8
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +27 -8
- package/dist/format.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/library.d.ts +61 -0
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +74 -0
- package/dist/library.js.map +1 -1
- package/dist/registry.d.ts +109 -30
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +175 -67
- package/dist/registry.js.map +1 -1
- package/dist/results.d.ts +79 -1
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js +94 -18
- package/dist/results.js.map +1 -1
- package/dist/schema.d.ts +99 -12
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +45 -9
- package/dist/schema.js.map +1 -1
- package/dist/transform.d.ts.map +1 -1
- package/dist/transform.js +6 -0
- package/dist/transform.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,53 @@ All notable changes to the ts binding. The format is [Keep a Changelog](https://
|
|
|
4
4
|
|
|
5
5
|
The four bindings in this repository are released together and give one answer, so an entry here has a counterpart in the other three.
|
|
6
6
|
|
|
7
|
+
## [0.3.0] — 2026-09-22
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Identifier and literal quoting now come from ClickHouse itself: `QuoteIdentifier`, `QuoteIdentifierIfNeeded` and `QuoteLiteral` on a loaded library** (issue #52; each binding spells the three in its own idiom — the parity contract's `library.quote-*` rows carry the four spellings). Each is a passthrough over `chs_quote_identifier`, `chs_quote_identifier_if_needed` or `chs_quote_literal` — the vendored `backQuote`, `backQuoteIfNeed` and `quoteString` that the server's own formatter runs — and nothing else. **`QuoteLiteral` is new surface**: a string value as a ClickHouse string literal, quotes and escapes included, which is exactly what a caller splicing a value into DDL text needed (the value-injection recipe in `docs/guides/transformations.md` told the caller to do it themselves, because no binding exported it). Inputs are **counted**, not NUL-terminated, so a value carrying a NUL byte is quoted correctly; the answer is escaped and therefore NUL-free. They hang off a loaded library rather than off the package because the answers are the LOADED BUILD's own, and `QuoteIdentifierIfNeeded`'s differ between ClickHouse lines — `all`, `distinct`, `table` and `null` are back-quoted on every line this release was tested against, `select` from 26.3, `from` and `values` from 26.5, and `where` stays bare throughout. That is the server's own list of names it treats as problematic unquoted, not a keyword class: do not read it as one. The three symbols joined ABI revision 5 without a revision bump, so an artifact built from a revision-5 header that predates them still reports revision 5 and does not export them; all four bindings degrade to their own "this artifact predates the symbol" decline rather than failing to load. **The per-line answers are not pinned by any test in this repository yet** — they need a revision-5 artifact, none of which is fetchable, and are deferred (#119).
|
|
12
|
+
- **This binding now speaks ABI revision 5** — the explicit INSERT column list. `Schema#row`, `Schema#rows` (and its export channel) and `Schema#parseBlock` all gain the option: name the columns this data supplies, and the server computes the rest with them in scope for their DEFAULTs. `row()` and `parseBlock()` take the new `RowOptions` (just `columns` — the revision-3 export/doc-flag channels are meaningless on either, so that type does not offer them); `rows()` keeps `RowsOptions`, which now `extends RowOptions` to add `exportFormat` and `docFlags`. Absent or an empty array is the no-list behavior of every earlier revision; a listed `EPHEMERAL` column's value is read and is in scope for the DEFAULTs that reference it, and is still never stored and never exported. An unknown name, an `ALIAS` column or a repeated name is the server's own refusal (codes 16, 16 and 15), surfaced through the row/batch outcome exactly as it arrives — nothing is validated locally.
|
|
13
|
+
- **This release requires revision-5 artifacts.** A revision-4 artifact — everything published so far — is refused at load, naming both numbers (`chtypes: <path> reports ABI revision 4, this binding speaks 5; refusing to call through mismatched declarations`).
|
|
14
|
+
- **`Source.EphemeralInput` / `Source.MaterializedInput`** name `columns_json`'s two new `Value.source` provenances (revision 5, issue #53): a listed `EPHEMERAL` column's read value (`'ephemeral_input'`) and a listed `MATERIALIZED` column's supplied value under `insert_allow_materialized_columns=1` (`'materialized_input'` — stored, replacing the expression). `Source` is a plain const object plus a union type, the same shape as `Reason`, not a TypeScript `enum` — an unrecognized `source` from a newer artifact must pass through, not throw. **The two get opposite treatment in `RowResult.values`**: `'ephemeral_input'` is never stored, so it is excluded from `values` exactly as `'skipped'` already is — reported only through the per-column result document, never through `values`. `'materialized_input'` IS stored, so it stays IN `values`. The artifact-backed behavior tests (a listed EPHEMERAL/MATERIALIZED column actually producing these values end to end) need a revision-5 artifact, none of which is fetchable yet, and are deferred; the `values` membership rule itself was decidable without one, since "never stored" is definitional rather than something an artifact reveals.
|
|
15
|
+
- **`Source.Skipped`** names the `source` provenance the `'skipped'` string has always carried (`MATERIALIZED`/`ALIAS`/`EPHEMERAL`, never read from an input row). The exclusion it names from `RowResult.values` predates revision 5 and was already correct — `rowResultOf` has special-cased it from the start — it simply had no named constant, only the bare string literal `'skipped'` at the one call site that checks it. Added to the `Source` const object alongside `EphemeralInput` / `MaterializedInput`, in the same idiom, so the parity manifest's `results.skipped-excluded-from-values` rule can be keyed on a real symbol instead of four bindings agreeing on a bare literal by coincidence (issue #90). No behavior change: `rowResultOf` compares against the same string either way.
|
|
16
|
+
- **`Source.DefaultSubstituted`** names the `source` provenance the `'default_substituted'` string has always carried: a VOLATILE DEFAULT this library resolved locally, which the caller MUST echo as an explicit column on any later INSERT. `rowResultOf` has populated `substituted` for exactly this src value from the start; like `Source.Skipped` before it, it simply had no named constant, only the bare string literal `'default_substituted'` at the one call site that checks it. Added to the `Source` const object in the same idiom, so the parity manifest's `results.default-substituted-populates-substituted` rule can be keyed on a real symbol instead of four bindings agreeing on a bare literal by coincidence (issue #122). No behavior change: `rowResultOf` compares against the same string either way.
|
|
17
|
+
- **`Schema#rows` gains `RowsOptions#rowFilter`** (revision 5, second half — issue #54, `docs/guides/filters.md` §Exporting only the rows a filter admits): attach a compiled `Filter` to the export channel and get ONE `chs_rows` parse that answers both a per-row filter verdict (`RowResult#verdict`, the same `Verdict` `Filter#rows` already answers) and, for verdict `'t'` rows, the export bytes. `'e'` (the predicate threw) and `'d'` (declined — including a row whose own `outcome` was not `'accepted'`) are NEVER exported and NEVER collapsed into `'f'`: collapsing either inverts fail-closed into fail-open, the leak class this vocabulary exists to prevent. `BatchResult#rowsPassed`/`#rowsCut` join the result. A filter compiled over a different `Schema` of the same loaded library rejects the whole call, loudly (code 1002); one from a different loaded library throws `ChtypesError` before any C call. The lifetime mechanism is the one `compileFilter` already established — reused, not duplicated. The artifact-backed behavior tests need a revision-5 artifact, none of which is fetchable yet, and are deferred; the decode rule and the cross-library refusal were both decidable without one, and are unit-tested against a hand-built document and fake handles.
|
|
18
|
+
- **`CSVWithNames` = 10 and `TSVWithNames` = 11 join the `chs_format` set** (issue #55; ClickHouse's own format names, which each binding spells in its own idiom). **Both numbers are frozen from the day they ship**, like every other `chs_format` value: they are what crosses the C boundary, and they are never renumbered. Each is CSV / TSV whose first row is a header naming the columns, so the data is addressed by name rather than by position. With an INSERT column list as well, the list decides the block and the header decides the layout: a listed column the header omits takes its `DEFAULT` under `input_format_defaults_for_omitted_fields=1` and the reader's zero under `0`, an unlisted column the header names is an unknown field, and an unlisted column takes its `DEFAULT` whatever that setting says. **Header-name matching differs by ClickHouse line: exact through 26.4, case-insensitive from 26.5**, exactly as those servers do, so the same header can bind differently on either side of that boundary. As an export format both are the existing loud decline. They joined the set inside ABI revision 5 without a revision bump, so an artifact built from a revision-5 header that predates them still reports revision 5 and does not know them: **probe the artifact before declaring either format** (`docs/reference/bindings.md` §Values a binding must accept and reject). The round trip through a real artifact needs a revision-5 artifact that supports them, none of which is fetchable yet, and is deferred (#119).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- **BREAKING: `QuoteIdentifier` ALWAYS quotes**, and it is a call into the loaded library rather than a function of this binding (issue #52). It used to quote only where it decided quoting was needed, from a hand-written copy of ClickHouse's rule living in the binding; that copy is deleted, not kept as a fallback, because two implementations of one rule is how it came to disagree with the server in the first place. **This changes the bytes a caller gets back** — a name that used to come back bare now comes back quoted — so it can move a cached key, a golden file or a stored test expectation even where the SQL means the same thing. **The one-line migration for a caller who genuinely wanted the old shape is `QuoteIdentifierIfNeeded`**, which is that behavior under a name that says so; read the next two entries before assuming it is byte-for-byte what you had.
|
|
23
|
+
|
|
24
|
+
- **`QuoteIdentifierIfNeeded` returns `` `all` ``, `` `distinct` ``, `` `table` `` and `` `null` `` back-quoted**, where the hand-written copy returned all four bare. The server back-quotes them on every ClickHouse line this release was tested against, so the copy was simply wrong, and a bare `null` is exactly the shape that parses as something else. This is a behavior change **on top of** the breaking one above: a caller who migrates from `QuoteIdentifier` to `QuoteIdentifierIfNeeded` to keep the old shape still gets different bytes for these four names. Which further names it quotes is the loaded build's own rule and moves between lines (`select` from 26.3, `from` and `values` from 26.5, while `where` stays bare), so an answer cached across versions was never safe and is now visibly so.
|
|
25
|
+
|
|
26
|
+
- **`QuoteIdentifier` emits the BACKSLASH spelling for an embedded back-quote** — `` `a\`b` `` — where the deleted copy doubled it (``` `a``b` ```). Both spellings parse, on every line, and both round-trip to the same column name; only one is what the server itself prints. That is how two hand-written quoters can each look correct and still disagree, and it is the same failure that produced the `null` divergence above. A caller comparing quoted text against a stored string, rather than passing it straight into DDL, must expect the new spelling.
|
|
27
|
+
|
|
28
|
+
- **BREAKING: reconstructing DDL from discovered columns is a method on a loaded library.** It was a free function; it is not one any more, because the single thing it spells — the column NAME — is now spelled by the library's own `QuoteIdentifier` instead of by a rule in the binding. Resolve the artifact first (the server's own version string already decides which one) and call reconstruction on it; the arguments, the return and every refusal are unchanged, and the declaration list it produces differs only in how the names are spelled. This was not in the issue's own scope — it is the unavoidable consequence of deleting the hand-written rule, since nothing else in the binding could spell a name afterwards.
|
|
29
|
+
|
|
30
|
+
- **BREAKING: loading is lazy by default, and `preload` is the one eager path.** `new Registry()` picked the first search-path directory holding artifacts and `dlopen`ed **every** artifact under it — whether or not `dir` was passed, so the search-path constructor the guides called safe was eager here too. It now reads the `manifest.json` files on the whole search path and opens nothing. Nothing in this package opens an artifact except a request for a specific version (`for()` / `open()`) or an explicit `preload`. Measured on seven artifacts in one directory: **1.096 s and 351 MB resident** to open them all at construction against **1 ms and 66.8 MB** to open none (#50).
|
|
31
|
+
|
|
32
|
+
**What a caller who relied on eager opening must do:** name the lines. `new Registry(dir, { preload: ['25.8', '26.7'] })` opens exactly those, in order, before the constructor returns — deliberately a list rather than "everything in the directory", because a registry directory is whatever a fetch left behind and each line costs about 120 MB resident. An entry no directory on the search path holds is `ArtifactMissingError` at construction: the same §7 error the first `for()` would have thrown, thrown earlier. `preload` never fetches, even with `autofetch` on — this constructor is synchronous and `ensure()` is not, and autofetch stays a first-use behavior.
|
|
33
|
+
|
|
34
|
+
**What moved, and where it moved to.** Construction still throws for a directory named explicitly (the argument or `CHTYPES_REGISTRY`) that does not exist, and for a search path on which no directory holds an artifact — both suppressed by `autofetch`, as before. A failed checksum, a load failure, a refused ABI revision and a library whose ClickHouse version disagrees with its manifest are now reported by the call that opens the line. A registry over a directory holding a corrupt 25.8 and a good 26.7 used to fail at construction and serve neither; it now constructs, serves 26.7, and throws on the call that asks for 25.8.
|
|
35
|
+
|
|
36
|
+
- **BREAKING: `versions()` means "every line this registry can answer for", loaded OR discovered.** It listed what was LOADED, where Go, Python and Rust list both. That was invisible only because construction had loaded everything — and it would have been `[]` for a full directory the moment it did not. It is now answered from the construction-time manifest scan, in the same numeric release order, and it opens nothing. `libraries()` is unchanged: what is open right now (#50).
|
|
37
|
+
|
|
38
|
+
- **`verifyChecksums` is unchanged, and the timing is now stated: a library's checksum is computed immediately before that library is `dlopen`ed, and at no other time** — at construction for the `preload`ed lines, at first use for the rest, never for a line nobody asks for. It is a policy on the registry, not a property of the preload list: a lazily-opened line is hashed too (#50).
|
|
39
|
+
|
|
40
|
+
- **BREAKING: `library_bytes` is now checked on EVERY load, not only under `verifyChecksums`** (issue #82, split out of #50 so the behavior change was not hidden inside a larger one). The size check — the file's actual length against the manifest's `library_bytes` — used to run only when verification was on, bundled inside the sha256 comparison; Go and Python agreed with TypeScript on that, and Rust did not, checking bytes unconditionally on every load. It is nearly free (one `stat`, never a re-hash of the library's contents) and it catches the commonest shape of a broken artifact directory — a truncated or partially-written library file — so all four bindings now check it unconditionally, and TypeScript stops being three of the four that didn't.
|
|
41
|
+
|
|
42
|
+
**What changes for a caller who never asked for verification:** an artifact directory whose manifest carries a `library_bytes` that does not match the file on disk now fails the load (`for()`, `open()`, and `preload`, which all route through the same internal loader) with `chtypes: <path> is <n> bytes, manifest says <m>`, refused before `dlopen` is ever attempted. Before this change the same directory reached `dlopen` regardless — usually failing there too, with a less specific error, though a stale-rather-than-corrupt manifest could pass through unnoticed. A manifest with no `library_bytes` at all (`undefined`, its shape for one that predates the field) is unaffected either way: this was never, and is still not, a reason a load fails for a directory with no size to check against.
|
|
43
|
+
|
|
44
|
+
**Timing, read together with `verifyChecksums`'s rule above:** the size check runs at the exact same point the hash check does — immediately before `dlopen`, at construction for `preload`ed lines and at first use for the rest — because the internal loader is the one place both checks live, whether or not verification is on.
|
|
45
|
+
|
|
46
|
+
- **CSV and TSV rejection messages are now ClickHouse's own text** (with revision-5 artifacts). The error **codes are unchanged**, and so is every verdict and every stored value; only the human-readable message moved, because CSV and TSV rows are now read by ClickHouse's own readers rather than hand-written splitters. A CSV row the reader rejects now carries an **empty `cols` list**, where the previous path could report a partial one. **Match on the error code, never on the message text** — the message is ClickHouse's to change between releases.
|
|
47
|
+
|
|
48
|
+
- **An empty CSV field under `input_format_defaults_for_omitted_fields=0` is now reported as an input, and its coercion as a transform** (with revision-5 artifacts). Where the previous reader reported no transform, the detector now reports one, because the field's reference value is the empty string rather than absent. The reason follows the column's type — measured as `enum_coerce` for an `Enum`, `fixedstring_pad` for a `FixedString`, and `uuid_mangle` for a `UUID` (the zero UUID). **Stored values are unchanged** — this changes what is reported, not what is stored. A caller that reads "no transform" as "the value was not changed" should expect these rows to report one. Under the default setting (`1`) an empty field still takes the column's `DEFAULT`, as before. **TSV is not affected:** its reader takes an empty field through the typed parse whether the setting is on or off, exactly as the previous splitter did.
|
|
49
|
+
|
|
50
|
+
- **An unlisted column now takes its `DEFAULT` regardless of `input_format_defaults_for_omitted_fields` when a column list is present** (with revision-5 artifacts). With an INSERT column list, a column the list does not name is computed from its `DEFAULT` expression under `input_format_defaults_for_omitted_fields=0` as well as under the default `1`. This is a fix in the artifact that rides revision 5, and it applies to **every format**, not only `CSVWithNames` and `TSVWithNames`.
|
|
51
|
+
|
|
52
|
+
- **The rolling artifacts channel now serves ABI revision 5.** A 0.2.x consumer that fetches from the default channel will download an artifact its bindings **refuse at load** — correct behavior that looks exactly like a broken install. ⚠️ **Pinning an exact ClickHouse version does not avoid this**: a relink republishes the same `clickhouse_version`, and an exact request resolves to the highest-ranked matching row, which is the revision-5 one. The only way to stay on revision 4 is `--url` / `--tag` pointed at a source that still serves revision-4 artifacts, if one is retained. **Upgrading to 0.3.0 is the supported path.**
|
|
53
|
+
|
|
7
54
|
## [0.2.2] — 2026-09-17
|
|
8
55
|
|
|
9
56
|
No functional change in this binding. This release ships together with the other three because the four give one answer, not because anything here moved.
|
package/dist/discover.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* profile.version -> Registry#for / the artifact to load
|
|
10
10
|
* profile.settings -> compileDdl({ settings }) (compile-time) and per-call settings
|
|
11
|
-
* columns -> reconstructDdl -> compileDdl
|
|
11
|
+
* columns -> Library#reconstructDdl -> compileDdl
|
|
12
12
|
*
|
|
13
13
|
* The pattern, in full (docs/reference/bindings.md §Discovery):
|
|
14
14
|
*
|
|
@@ -98,13 +98,20 @@ export declare function parseChangedSettingsResult(body: Uint8Array | string): R
|
|
|
98
98
|
*
|
|
99
99
|
* @param body - the query result bytes (or text) as the server sent them.
|
|
100
100
|
* @returns one `DiscoveredColumn` per row, in the query's position order —
|
|
101
|
-
* feed `reconstructDdl`.
|
|
101
|
+
* feed `Library#reconstructDdl`.
|
|
102
102
|
* @throws {ChtypesError} when a row is malformed, lacks `name`/`type`, or the
|
|
103
103
|
* body holds no rows at all (wrong database/table, or no access).
|
|
104
104
|
*/
|
|
105
105
|
export declare function parseColumnsResult(body: Uint8Array | string): DiscoveredColumn[];
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* The body of `Library#reconstructDdl`, with the identifier quoting HANDED IN
|
|
108
|
+
* rather than computed here.
|
|
109
|
+
*
|
|
110
|
+
* `quote` is the loaded library's own `quoteIdentifier`. This module used to
|
|
111
|
+
* spell the rule itself and the copy disagreed with the server (issue #52);
|
|
112
|
+
* nothing in this file decides how a name is spelled.
|
|
113
|
+
*
|
|
114
|
+
* Turns `QUERY_TABLE_COLUMNS`' rows back into the column-declaration list
|
|
108
115
|
* `compileDdl` takes. It is a spelling exercise, not a semantic one: types
|
|
109
116
|
* and expressions are the server's own text, passed through verbatim, and the
|
|
110
117
|
* library's own compile is the judge of the result.
|
|
@@ -125,10 +132,11 @@ export declare function parseColumnsResult(body: Uint8Array | string): Discovere
|
|
|
125
132
|
* EPHEMERAL column may legitimately have an empty `default_expression`.
|
|
126
133
|
*
|
|
127
134
|
* @param cols - the discovered columns, e.g. from `parseColumnsResult`.
|
|
135
|
+
* @param quote - the library's own `quoteIdentifier`.
|
|
128
136
|
* @returns the column-declaration list for `Library#compileDdl`.
|
|
129
137
|
* @throws {ChtypesError} when a column is inconsistent: no name/type, a
|
|
130
138
|
* `default_expression` with no kind, a DEFAULT/MATERIALIZED/ALIAS kind with
|
|
131
139
|
* no expression, an unknown kind, or no columns at all.
|
|
132
140
|
*/
|
|
133
|
-
export declare function
|
|
141
|
+
export declare function reconstructDdlWith(cols: readonly DiscoveredColumn[], quote: (name: string) => string): string;
|
|
134
142
|
//# sourceMappingURL=discover.d.ts.map
|
package/dist/discover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAUH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,6EAA6E,CAAC;AAEjH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAGQ,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAsED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAcpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc5F;AAED;;;;;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;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAC9B,MAAM,CAmCR"}
|
package/dist/discover.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* profile.version -> Registry#for / the artifact to load
|
|
10
10
|
* profile.settings -> compileDdl({ settings }) (compile-time) and per-call settings
|
|
11
|
-
* columns -> reconstructDdl -> compileDdl
|
|
11
|
+
* columns -> Library#reconstructDdl -> compileDdl
|
|
12
12
|
*
|
|
13
13
|
* The pattern, in full (docs/reference/bindings.md §Discovery):
|
|
14
14
|
*
|
|
@@ -180,7 +180,7 @@ export function parseChangedSettingsResult(body) {
|
|
|
180
180
|
*
|
|
181
181
|
* @param body - the query result bytes (or text) as the server sent them.
|
|
182
182
|
* @returns one `DiscoveredColumn` per row, in the query's position order —
|
|
183
|
-
* feed `reconstructDdl`.
|
|
183
|
+
* feed `Library#reconstructDdl`.
|
|
184
184
|
* @throws {ChtypesError} when a row is malformed, lacks `name`/`type`, or the
|
|
185
185
|
* body holds no rows at all (wrong database/table, or no access).
|
|
186
186
|
*/
|
|
@@ -214,18 +214,14 @@ export function parseColumnsResult(body) {
|
|
|
214
214
|
return out;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return '`' + name.replaceAll('`', '``') + '`';
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Turn `QUERY_TABLE_COLUMNS`' rows back into the column-declaration list
|
|
217
|
+
* The body of `Library#reconstructDdl`, with the identifier quoting HANDED IN
|
|
218
|
+
* rather than computed here.
|
|
219
|
+
*
|
|
220
|
+
* `quote` is the loaded library's own `quoteIdentifier`. This module used to
|
|
221
|
+
* spell the rule itself and the copy disagreed with the server (issue #52);
|
|
222
|
+
* nothing in this file decides how a name is spelled.
|
|
223
|
+
*
|
|
224
|
+
* Turns `QUERY_TABLE_COLUMNS`' rows back into the column-declaration list
|
|
229
225
|
* `compileDdl` takes. It is a spelling exercise, not a semantic one: types
|
|
230
226
|
* and expressions are the server's own text, passed through verbatim, and the
|
|
231
227
|
* library's own compile is the judge of the result.
|
|
@@ -246,12 +242,13 @@ function backquoteIfNeeded(name) {
|
|
|
246
242
|
* EPHEMERAL column may legitimately have an empty `default_expression`.
|
|
247
243
|
*
|
|
248
244
|
* @param cols - the discovered columns, e.g. from `parseColumnsResult`.
|
|
245
|
+
* @param quote - the library's own `quoteIdentifier`.
|
|
249
246
|
* @returns the column-declaration list for `Library#compileDdl`.
|
|
250
247
|
* @throws {ChtypesError} when a column is inconsistent: no name/type, a
|
|
251
248
|
* `default_expression` with no kind, a DEFAULT/MATERIALIZED/ALIAS kind with
|
|
252
249
|
* no expression, an unknown kind, or no columns at all.
|
|
253
250
|
*/
|
|
254
|
-
export function
|
|
251
|
+
export function reconstructDdlWith(cols, quote) {
|
|
255
252
|
if (cols.length === 0) {
|
|
256
253
|
throw new ChtypesError('chtypes: no columns to reconstruct');
|
|
257
254
|
}
|
|
@@ -261,7 +258,7 @@ export function reconstructDdl(cols) {
|
|
|
261
258
|
if (c.name === '' || c.type === '') {
|
|
262
259
|
throw new ChtypesError(`chtypes: column ${i} has no name/type`);
|
|
263
260
|
}
|
|
264
|
-
let decl = `${
|
|
261
|
+
let decl = `${quote(c.name)} ${c.type}`;
|
|
265
262
|
switch (c.defaultKind) {
|
|
266
263
|
case '':
|
|
267
264
|
if (c.defaultExpression !== '') {
|
package/dist/discover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../src/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,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AC,iBAAiB,EAAE,CAAC;gBACnD,MAAM;YACR,KAAK,WAAW;gBACd,IAAI,IAAI,YAAY,CAAC;gBACrB,IAAI,CAAC,CAAC,iBAAiB,KAAK,EAAE;oBAAE,IAAI,IAAI,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC;gBAClE,MAAM;YACR;gBACE,MAAM,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAAC,IAAI,6BAA6B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAClH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -32,12 +32,17 @@ export declare const CODE_UNSUPPORTED = -2;
|
|
|
32
32
|
*
|
|
33
33
|
* Revision 4 (2026-08-31, the filter phase-2 cycle): `chs_filter_compile`
|
|
34
34
|
* gained `params_json` (`{name:Type}` query parameters), and the block twin
|
|
35
|
-
* joined — `chs_block_parse` / `chs_block_free` / `chs_filter_eval`.
|
|
36
|
-
*
|
|
37
|
-
* 5-
|
|
38
|
-
*
|
|
35
|
+
* joined — `chs_block_parse` / `chs_block_free` / `chs_filter_eval`.
|
|
36
|
+
*
|
|
37
|
+
* Revision 5 (2026-09-15, the explicit INSERT column list): `chs_row`,
|
|
38
|
+
* `chs_rows` and `chs_block_parse` each gained a trailing `columns_json` —
|
|
39
|
+
* `RowsOptions#columns`. This binding therefore speaks 5 and refuses
|
|
40
|
+
* revision-4 artifacts — calling the 6-argument `chs_row` (or the
|
|
41
|
+
* 9-argument `chs_rows`, or the 8-argument `chs_block_parse`) through a
|
|
42
|
+
* revision-4 artifact's shorter declaration is undefined behavior, which is
|
|
43
|
+
* exactly what the gate exists to prevent.
|
|
39
44
|
*/
|
|
40
|
-
export declare const ABI_REVISION =
|
|
45
|
+
export declare const ABI_REVISION = 5;
|
|
41
46
|
/** Base class for everything this package throws. */
|
|
42
47
|
export declare class ChtypesError extends Error {
|
|
43
48
|
constructor(message: string, options?: {
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,qDAAqD;AACrD,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAGzD;CACF;AAED,0EAA0E;AAC1E,qBAAa,aAAc,SAAQ,YAAY;CAAG;AAElD;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EASxD;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;I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AM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAEzD;CACF"}
|
package/dist/errors.js
CHANGED
|
@@ -32,12 +32,17 @@ export const CODE_UNSUPPORTED = -2;
|
|
|
32
32
|
*
|
|
33
33
|
* Revision 4 (2026-08-31, the filter phase-2 cycle): `chs_filter_compile`
|
|
34
34
|
* gained `params_json` (`{name:Type}` query parameters), and the block twin
|
|
35
|
-
* joined — `chs_block_parse` / `chs_block_free` / `chs_filter_eval`.
|
|
36
|
-
*
|
|
37
|
-
* 5-
|
|
38
|
-
*
|
|
35
|
+
* joined — `chs_block_parse` / `chs_block_free` / `chs_filter_eval`.
|
|
36
|
+
*
|
|
37
|
+
* Revision 5 (2026-09-15, the explicit INSERT column list): `chs_row`,
|
|
38
|
+
* `chs_rows` and `chs_block_parse` each gained a trailing `columns_json` —
|
|
39
|
+
* `RowsOptions#columns`. This binding therefore speaks 5 and refuses
|
|
40
|
+
* revision-4 artifacts — calling the 6-argument `chs_row` (or the
|
|
41
|
+
* 9-argument `chs_rows`, or the 8-argument `chs_block_parse`) through a
|
|
42
|
+
* revision-4 artifact's shorter declaration is undefined behavior, which is
|
|
43
|
+
* exactly what the gate exists to prevent.
|
|
39
44
|
*/
|
|
40
|
-
export const ABI_REVISION =
|
|
45
|
+
export const ABI_REVISION = 5;
|
|
41
46
|
/** Base class for everything this package throws. */
|
|
42
47
|
export class ChtypesError extends Error {
|
|
43
48
|
constructor(message, options) {
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC;AAEnC
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;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O,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAED,sGAAsG;AACtG,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IACtD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IACpD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,4BAA4B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF"}
|
package/dist/ffi.d.ts
CHANGED
|
@@ -177,6 +177,22 @@ export declare class NativeLibrary {
|
|
|
177
177
|
ok: boolean;
|
|
178
178
|
};
|
|
179
179
|
referenceType(expr: string): string;
|
|
180
|
+
/**
|
|
181
|
+
* One of the three `chs_quote_*` symbols. The input is COUNTED — a string
|
|
182
|
+
* literal may legally carry a NUL byte — so it travels as bytes with an
|
|
183
|
+
* explicit length, never as a `Str`. The answer is always NUL-free, since
|
|
184
|
+
* every byte the server escapes comes back escaped.
|
|
185
|
+
*
|
|
186
|
+
* Both out-param slots are read and released on EVERY path, success or
|
|
187
|
+
* failure: the library owns whatever it wrote, and an answer left behind on
|
|
188
|
+
* an error return is a leak nothing else can reach.
|
|
189
|
+
*/
|
|
190
|
+
quote(symbol: 'chs_quote_identifier' | 'chs_quote_identifier_if_needed' | 'chs_quote_literal', text: string): {
|
|
191
|
+
quoted: string;
|
|
192
|
+
code: number;
|
|
193
|
+
message: string;
|
|
194
|
+
ok: boolean;
|
|
195
|
+
};
|
|
180
196
|
registeredFamilies(): string[];
|
|
181
197
|
/** The function-volatility TSV audit, verbatim. Requires `chs_init`. */
|
|
182
198
|
functionFlags(): string;
|
|
@@ -248,8 +264,12 @@ export declare class NativeLibrary {
|
|
|
248
264
|
/**
|
|
249
265
|
* `chs_row`: one row body. Returns the raw result document **as bytes** — a
|
|
250
266
|
* stored value can be any byte sequence, so the document can be too.
|
|
267
|
+
*
|
|
268
|
+
* `columns` (revision 5) is the INSERT column list — `RowsOptions#columns`,
|
|
269
|
+
* read exactly as `chs_row` documents it. Absent or empty means no list,
|
|
270
|
+
* encoded per `encodeColumns`.
|
|
251
271
|
*/
|
|
252
|
-
row(handle: SchemaHandle, format: number, raw: Uint8Array, settingsJson: string): Buffer;
|
|
272
|
+
row(handle: SchemaHandle, format: number, raw: Uint8Array, settingsJson: string, columns?: readonly string[]): Buffer;
|
|
253
273
|
/**
|
|
254
274
|
* `chs_rows`: a whole request body — ONE call, whatever the caller asked
|
|
255
275
|
* for (the C ABI contract §Rows; revision 3). `exportFormat` is `EXPORT_NONE`
|
|
@@ -291,8 +311,18 @@ export declare class NativeLibrary {
|
|
|
291
311
|
* handle as the decline it is. `chs_rows` is one of the mandatory four, so
|
|
292
312
|
* with repo-built artifacts the branch is unreachable — the type still has
|
|
293
313
|
* to be the honest one.
|
|
314
|
+
*
|
|
315
|
+
* `columns` (revision 5) is the INSERT column list — `RowsOptions#columns`,
|
|
316
|
+
* read exactly as `chs_row` documents it; the export channel is unchanged
|
|
317
|
+
* by it (an exported row still carries the stored columns in declared
|
|
318
|
+
* order). Absent or empty means no list, encoded per `encodeColumns`.
|
|
319
|
+
*
|
|
320
|
+
* `filterHandle` (revision 5, second half) is the attached row filter —
|
|
321
|
+
* `undefined`/`null` (the default) sends `NULL_PTR`, "no filter" and
|
|
322
|
+
* today's behavior byte for byte. `Schema#rows`'s `options.rowFilter` is
|
|
323
|
+
* the only caller that ever supplies one.
|
|
294
324
|
*/
|
|
295
|
-
rows(handle: SchemaHandle, format: number, body: Uint8Array, settingsJson: string, exportFormat?: number, docFlags?: number): {
|
|
325
|
+
rows(handle: SchemaHandle, format: number, body: Uint8Array, settingsJson: string, exportFormat?: number, docFlags?: number, columns?: readonly string[], filterHandle?: FilterHandle | null): {
|
|
296
326
|
doc: Buffer;
|
|
297
327
|
payload: Buffer | null;
|
|
298
328
|
};
|
|
@@ -330,8 +360,14 @@ export declare class NativeLibrary {
|
|
|
330
360
|
* ClickHouse's own code/message — a malformed body yields no block and no
|
|
331
361
|
* partial answers; the sign of the code picks the error class, exactly as
|
|
332
362
|
* `filterCompile`. A missing symbol degrades to the decline type.
|
|
363
|
+
*
|
|
364
|
+
* `columns` (revision 5) is the INSERT column list, read exactly as
|
|
365
|
+
* `chs_row` documents it — filters still compile over the schema's
|
|
366
|
+
* physical columns and evaluate the stored tuple, so a listed EPHEMERAL
|
|
367
|
+
* column stays unreferenceable in a filter. Absent or empty means no
|
|
368
|
+
* list, encoded per `encodeColumns`.
|
|
333
369
|
*/
|
|
334
|
-
blockParse(schema: SchemaHandle, format: number, body: Uint8Array, settingsJson: string): BlockHandle;
|
|
370
|
+
blockParse(schema: SchemaHandle, format: number, body: Uint8Array, settingsJson: string, columns?: readonly string[]): BlockHandle;
|
|
335
371
|
/** `chs_block_free`. Never throws: nothing sane to do while releasing. */
|
|
336
372
|
blockFree(handle: BlockHandle): void;
|
|
337
373
|
/**
|
package/dist/ffi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffi.d.ts","sourceRoot":"","sources":["../src/ffi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAYL,KAAK,UAAU,EAChB,MAAM,QAAQ,CAAC;AAOhB,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAEtC,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC;AAEtC,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC;AAKrC;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAE5E;
|
|
1
|
+
{"version":3,"file":"ffi.d.ts","sourceRoot":"","sources":["../src/ffi.ts"],"names":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