@wavehouse/chtypes 0.5.2 → 1.0.2

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.
Files changed (195) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +34 -38
  3. package/dist/abi1/buildinfo.d.ts +40 -0
  4. package/dist/abi1/buildinfo.d.ts.map +1 -0
  5. package/dist/abi1/buildinfo.js +83 -0
  6. package/dist/abi1/buildinfo.js.map +1 -0
  7. package/dist/abi1/calls.gen.d.ts +55 -0
  8. package/dist/abi1/calls.gen.d.ts.map +1 -0
  9. package/dist/abi1/calls.gen.js +110 -0
  10. package/dist/abi1/calls.gen.js.map +1 -0
  11. package/dist/abi1/decls.gen.d.ts +115 -0
  12. package/dist/abi1/decls.gen.d.ts.map +1 -0
  13. package/dist/abi1/decls.gen.js +1613 -0
  14. package/dist/abi1/decls.gen.js.map +1 -0
  15. package/dist/abi1/errmap.gen.d.ts +18 -0
  16. package/dist/abi1/errmap.gen.d.ts.map +1 -0
  17. package/dist/abi1/errmap.gen.js +66 -0
  18. package/dist/abi1/errmap.gen.js.map +1 -0
  19. package/dist/abi1/errors.d.ts +107 -0
  20. package/dist/abi1/errors.d.ts.map +1 -0
  21. package/dist/abi1/errors.js +134 -0
  22. package/dist/abi1/errors.js.map +1 -0
  23. package/dist/abi1/handles.d.ts +31 -0
  24. package/dist/abi1/handles.d.ts.map +1 -0
  25. package/dist/abi1/handles.js +76 -0
  26. package/dist/abi1/handles.js.map +1 -0
  27. package/dist/abi1/index.d.ts +17 -0
  28. package/dist/abi1/index.d.ts.map +1 -0
  29. package/dist/abi1/index.js +17 -0
  30. package/dist/abi1/index.js.map +1 -0
  31. package/dist/abi1/libc.d.ts +54 -0
  32. package/dist/abi1/libc.d.ts.map +1 -0
  33. package/dist/abi1/libc.gen.d.ts +12 -0
  34. package/dist/abi1/libc.gen.d.ts.map +1 -0
  35. package/dist/abi1/libc.gen.js +75 -0
  36. package/dist/abi1/libc.gen.js.map +1 -0
  37. package/dist/abi1/libc.js +109 -0
  38. package/dist/abi1/libc.js.map +1 -0
  39. package/dist/abi1/loader.d.ts +101 -0
  40. package/dist/abi1/loader.d.ts.map +1 -0
  41. package/dist/abi1/loader.js +274 -0
  42. package/dist/abi1/loader.js.map +1 -0
  43. package/dist/abi1/raw.d.ts +104 -0
  44. package/dist/abi1/raw.d.ts.map +1 -0
  45. package/dist/abi1/raw.js +296 -0
  46. package/dist/abi1/raw.js.map +1 -0
  47. package/dist/abi1/strictjson.d.ts +19 -0
  48. package/dist/abi1/strictjson.d.ts.map +1 -0
  49. package/dist/abi1/strictjson.js +78 -0
  50. package/dist/abi1/strictjson.js.map +1 -0
  51. package/dist/abi1/vocab.gen.d.ts +169 -0
  52. package/dist/abi1/vocab.gen.d.ts.map +1 -0
  53. package/dist/abi1/vocab.gen.js +306 -0
  54. package/dist/abi1/vocab.gen.js.map +1 -0
  55. package/dist/cli.d.ts +25 -26
  56. package/dist/cli.d.ts.map +1 -1
  57. package/dist/cli.js +206 -218
  58. package/dist/cli.js.map +1 -1
  59. package/dist/documents.d.ts +195 -0
  60. package/dist/documents.d.ts.map +1 -0
  61. package/dist/documents.js +389 -0
  62. package/dist/documents.js.map +1 -0
  63. package/dist/env.d.ts +16 -0
  64. package/dist/env.d.ts.map +1 -0
  65. package/dist/env.js +57 -0
  66. package/dist/env.js.map +1 -0
  67. package/dist/index.d.ts +19 -24
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +17 -23
  70. package/dist/index.js.map +1 -1
  71. package/dist/json.d.ts +11 -89
  72. package/dist/json.d.ts.map +1 -1
  73. package/dist/json.js +16 -180
  74. package/dist/json.js.map +1 -1
  75. package/dist/library.d.ts +53 -309
  76. package/dist/library.d.ts.map +1 -1
  77. package/dist/library.js +77 -315
  78. package/dist/library.js.map +1 -1
  79. package/dist/ocifetch/constants.gen.d.ts +84 -0
  80. package/dist/ocifetch/constants.gen.d.ts.map +1 -0
  81. package/dist/ocifetch/constants.gen.js +92 -0
  82. package/dist/ocifetch/constants.gen.js.map +1 -0
  83. package/dist/ocifetch/dsse.d.ts +114 -0
  84. package/dist/ocifetch/dsse.d.ts.map +1 -0
  85. package/dist/ocifetch/dsse.js +331 -0
  86. package/dist/ocifetch/dsse.js.map +1 -0
  87. package/dist/ocifetch/ensure.d.ts +65 -0
  88. package/dist/ocifetch/ensure.d.ts.map +1 -0
  89. package/dist/ocifetch/ensure.js +775 -0
  90. package/dist/ocifetch/ensure.js.map +1 -0
  91. package/dist/ocifetch/errors.d.ts +92 -0
  92. package/dist/ocifetch/errors.d.ts.map +1 -0
  93. package/dist/ocifetch/errors.js +101 -0
  94. package/dist/ocifetch/errors.js.map +1 -0
  95. package/dist/ocifetch/goldens.d.ts +44 -0
  96. package/dist/ocifetch/goldens.d.ts.map +1 -0
  97. package/dist/ocifetch/goldens.js +62 -0
  98. package/dist/ocifetch/goldens.js.map +1 -0
  99. package/dist/ocifetch/http.d.ts +124 -0
  100. package/dist/ocifetch/http.d.ts.map +1 -0
  101. package/dist/ocifetch/http.js +549 -0
  102. package/dist/ocifetch/http.js.map +1 -0
  103. package/dist/ocifetch/index.d.ts +17 -0
  104. package/dist/ocifetch/index.d.ts.map +1 -0
  105. package/dist/ocifetch/index.js +14 -0
  106. package/dist/ocifetch/index.js.map +1 -0
  107. package/dist/ocifetch/layout.d.ts +126 -0
  108. package/dist/ocifetch/layout.d.ts.map +1 -0
  109. package/dist/ocifetch/layout.js +375 -0
  110. package/dist/ocifetch/layout.js.map +1 -0
  111. package/dist/ocifetch/localverify.d.ts +43 -0
  112. package/dist/ocifetch/localverify.d.ts.map +1 -0
  113. package/dist/ocifetch/localverify.js +164 -0
  114. package/dist/ocifetch/localverify.js.map +1 -0
  115. package/dist/ocifetch/lock.d.ts +39 -0
  116. package/dist/ocifetch/lock.d.ts.map +1 -0
  117. package/dist/ocifetch/lock.js +140 -0
  118. package/dist/ocifetch/lock.js.map +1 -0
  119. package/dist/ocifetch/oci.d.ts +100 -0
  120. package/dist/ocifetch/oci.d.ts.map +1 -0
  121. package/dist/ocifetch/oci.js +323 -0
  122. package/dist/ocifetch/oci.js.map +1 -0
  123. package/dist/ocifetch/referrers.d.ts +55 -0
  124. package/dist/ocifetch/referrers.d.ts.map +1 -0
  125. package/dist/ocifetch/referrers.js +132 -0
  126. package/dist/ocifetch/referrers.js.map +1 -0
  127. package/dist/ocifetch/types.d.ts +167 -0
  128. package/dist/ocifetch/types.d.ts.map +1 -0
  129. package/dist/ocifetch/types.js +88 -0
  130. package/dist/ocifetch/types.js.map +1 -0
  131. package/dist/ocifetch/unpack.d.ts +55 -0
  132. package/dist/ocifetch/unpack.d.ts.map +1 -0
  133. package/dist/ocifetch/unpack.js +205 -0
  134. package/dist/ocifetch/unpack.js.map +1 -0
  135. package/dist/registry.d.ts +38 -387
  136. package/dist/registry.d.ts.map +1 -1
  137. package/dist/registry.js +95 -819
  138. package/dist/registry.js.map +1 -1
  139. package/dist/schema.d.ts +77 -588
  140. package/dist/schema.d.ts.map +1 -1
  141. package/dist/schema.js +87 -549
  142. package/dist/schema.js.map +1 -1
  143. package/dist/settings.d.ts +27 -36
  144. package/dist/settings.d.ts.map +1 -1
  145. package/dist/settings.js +75 -25
  146. package/dist/settings.js.map +1 -1
  147. package/dist/setup.d.ts +46 -0
  148. package/dist/setup.d.ts.map +1 -0
  149. package/dist/setup.js +79 -0
  150. package/dist/setup.js.map +1 -0
  151. package/dist/tar.d.ts +27 -11
  152. package/dist/tar.d.ts.map +1 -1
  153. package/dist/tar.js +54 -32
  154. package/dist/tar.js.map +1 -1
  155. package/package.json +2 -2
  156. package/dist/discover.d.ts +0 -142
  157. package/dist/discover.d.ts.map +0 -1
  158. package/dist/discover.js +0 -288
  159. package/dist/discover.js.map +0 -1
  160. package/dist/error-codes.d.ts +0 -80
  161. package/dist/error-codes.d.ts.map +0 -1
  162. package/dist/error-codes.js +0 -139
  163. package/dist/error-codes.js.map +0 -1
  164. package/dist/errors.d.ts +0 -284
  165. package/dist/errors.d.ts.map +0 -1
  166. package/dist/errors.js +0 -321
  167. package/dist/errors.js.map +0 -1
  168. package/dist/fetch.d.ts +0 -382
  169. package/dist/fetch.d.ts.map +0 -1
  170. package/dist/fetch.js +0 -1498
  171. package/dist/fetch.js.map +0 -1
  172. package/dist/ffi.d.ts +0 -410
  173. package/dist/ffi.d.ts.map +0 -1
  174. package/dist/ffi.js +0 -1154
  175. package/dist/ffi.js.map +0 -1
  176. package/dist/format.d.ts +0 -128
  177. package/dist/format.d.ts.map +0 -1
  178. package/dist/format.js +0 -132
  179. package/dist/format.js.map +0 -1
  180. package/dist/numeric.d.ts +0 -20
  181. package/dist/numeric.d.ts.map +0 -1
  182. package/dist/numeric.js +0 -107
  183. package/dist/numeric.js.map +0 -1
  184. package/dist/paths.d.ts +0 -55
  185. package/dist/paths.d.ts.map +0 -1
  186. package/dist/paths.js +0 -87
  187. package/dist/paths.js.map +0 -1
  188. package/dist/results.d.ts +0 -495
  189. package/dist/results.d.ts.map +0 -1
  190. package/dist/results.js +0 -406
  191. package/dist/results.js.map +0 -1
  192. package/dist/transform.d.ts +0 -73
  193. package/dist/transform.d.ts.map +0 -1
  194. package/dist/transform.js +0 -533
  195. package/dist/transform.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,40 @@ The four bindings in this repository are released together and give one answer,
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.2] — 2026-10-06
10
+
11
+ There is no 1.0.1 of this binding: 1.0.1 was a Go-only fix to that module's metadata. From 1.0.2 the four bindings release together again.
12
+
13
+ ### Fixed
14
+
15
+ - `setup` now latches only once an image completes load step 7 (#458). A zone the library refuses, such as `setup({ timezone: 'Not/AZone' })`, used to fix the process setup at the first open: every later open failed with ClickHouse's code 36, and a corrected `setup` was a `UsageError` until the process restarted. Now, if step 7 (`chs_initialize`, then `chs_set_defaults` when there are defaults) fails before any image has completed it, the setup record is cleared. That open still raises the library's own error, a corrected `setup` is accepted, and the next open runs step 7 again with it, on the same image too: a failed step 7 is never remembered (`openUnverified` and `registry.for` alike). Once an image has completed step 7, a different setup is still a `UsageError`. No name or signature changes. All four bindings run the same case, `tests/fixtures/abi-v1/setup-cases.json`, and the rule is `docs/reference/bindings-v1.md` section 6.
16
+
17
+ ## [1.0.0] — 2026-10-04
18
+
19
+ The TypeScript binding's first v1 release, and a deliberate break from 0.x. The default branch switches to v1 shortly after release. The sections below are the entries written as each part landed; this is what they add up to.
20
+
21
+ - **A new ABI.** The binding speaks the generated ABI v1 layer, identified by an ABI fingerprint in `include/chtypes.h` rather than a revision number, so every FFI declaration is generated from `spec/abi-v1/abi.json`, not written by hand. The ABI stays provisional until the maintainer confirms it.
22
+ - **Fetch over OCI, with signed statements.** Libraries are fetched from an OCI registry and verified against a signed statement before they are loaded; the default trust is the release key only (`docs/guides/fetch-v1.md`).
23
+ - **The public API is `docs/reference/bindings-v1.md`**, the same four-binding contract with each language's own spelling.
24
+ - **The CLI** is the `chtypes` bin (`dist/cli.js`): `fetch`, `verify`, `list` and `where`.
25
+ - **The v0 surface is removed**; the list, and the reason for each removal, is `docs/reference/bindings-v1.md` section 7.
26
+ - **Known gaps** are listed in [`docs/limitations.md`](../docs/limitations.md#known-gaps-in-10), and support for a line this release does not mention is "support unknown", never "unsupported".
27
+
28
+ ### Changed (v1: breaking)
29
+
30
+ - **The public API is rebuilt over the ABI v1 generated layer** (`docs/reference/bindings-v1.md`). `setup()` replaces the registry timezone option; `Registry.open()`, `for()` and `installed()` are async and resolve through the fetch layer; `compileTable` takes exactly one `CREATE TABLE` statement; every name, SQL text, message and rendered value is a `Buffer`; the four call errors (`SchemaError`, `UnsupportedError`, `UsageError`, `InternalError`) carry the library's five error fields, under the abstract `CallError`; the loader's refusals are `ArtifactIncompatibleError` and `ArtifactCorruptError`, one family with the fetch layer's errors.
31
+ - **The vocabularies are generated from the description** (`Format`, `Status`, `Outcome`, `FilterOutcome`, `Verdict`, `Reason`, `Source`, `DefaultKind`, `DocFlags`), each fact (`Transform.lossy`, `Value.isStored`, `verdictAnswered`) read from it.
32
+
33
+ ### Removed
34
+
35
+ - The hand FFI table and the presence and per-format probes, the transform classifier and its numeric helpers, the hand JSON reader's denormal repair, discovery reconstruction (`discoverQuery` and `discoverColumns` replace it), the error-code table parsers, the v0 loader halves (search path, manifests, revision gate, checksum re-hash, `Resolve`), `Registry#close`, `Library#shutdown`, `setDefaultSettings`, `InitConflictError`, `ABI_REVISION` and `CODE_UNSUPPORTED` from the public API, and numeric settings values.
36
+
37
+ ### Fixed
38
+
39
+ - **The tar reader now refuses a symlink, hardlink, device or FIFO entry instead of silently skipping it.** `extractTarGz` treated anything that was not a regular file or directory as "skip, never follow", so an artifact tarball carrying one of those installed everything else around it with no error. It now throws `ArtifactCorruptError`, naming the entry and its type, matching the other three bindings' install refusal for the same shapes.
40
+ - **The crash-guard refuse-list is now sourced identically to the other three bindings, and an artifact with neither source refuses rather than loading unguarded.** This binding already fell back to the manifest's `unsafe_families` field when `unsafe_families.txt` was absent, but a manifest predating the field (or one that simply omitted it) parsed to the same `undefined` as one carrying it empty, so `chs_init` silently ran with no refuse-list either way. A directory with neither the file nor the field is now refused, naming both, instead of loading unguarded (`docs/reference/artifact.md` step 9).
41
+ - **`ensure`/`fetch` now retry a transient HTTP 5xx, 408 or 429 from the artifacts host, and a connection-level failure (refused, reset, timed out, DNS), within the existing retry budget and schedule** (`docs/guides/fetch.md` §3a: 5 attempts, delays doubling from 4s) — previously `HttpSource`'s `request` ran its own separate, shorter retry (3 attempts, 500ms steps) before giving up, independent of the publish-window budget, and a tarball download had no outer retry at all. A `Retry-After` on a 503 or 429 is honored, in both the delta-seconds and HTTP-date forms, capped so it never makes the total wait exceed the existing budget — one that does not fit fails at once, naming the requested delay. A 404 or 410, and a tarball hash or size mismatch, are still decided on the first attempt, never retried; a 410 is now also recognized as "not found" (it used to fall through as an ungrouped refusal, never retried either way, but misclassified). `SourceUnreachableError` gains `.retryable`/`.retryAfterMs` properties (closes #365).
42
+
9
43
  ## [0.5.2] — 2026-10-01
10
44
 
11
45
  ### Added
package/README.md CHANGED
@@ -6,75 +6,71 @@ Node ≥ 22, ESM only. `ffi-rs` ships prebuilt for darwin arm64/x64 and linux ar
6
6
 
7
7
  ## Install
8
8
 
9
- Two things: this package, and at least one **artifact** — the per-version native library it `dlopen`s at runtime.
9
+ Two things: this package, and at least one **artifact**, the per-version native library it `dlopen`s at runtime. The fetch layer (`src/ocifetch`) resolves a version request to a signed artifact in its cache, verifies the signature and the library's digest, and hands the result to the loader; a `Registry` turns on fetching with `autofetch` (or `CHTYPES_AUTOFETCH=1`).
10
10
 
11
11
  ```sh
12
12
  pnpm add @wavehouse/chtypes
13
- npx @wavehouse/chtypes fetch 26.8
14
13
  ```
15
14
 
16
- The fetch lands in `~/.cache/chtypes/artifacts/abi<R>/<os>-<arch>/26.8/` — the per-user cache every chtypes binding reads by default, `<R>` the ABI revision this SDK speaks (fetch installs only artifacts built at it) — after checking an ed25519 signature over the release and the sha256 of every byte. `$CHTYPES_REGISTRY` overrides it.
17
-
18
15
  ## Quickstart
19
16
 
20
17
  ```ts
21
- import { Format, Registry } from '@wavehouse/chtypes';
18
+ import { Format, Registry, setup } from '@wavehouse/chtypes';
22
19
 
23
- const registry = new Registry(); // walks the search path
24
- const lib = registry.for('26.8'); // a line or an exact patch; never a nearest match
25
- const schema = lib.compileDdl('x UInt8, ts DateTime DEFAULT now()');
20
+ setup({ timezone: 'UTC' }); // optional; once, before the first open
21
+ const registry = await Registry.open({ autofetch: true });
22
+ const lib = await registry.for('26.8'); // two, three or four parts; never a nearest match
23
+ const schema = lib.compileTable('CREATE TABLE t (x UInt8, ts DateTime DEFAULT now()) ENGINE = Memory');
26
24
 
27
- const batch = schema.rows(Format.JSONEachRow, Buffer.from('{"x":256}'));
25
+ const batch = schema.rows(Format.JSONEachRow, Buffer.from('{"x":256}\n'));
28
26
  const row = batch.rows[0];
29
- console.log(batch.outcome); // accepted
30
- console.log(row.values[0].text); // 0 — what would actually be stored
31
- console.log(row.transformed[0]?.reason); // overflow_wrap — which is the product
32
- console.log(row.substituted[0]?.column); // ts — send it explicitly in the real INSERT
27
+ console.log(batch.outcome); // accepted
28
+ console.log(row?.values[0]?.text.toString()); // 0 what would actually be stored
29
+ console.log(row?.transformed[0]?.reason); // overflow_wrap which is the product
33
30
 
34
31
  schema.close();
35
32
  ```
36
33
 
37
- The row is **accepted** and `256` is silently stored as `0`. That report — `transformed` — is the one derived answer in the system and the reason it exists.
34
+ The row is **accepted** and `256` is silently stored as `0`. That report, `transformed`, comes from the library, which is the only place a ClickHouse rule lives.
35
+
36
+ ## What a result is
37
+
38
+ Every field of a result is a field of the document the library returned, decoded one to one with the stock `JSON.parse`; nothing is computed in this package. Every name, SQL text, message and rendered value is **bytes** (`Buffer`), never assumed to be UTF-8: ClickHouse round-trips column names containing NUL and invalid UTF-8. `Value.isStored`, `Transform.lossy` and `verdictAnswered` are the description's own facts for the value a document carries.
38
39
 
39
- `ts` was substituted rather than stored: send every substituted column as an explicit value in the real INSERT, or the server re-evaluates `now()` at its own instant and your preview is not what landed.
40
+ ## Errors
40
41
 
41
- ## Three outcomes, and conflating any two is a bug
42
+ A bad **row** is a verdict, not an exception: `outcome` becomes `'rejected'` with ClickHouse's own code and message. The calls that can fail throw one of four peers, under the abstract `CallError`:
42
43
 
43
- A bad **row** is a verdict, not an exception: `outcome` becomes `'rejected'` with ClickHouse's own code and message. Exceptions are for schema-level answers — `compileDdl`, `setEngine`, `setTtl`, `validateType` — and there the class _is_ the verdict.
44
+ - `SchemaError`: the server would refuse; `chCode` and `chName` are ClickHouse's own.
45
+ - `UnsupportedError`: this build declines to answer, and a real server might well have accepted. **Fall back to the server.**
46
+ - `UsageError`: caller misuse, whichever side caught it (a closed object, a zone given twice, a refused version spelling).
47
+ - `InternalError`: a library bug, or a document that does not decode.
44
48
 
45
- - `SchemaError` — the server refused, and `code` is a real ClickHouse code.
46
- - `UnsupportedError` — chtypes declines to guess, and a real server might well have accepted. **Fall back to the server.**
47
- - The two are **peers**: a decline never satisfies `instanceof SchemaError`.
49
+ The four are **peers**: a decline never satisfies `instanceof SchemaError`. Loader and fetch errors are `ArtifactError`s: `ArtifactIncompatibleError`, `ArtifactCorruptError` (the fetch layer's and the loader's step 5 are one class), `ArtifactMissingError` and the rest of the fetch family.
48
50
 
49
51
  ## Documentation
50
52
 
51
- | | |
52
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
53
- | [Quickstart](https://github.com/wave-rf/chtypes/blob/main/docs/quickstart.md) | the same program in all four languages |
54
- | [TypeScript API reference](https://github.com/wave-rf/chtypes/blob/main/docs/reference/ts.md) | every symbol, the C entry point under it, what it returns and what it throws |
55
- | [Artifacts](https://github.com/wave-rf/chtypes/blob/main/docs/guides/artifacts.md) | getting one, where it lands, verifying and pinning it |
56
- | [Batches](https://github.com/wave-rf/chtypes/blob/main/docs/guides/batches.md) | always `rows`, and the two bad-row policies |
57
- | [Transformations](https://github.com/wave-rf/chtypes/blob/main/docs/guides/transformations.md) | the silent-change report, and the DEFAULTs you must echo back |
58
- | [Settings](https://github.com/wave-rf/chtypes/blob/main/docs/guides/settings.md) · [Discovery](https://github.com/wave-rf/chtypes/blob/main/docs/guides/discovery.md) | the four channels; asking a real server what profile to validate under |
59
- | [Filters](https://github.com/wave-rf/chtypes/blob/main/docs/guides/filters.md) · [Multi-version](https://github.com/wave-rf/chtypes/blob/main/docs/guides/multi-version.md) | boolean expressions over rows; several ClickHouse versions in one process |
60
- | [Support matrix](https://github.com/wave-rf/chtypes/blob/main/docs/support.md) · [Limitations](https://github.com/wave-rf/chtypes/blob/main/docs/limitations.md) | what works where; what chtypes declines to answer |
53
+ | | |
54
+ | ------------------------------------------------------ | ------------------------------------------------------------------------------ |
55
+ | [The v1 binding API](../docs/reference/bindings-v1.md) | every operation, type, error class and document decoder, in all four languages |
56
+ | [Fetching artifacts](../docs/guides/fetch-v1.md) | resolving, verifying and caching an artifact |
61
57
 
62
- ## Four things specific to this binding
58
+ ## Things specific to this binding
63
59
 
64
- **`using` is a syntax error on Node 22**, this package's own floor. Explicit resource management needs TypeScript to downlevel it for you, or plain JavaScript on Node ≥ 24. `close()` works everywhere and every disposable here has both, so portable examples use `close()`.
60
+ **`using` is a syntax error on Node 22**, this package's own floor. Explicit resource management needs TypeScript to downlevel it for you, or plain JavaScript on Node >= 24. `close()` works everywhere and every disposable here has both, so portable examples use `close()`.
65
61
 
66
- **A settings value may be a `string` or a `bigint`, never a `number`.** The runtime rejects a `number`, because TypeScript is not present at a JS consumer's call site and a 19-digit `chtypes_now_epoch_nanos` does not survive an IEEE double — sent as a JSON number the setting would be silently ignored.
62
+ **Settings values are strings, and only strings.** The map becomes a JSON object of string values and is passed verbatim; a `number` or a `boolean` is a `TypeError`. The per-call zone is the `session_timezone` key of the call's settings: pass `sessionTimezone`, or the key, never both.
67
63
 
68
- **`for()` never fetches; `open()` can.** `Registry#for(v)` is synchronous and resolves from the search path alone. `await registry.open(v)` is its async twin, and with `{ autofetch: true }` (or `CHTYPES_AUTOFETCH=1`) it fetches a missing line first. Off by default: a production process must not begin a 250 MB download inside a request.
64
+ **`Registry.open`, `for` and `installed` are async**, because the fetch layer is. Construction opens nothing; `for` resolves from the cache first and fetches only when `autofetch` is on.
69
65
 
70
- **`worker_threads` is the boundary.** Two JS threads share one dlopen'd image and one set of C globals, which no per-isolate counter can see. Seed default settings before starting workers, and do not share a `Schema` across them.
66
+ **`worker_threads` is the boundary.** Every call runs synchronously on one thread, so there is nothing to share inside an isolate. A handle cannot cross to another worker: each worker opens its own objects over the shared image, and every worker must call `setup` identically.
71
67
 
72
68
  ## Tests
73
69
 
74
- `pnpm test`. Tests that need an artifact **skip loudly by name** without a registry on the search path, and a suite that ran nothing fails. The fetch suite runs offline against the miniature releases in `tests/fixtures/fetch/`.
70
+ `pnpm test`. The stub-backed suites under `test/abi1` need `$CHTYPES_ABI1_STUBS` and skip loudly by name without it; the decoder, settings and setup suites need nothing.
75
71
 
76
- Working against a checkout: build `dist/` first (`pnpm install && pnpm build`) — that is what `package.json#exports` serves. If a linked copy goes stale, note that `pnpm install --force` does **not** relink; remove `node_modules` and reinstall.
72
+ Working against a checkout: build `dist/` first (`pnpm install && pnpm build`), which is what `package.json#exports` serves.
77
73
 
78
74
  ## License
79
75
 
80
- Apache 2.0. The artifacts this package loads are **Elastic License 2.0** — a separate license, shipped inside each artifact release, and `fetch` says so once.
76
+ Apache 2.0. The artifacts this package loads are **Elastic License 2.0**, a separate license shipped inside each artifact release.
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `BuildInfo`: the decoded form of the library's static build-info JSON
3
+ * (`docs/reference/bindings-v1.md` §5, `BuildInfo`). Decoded once, at loader
4
+ * step 4, where a malformed document is a `LoaderCorruptError`
5
+ * (`build_info_malformed`): ASCII only, no duplicate key at any depth,
6
+ * `schema` equal to 1, every required field of its type.
7
+ */
8
+ /** What the build itself says it supports, from its own format factory and document groups. */
9
+ export interface Capabilities {
10
+ /** ClickHouse's own format names the build can read. */
11
+ readonly inputFormats: readonly string[];
12
+ /** ClickHouse's own format names the build can write. */
13
+ readonly exportFormats: readonly string[];
14
+ readonly docFlags: readonly string[];
15
+ /** Open: an entry is a build-level feature, the first being `default_generators`. */
16
+ readonly features: readonly string[];
17
+ }
18
+ export interface BuildInfo {
19
+ readonly schema: number;
20
+ readonly abi: number;
21
+ readonly abiFingerprint: string;
22
+ /** Four parts, no channel. */
23
+ readonly clickhouseVersion: string;
24
+ readonly channel: string;
25
+ readonly clickhouseMinor: string;
26
+ readonly clickhouseCommit: string;
27
+ readonly coreCommit: string;
28
+ readonly build: string;
29
+ readonly inputsSha256: string;
30
+ readonly os: string;
31
+ readonly arch: string;
32
+ /** The parsed object, uninterpreted. */
33
+ readonly toolchain: Readonly<Record<string, unknown>>;
34
+ readonly capabilities: Capabilities;
35
+ /** The exact bytes the library returned. */
36
+ readonly raw: Buffer;
37
+ }
38
+ /** Decode the build-info text the library returned; every failure is `build_info_malformed`. */
39
+ export declare function decodeBuildInfo(path: string, text: string): BuildInfo;
40
+ //# sourceMappingURL=buildinfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildinfo.d.ts","sourceRoot":"","sources":["../../src/abi1/buildinfo.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,+FAA+F;AAC/F,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,8BAA8B;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,4CAA4C;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AA4BD,gGAAgG;AAChG,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAyCrE"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * `BuildInfo`: the decoded form of the library's static build-info JSON
3
+ * (`docs/reference/bindings-v1.md` §5, `BuildInfo`). Decoded once, at loader
4
+ * step 4, where a malformed document is a `LoaderCorruptError`
5
+ * (`build_info_malformed`): ASCII only, no duplicate key at any depth,
6
+ * `schema` equal to 1, every required field of its type.
7
+ */
8
+ import { LoaderCorruptError } from './errors.js';
9
+ import { DuplicateKeyError, isAsciiOnly, parseStrictJson } from './strictjson.js';
10
+ function malformed(path, want, got) {
11
+ throw new LoaderCorruptError({ reason: 'build_info_malformed', path, want, got });
12
+ }
13
+ function kindOf(v) {
14
+ return v === null ? 'null' : Array.isArray(v) ? 'array' : typeof v;
15
+ }
16
+ function str(path, obj, key) {
17
+ const v = obj[key];
18
+ if (typeof v !== 'string')
19
+ malformed(path, `${key} as a string`, kindOf(v));
20
+ return v;
21
+ }
22
+ function int(path, obj, key) {
23
+ const v = obj[key];
24
+ if (typeof v !== 'number' || !Number.isInteger(v))
25
+ malformed(path, `${key} as an integer`, kindOf(v));
26
+ return v;
27
+ }
28
+ function strList(path, obj, key) {
29
+ const v = obj[key];
30
+ if (!Array.isArray(v) || !v.every((e) => typeof e === 'string'))
31
+ malformed(path, `${key} as a list of strings`, kindOf(v));
32
+ return v;
33
+ }
34
+ /** Decode the build-info text the library returned; every failure is `build_info_malformed`. */
35
+ export function decodeBuildInfo(path, text) {
36
+ if (!isAsciiOnly(text))
37
+ malformed(path, 'ASCII only', 'a non-ASCII byte');
38
+ let parsed;
39
+ try {
40
+ parsed = parseStrictJson(text);
41
+ }
42
+ catch (err) {
43
+ if (err instanceof DuplicateKeyError)
44
+ malformed(path, 'no duplicate keys', err.message);
45
+ malformed(path, 'valid JSON', 'a parse error');
46
+ }
47
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed))
48
+ malformed(path, 'a JSON object', kindOf(parsed));
49
+ const obj = parsed;
50
+ if (obj.schema !== 1)
51
+ malformed(path, 'schema === 1', JSON.stringify(obj.schema));
52
+ const toolchain = obj.toolchain;
53
+ if (typeof toolchain !== 'object' || toolchain === null || Array.isArray(toolchain)) {
54
+ malformed(path, 'toolchain as an object', kindOf(toolchain));
55
+ }
56
+ const caps = obj.capabilities;
57
+ if (typeof caps !== 'object' || caps === null || Array.isArray(caps))
58
+ malformed(path, 'capabilities as an object', kindOf(caps));
59
+ const capsObj = caps;
60
+ return {
61
+ schema: 1,
62
+ abi: int(path, obj, 'abi'),
63
+ abiFingerprint: str(path, obj, 'abi_fingerprint'),
64
+ clickhouseVersion: str(path, obj, 'clickhouse_version'),
65
+ channel: str(path, obj, 'channel'),
66
+ clickhouseMinor: str(path, obj, 'clickhouse_minor'),
67
+ clickhouseCommit: str(path, obj, 'clickhouse_commit'),
68
+ coreCommit: str(path, obj, 'core_commit'),
69
+ build: str(path, obj, 'build'),
70
+ inputsSha256: str(path, obj, 'inputs_sha256'),
71
+ os: str(path, obj, 'os'),
72
+ arch: str(path, obj, 'arch'),
73
+ toolchain: toolchain,
74
+ capabilities: {
75
+ inputFormats: strList(path, capsObj, 'input_formats'),
76
+ exportFormats: strList(path, capsObj, 'export_formats'),
77
+ docFlags: strList(path, capsObj, 'doc_flags'),
78
+ features: strList(path, capsObj, 'features'),
79
+ },
80
+ raw: Buffer.from(text, 'latin1'),
81
+ };
82
+ }
83
+ //# sourceMappingURL=buildinfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildinfo.js","sourceRoot":"","sources":["../../src/abi1/buildinfo.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EA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C,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC;YACvD,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC;YAC7C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;SAC7C;QACD,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { type Abi1Handle } from './handles.js';
2
+ import { type RawApi } from './raw.js';
3
+ export type SchemaHandle = Abi1Handle & {
4
+ readonly kind: "chs_schema";
5
+ };
6
+ export type FilterHandle = Abi1Handle & {
7
+ readonly kind: "chs_filter";
8
+ };
9
+ export type BlockHandle = Abi1Handle & {
10
+ readonly kind: "chs_block";
11
+ };
12
+ export declare class Calls {
13
+ readonly raw: RawApi;
14
+ constructor(raw: RawApi);
15
+ /** The generated call wrapper for chs_live_handles. */
16
+ liveHandles(): Buffer;
17
+ /** The generated call wrapper for chs_error_codes. */
18
+ errorCodes(): Buffer;
19
+ /** The generated call wrapper for chs_initialize. */
20
+ initialize(timezone: Uint8Array): void;
21
+ /** The generated call wrapper for chs_set_defaults. */
22
+ setDefaults(settings: Uint8Array): void;
23
+ /** The generated call wrapper for chs_type_validate. */
24
+ typeValidate(typeExpr: Uint8Array): Buffer;
25
+ /** The generated call wrapper for chs_back_quote. */
26
+ backQuote(name: Uint8Array): Buffer;
27
+ /** The generated call wrapper for chs_back_quote_if_needed. */
28
+ backQuoteIfNeeded(name: Uint8Array): Buffer;
29
+ /** The generated call wrapper for chs_quote_string. */
30
+ quoteString(text: Uint8Array): Buffer;
31
+ /** The generated call wrapper for chs_schema_create. */
32
+ schemaCreate(createTable: Uint8Array, settings: Uint8Array): SchemaHandle;
33
+ /** The generated call wrapper for chs_schema_describe. */
34
+ schemaDescribe(schema: SchemaHandle): Buffer;
35
+ /** The generated call wrapper for chs_preview_row. */
36
+ previewRow(schema: SchemaHandle, format: number, body: Uint8Array, settings: Uint8Array, columns: Uint8Array): Buffer;
37
+ /** The generated call wrapper for chs_preview_batch. */
38
+ previewBatch(schema: SchemaHandle, format: number, body: Uint8Array, settings: Uint8Array, columns: Uint8Array, filter: FilterHandle | null, exportFormat: number, docFlags: number): {
39
+ readonly out: Buffer;
40
+ readonly outExport: Buffer;
41
+ };
42
+ /** The generated call wrapper for chs_filter_create. */
43
+ filterCreate(schema: SchemaHandle, expr: Uint8Array, queryParams: Uint8Array, settings: Uint8Array): FilterHandle;
44
+ /** The generated call wrapper for chs_filter_eval_body. */
45
+ filterEvalBody(filter: FilterHandle, format: number, body: Uint8Array, settings: Uint8Array): Buffer;
46
+ /** The generated call wrapper for chs_block_create. */
47
+ blockCreate(schema: SchemaHandle, format: number, body: Uint8Array, settings: Uint8Array, columns: Uint8Array): BlockHandle;
48
+ /** The generated call wrapper for chs_filter_eval_block. */
49
+ filterEvalBlock(filter: FilterHandle, block: BlockHandle): Buffer;
50
+ /** The generated call wrapper for chs_discover_query. */
51
+ discoverQuery(): Buffer;
52
+ /** The generated call wrapper for chs_discover_columns. */
53
+ discoverColumns(rows: Uint8Array): Buffer;
54
+ }
55
+ //# sourceMappingURL=calls.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calls.gen.d.ts","sourceRoot":"","sources":["../../src/abi1/calls.gen.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAwD,KAAK,MAAM,EAAW,MAAM,UAAU,CAAC;AAEtG,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IAAE,QAAQ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CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAMzO;IAED,wDAAwD;IACxD,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,YAAY,CAGhH;IAED,2DAA2D;IAC3D,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,CAGnG;IAED,uDAAuD;IACvD,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,WAAW,CAG1H;IAED,4DAA4D;IAC5D,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,CAGhE;IAED,yDAAyD;IACzD,aAAa,IAAI,MAAM,CAGtB;IAED,2DAA2D;IAC3D,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAGxC;CAEF"}
@@ -0,0 +1,110 @@
1
+ /* GENERATED by scripts/abi-v1/gen.py from spec/abi-v1/abi.json (CHS_ABI_FINGERPRINT sha256:856e5cb7543db291b4db716662bf6e487b2258973b959bbf5d58b4bd46d73285) — DO NOT EDIT */
2
+ /*
3
+ * One typed, copy-then-free method per described call, named without the `chs_` prefix.
4
+ * Each marshals through the generic `rawCall`, throws the error class sdk.json's status
5
+ * table gives for a non-OK status, returns every owned buffer as a Buffer (already copied
6
+ * and freed) and every new handle wrapped. No raw buffer or error handle ever escapes.
7
+ * The accessors and frees of those two kinds, and the handshake, tombstone and tooling
8
+ * exports, get no method: the generic engine and the loader own them.
9
+ */
10
+ import { SYMBOL } from './decls.gen.js';
11
+ import { wrapHandle } from './handles.js';
12
+ import { asBuffer, checkStatus, NULL_EXTERNAL, rawCall } from './raw.js';
13
+ export class Calls {
14
+ raw;
15
+ constructor(raw) {
16
+ this.raw = raw;
17
+ }
18
+ /** The generated call wrapper for chs_live_handles. */
19
+ liveHandles() {
20
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.LIVE_HANDLES, []));
21
+ return outs["out"];
22
+ }
23
+ /** The generated call wrapper for chs_error_codes. */
24
+ errorCodes() {
25
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.ERROR_CODES, []));
26
+ return outs["out"];
27
+ }
28
+ /** The generated call wrapper for chs_initialize. */
29
+ initialize(timezone) {
30
+ checkStatus(rawCall(this.raw, SYMBOL.INITIALIZE, [asBuffer(timezone)]));
31
+ }
32
+ /** The generated call wrapper for chs_set_defaults. */
33
+ setDefaults(settings) {
34
+ checkStatus(rawCall(this.raw, SYMBOL.SET_DEFAULTS, [asBuffer(settings)]));
35
+ }
36
+ /** The generated call wrapper for chs_type_validate. */
37
+ typeValidate(typeExpr) {
38
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.TYPE_VALIDATE, [asBuffer(typeExpr)]));
39
+ return outs["out"];
40
+ }
41
+ /** The generated call wrapper for chs_back_quote. */
42
+ backQuote(name) {
43
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.BACK_QUOTE, [asBuffer(name)]));
44
+ return outs["out"];
45
+ }
46
+ /** The generated call wrapper for chs_back_quote_if_needed. */
47
+ backQuoteIfNeeded(name) {
48
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.BACK_QUOTE_IF_NEEDED, [asBuffer(name)]));
49
+ return outs["out"];
50
+ }
51
+ /** The generated call wrapper for chs_quote_string. */
52
+ quoteString(text) {
53
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.QUOTE_STRING, [asBuffer(text)]));
54
+ return outs["out"];
55
+ }
56
+ /** The generated call wrapper for chs_schema_create. */
57
+ schemaCreate(createTable, settings) {
58
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.SCHEMA_CREATE, [asBuffer(createTable), asBuffer(settings)]));
59
+ return wrapHandle(this.raw, outs["out"]);
60
+ }
61
+ /** The generated call wrapper for chs_schema_describe. */
62
+ schemaDescribe(schema) {
63
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.SCHEMA_DESCRIBE, [schema.ptr]));
64
+ return outs["out"];
65
+ }
66
+ /** The generated call wrapper for chs_preview_row. */
67
+ previewRow(schema, format, body, settings, columns) {
68
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.PREVIEW_ROW, [schema.ptr, format, asBuffer(body), asBuffer(settings), asBuffer(columns)]));
69
+ return outs["out"];
70
+ }
71
+ /** The generated call wrapper for chs_preview_batch. */
72
+ previewBatch(schema, format, body, settings, columns, filter, exportFormat, docFlags) {
73
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.PREVIEW_BATCH, [schema.ptr, format, asBuffer(body), asBuffer(settings), asBuffer(columns), filter === null ? NULL_EXTERNAL : filter.ptr, exportFormat, docFlags]));
74
+ return {
75
+ out: outs["out"],
76
+ outExport: outs["out_export"],
77
+ };
78
+ }
79
+ /** The generated call wrapper for chs_filter_create. */
80
+ filterCreate(schema, expr, queryParams, settings) {
81
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.FILTER_CREATE, [schema.ptr, asBuffer(expr), asBuffer(queryParams), asBuffer(settings)]));
82
+ return wrapHandle(this.raw, outs["out"]);
83
+ }
84
+ /** The generated call wrapper for chs_filter_eval_body. */
85
+ filterEvalBody(filter, format, body, settings) {
86
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.FILTER_EVAL_BODY, [filter.ptr, format, asBuffer(body), asBuffer(settings)]));
87
+ return outs["out"];
88
+ }
89
+ /** The generated call wrapper for chs_block_create. */
90
+ blockCreate(schema, format, body, settings, columns) {
91
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.BLOCK_CREATE, [schema.ptr, format, asBuffer(body), asBuffer(settings), asBuffer(columns)]));
92
+ return wrapHandle(this.raw, outs["out"]);
93
+ }
94
+ /** The generated call wrapper for chs_filter_eval_block. */
95
+ filterEvalBlock(filter, block) {
96
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.FILTER_EVAL_BLOCK, [filter.ptr, block.ptr]));
97
+ return outs["out"];
98
+ }
99
+ /** The generated call wrapper for chs_discover_query. */
100
+ discoverQuery() {
101
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.DISCOVER_QUERY, []));
102
+ return outs["out"];
103
+ }
104
+ /** The generated call wrapper for chs_discover_columns. */
105
+ discoverColumns(rows) {
106
+ const outs = checkStatus(rawCall(this.raw, SYMBOL.DISCOVER_COLUMNS, [asBuffer(rows)]));
107
+ return outs["out"];
108
+ }
109
+ }
110
+ //# sourceMappingURL=calls.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calls.gen.js","sourceRoot":"","sources":["../../src/abi1/calls.gen.ts"],"names":[],"mappings":"AAAA,8KAA8K;AAC9K;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAkB,aAAa,EAAe,OAAO,EAAE,MAAM,UAAU,CAAC;AAMtG,MAAM,OAAO,KAAK;IACP,GAAG,CAAS;IAErB,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,uDAAuD;IACvD,WAAW;QACT,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAW,CAAC;IAC/B,CAAC;IAED,sDAAsD;IACtD,UAAU;QACR,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;QACp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W,CAAC;IAC/B,CAAC;CAEF"}
@@ -0,0 +1,115 @@
1
+ export type ParamKind = 'scalar' | 'enum' | 'bytes_in' | 'handle' | 'out_handle' | 'out_error' | 'out_scalar';
2
+ export type ReturnKind = 'status' | 'void' | 'scalar' | 'enum' | 'handle';
3
+ export interface ParamSpec {
4
+ readonly name: string;
5
+ readonly kind: ParamKind;
6
+ readonly type: string | null;
7
+ readonly nullable: boolean;
8
+ readonly content: string | null;
9
+ }
10
+ export interface ReturnSpec {
11
+ readonly kind: ReturnKind;
12
+ readonly type: string | null;
13
+ readonly owned: boolean;
14
+ readonly nullable: boolean;
15
+ readonly content: string | null;
16
+ readonly borrows: string | null;
17
+ readonly constant: string | null;
18
+ }
19
+ export interface FunctionSpec {
20
+ readonly cls: 'handshake' | 'tombstone' | 'api' | 'tooling';
21
+ readonly thread: string;
22
+ readonly params: readonly ParamSpec[];
23
+ readonly returns: ReturnSpec;
24
+ readonly mayReturn: readonly string[];
25
+ }
26
+ /** Every described function's shape, keyed by its chs_* name. */
27
+ export declare const FUNCTION_SPECS: Readonly<Record<string, FunctionSpec>>;
28
+ /** chs_* name -> the key ts/src/abi1/raw.ts's ffi-rs define() table uses for it. */
29
+ export declare const CAMEL_NAMES: Readonly<Record<string, string>>;
30
+ /**
31
+ * Every described chs_* name, reachable WITHOUT spelling it: hand code writes
32
+ * `SYMBOL.BUF_FREE`, never the string `"chs_buf_free"`. Generated so the one place that
33
+ * spells a chs_* name is this file, machine-checked against spec/abi-v1/abi.json.
34
+ *
35
+ * Deliberately NOT typed `Record<string, string>`: each key's value is its own string
36
+ * LITERAL type, so a known key (`SYMBOL.BUF_FREE`) is never widened to `string | undefined`
37
+ * by `noUncheckedIndexedAccess` the way an index signature would be. Nothing here is ever
38
+ * looked up with a variable key — `CAMEL_NAMES` and `FUNCTION_SPECS` are, and keep their
39
+ * `Record` types for that reason.
40
+ */
41
+ export declare const SYMBOL: {
42
+ readonly ABI_REVISION: "chs_abi_revision";
43
+ readonly ABI_VERSION: "chs_abi_version";
44
+ readonly BACK_QUOTE: "chs_back_quote";
45
+ readonly BACK_QUOTE_IF_NEEDED: "chs_back_quote_if_needed";
46
+ readonly BLOCK_CREATE: "chs_block_create";
47
+ readonly BLOCK_FREE: "chs_block_free";
48
+ readonly BUF_DATA: "chs_buf_data";
49
+ readonly BUF_FREE: "chs_buf_free";
50
+ readonly BUF_LEN: "chs_buf_len";
51
+ readonly BUILD_INFO: "chs_build_info";
52
+ readonly CLICKHOUSE_VERSION: "chs_clickhouse_version";
53
+ readonly DISCOVER_COLUMNS: "chs_discover_columns";
54
+ readonly DISCOVER_QUERY: "chs_discover_query";
55
+ readonly ERROR_CH_CODE: "chs_error_ch_code";
56
+ readonly ERROR_CH_NAME: "chs_error_ch_name";
57
+ readonly ERROR_CODES: "chs_error_codes";
58
+ readonly ERROR_COLUMN: "chs_error_column";
59
+ readonly ERROR_FREE: "chs_error_free";
60
+ readonly ERROR_MESSAGE: "chs_error_message";
61
+ readonly ERROR_STATUS: "chs_error_status";
62
+ readonly FILTER_CREATE: "chs_filter_create";
63
+ readonly FILTER_EVAL_BLOCK: "chs_filter_eval_block";
64
+ readonly FILTER_EVAL_BODY: "chs_filter_eval_body";
65
+ readonly FILTER_FREE: "chs_filter_free";
66
+ readonly FUNCTION_FLAGS: "chs_function_flags";
67
+ readonly INITIALIZE: "chs_initialize";
68
+ readonly LIVE_HANDLES: "chs_live_handles";
69
+ readonly PREVIEW_BATCH: "chs_preview_batch";
70
+ readonly PREVIEW_ROW: "chs_preview_row";
71
+ readonly QUOTE_STRING: "chs_quote_string";
72
+ readonly REFERENCE_TYPE: "chs_reference_type";
73
+ readonly REGISTERED_FAMILIES: "chs_registered_families";
74
+ readonly SCHEMA_CREATE: "chs_schema_create";
75
+ readonly SCHEMA_DESCRIBE: "chs_schema_describe";
76
+ readonly SCHEMA_FREE: "chs_schema_free";
77
+ readonly SET_DEFAULTS: "chs_set_defaults";
78
+ readonly SHUTDOWN: "chs_shutdown";
79
+ readonly TYPE_VALIDATE: "chs_type_validate";
80
+ };
81
+ export interface HandleInfo {
82
+ readonly free: string;
83
+ readonly holds: readonly string[];
84
+ readonly className: string;
85
+ }
86
+ /** Every described handle kind: its free function (a SYMBOL.* value) and what it holds. */
87
+ export declare const HANDLE_INFO: Readonly<Record<string, HandleInfo>>;
88
+ /** chs_status, both directions (the wire int32 and its C name). */
89
+ export declare const STATUS_NAMES: Readonly<Record<number, string>>;
90
+ export declare const STATUS_VALUES: Readonly<Record<string, number>>;
91
+ /** Every exported symbol, sorted — the loader's step 6 resolve-all sweep. */
92
+ export declare const DESCRIBED_SYMBOLS: readonly string[];
93
+ /**
94
+ * The buf handle's own chs_* name (D2/D3's universal owned-output type), named so hand
95
+ * code can compare `ParamSpec.type`/`ReturnSpec.type` against it without ever spelling
96
+ * the literal itself (a literal would read as a hand-written chs_ reference to
97
+ * scripts/abi-v1/check-no-hand-decls.py once this file's own `define(`-adjacent code also
98
+ * names it — see ts/src/abi1/raw.ts's module comment).
99
+ */
100
+ export declare const BUF_HANDLE: 'chs_buf';
101
+ /**
102
+ * This binding's own compiled-in ABI identity (D1.1/§1.7's "one computation, copied
103
+ * everywhere else" — never recomputed, byte-compared against a loaded library's
104
+ * chs_build_info().abi_fingerprint at loader step 4).
105
+ */
106
+ export declare const ABI_VERSION = 1;
107
+ export declare const ABI_FINGERPRINT = "sha256:856e5cb7543db291b4db716662bf6e487b2258973b959bbf5d58b4bd46d73285";
108
+ export interface CrossCheckField {
109
+ readonly buildInfo: string;
110
+ readonly predicate: string;
111
+ readonly compare: 'bytes' | 'int';
112
+ }
113
+ /** spec/abi-v1/sdk.json's cross_check table: loader step 5's nine fields. */
114
+ export declare const CROSS_CHECK: readonly CrossCheckField[];
115
+ //# sourceMappingURL=decls.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.gen.d.ts","sourceRoot":"","sources":["../../src/abi1/decls.gen.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,SAAS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