@fjall/clickhouse 16.0.1 → 18.0.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.
@@ -9,12 +9,12 @@
9
9
  "package.json",
10
10
  "tsconfig.json"
11
11
  ],
12
- "hash": "f7bf9e6f14e16e57655046e9c6c21c9bb860fb959a10d5de832a7b6cac34f29d",
12
+ "hash": "367c6409d546c8120a4f41f3644037eddc82e5194c469edeaf1e28baae72c9eb",
13
13
  "files": {
14
14
  "src/connectWithRetry.ts": "eb4d131ea8e81922",
15
15
  "src/constants.ts": "00b236fd35f098cb",
16
- "src/createClient.ts": "ca857dc10c888313",
17
- "src/index.ts": "4b819b3a8d8de192",
16
+ "src/createClient.ts": "83f093bfd7765a9f",
17
+ "src/index.ts": "2ab0816e1d411108",
18
18
  "src/logger.ts": "659d04c534247903",
19
19
  "src/provisionUsers.ts": "3e88d53b5eb1ccf5",
20
20
  "src/runSqlMigrations.ts": "d187aa5de9e4316e",
@@ -22,9 +22,9 @@
22
22
  "src/sleepAbortable.ts": "0286a0719bef3a38",
23
23
  "src/verifyExpectedClickHouseSchemaVersion.ts": "84f5463cd47e4a30",
24
24
  "../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
25
- "package.json": "8f995a1c0e47b4bc",
25
+ "package.json": "fa9d22cc77a2319d",
26
26
  "tsconfig.json": "db759831ad95f396"
27
27
  },
28
- "outputHash": "b6d878eba58caac7620f53070709609ac576162f10fe1f31c80a2a7ad070d0cd",
28
+ "outputHash": "a2e664088ae457f391cb978f6a1b48274a20f314ed7b6fbc1a2f2472e643e13a",
29
29
  "outputFileCount": 21
30
30
  }
package/dist/.minified CHANGED
@@ -1 +1 @@
1
- 10 files minified at 2026-08-22T04:03:41.329Z
1
+ 10 files minified at 2026-08-23T08:31:36.736Z
@@ -22,13 +22,33 @@ export interface CreateFjallClickHouseClientOptions {
22
22
  readonly password?: string;
23
23
  /** Optional database name override. */
24
24
  readonly database?: string;
25
- /** Pass-through to `@clickhouse/client`. */
25
+ /** Merged over {@link WIRE_FORMAT_CLICKHOUSE_SETTINGS}; caller keys win. */
26
26
  readonly clickhouse_settings?: ClickHouseClientConfigOptions["clickhouse_settings"];
27
27
  readonly compression?: ClickHouseClientConfigOptions["compression"];
28
28
  readonly request_timeout?: number;
29
29
  readonly max_open_connections?: number;
30
30
  readonly keep_alive?: ClickHouseClientConfigOptions["keep_alive"];
31
31
  }
32
+ /**
33
+ * The Fjall wire-format contract, applied to every client this factory
34
+ * builds: DateTime/DateTime64 columns serialise as RFC3339 instants with a
35
+ * timezone designator (`2026-08-23T01:23:45.678Z`), so consumers may
36
+ * `new Date(value)` any timestamp the server returns — no bespoke parser.
37
+ * Inputs stay tolerant (`best_effort` accepts both the ISO shape and the
38
+ * legacy `YYYY-MM-DD hh:mm:ss` form).
39
+ *
40
+ * Asymmetry to know: typed query PARAMETERS (`{x:DateTime64(3)}`) are bound
41
+ * by a separate parser that rejects a trailing `Z` regardless of
42
+ * `date_time_input_format` — keep formatting bind parameters without the
43
+ * designator (ClickHouse 26.3, verified).
44
+ *
45
+ * Caller-supplied `clickhouse_settings` spread AFTER these, so a caller can
46
+ * override either setting deliberately.
47
+ */
48
+ export declare const WIRE_FORMAT_CLICKHOUSE_SETTINGS: {
49
+ readonly date_time_output_format: "iso";
50
+ readonly date_time_input_format: "best_effort";
51
+ };
32
52
  /**
33
53
  * Sync factory wrapping `@clickhouse/client`'s `createClient`. No AWS SDK
34
54
  * call, no `await`, no module-level cache — the CA PEM is already on
@@ -1 +1 @@
1
- var a=Object.defineProperty;var d=(e,n)=>a(e,"name",{value:n,configurable:!0});import{createClient as c}from"@clickhouse/client";function l(e={}){const n=process.env.CLICKHOUSE_URL,i=e.url!==void 0&&e.url!==""?e.url:n!==void 0&&n!==""?n:void 0;if(i===void 0)throw new Error("createFjallClickHouseClient: CLICKHOUSE_URL must be set (env or opts.url)");const r=process.env.CLICKHOUSE_CA_CERT,u=e.caCert!==void 0&&e.caCert!==""?e.caCert:r!==void 0&&r!==""?r:void 0;return c({url:i,...e.username!==void 0&&{username:e.username},...e.password!==void 0&&{password:e.password},...e.database!==void 0&&{database:e.database},...e.clickhouse_settings!==void 0&&{clickhouse_settings:e.clickhouse_settings},...e.compression!==void 0&&{compression:e.compression},...e.request_timeout!==void 0&&{request_timeout:e.request_timeout},...e.max_open_connections!==void 0&&{max_open_connections:e.max_open_connections},...e.keep_alive!==void 0&&{keep_alive:e.keep_alive},...u!==void 0&&{tls:{ca_cert:Buffer.from(u,"utf8")}}})}d(l,"createFjallClickHouseClient");export{l as createFjallClickHouseClient};
1
+ var a=Object.defineProperty;var d=(e,n)=>a(e,"name",{value:n,configurable:!0});import{createClient as t}from"@clickhouse/client";const c={date_time_output_format:"iso",date_time_input_format:"best_effort"};function o(e={}){const n=process.env.CLICKHOUSE_URL,i=e.url!==void 0&&e.url!==""?e.url:n!==void 0&&n!==""?n:void 0;if(i===void 0)throw new Error("createFjallClickHouseClient: CLICKHOUSE_URL must be set (env or opts.url)");const r=process.env.CLICKHOUSE_CA_CERT,u=e.caCert!==void 0&&e.caCert!==""?e.caCert:r!==void 0&&r!==""?r:void 0;return t({url:i,...e.username!==void 0&&{username:e.username},...e.password!==void 0&&{password:e.password},...e.database!==void 0&&{database:e.database},clickhouse_settings:{...c,...e.clickhouse_settings},...e.compression!==void 0&&{compression:e.compression},...e.request_timeout!==void 0&&{request_timeout:e.request_timeout},...e.max_open_connections!==void 0&&{max_open_connections:e.max_open_connections},...e.keep_alive!==void 0&&{keep_alive:e.keep_alive},...u!==void 0&&{tls:{ca_cert:Buffer.from(u,"utf8")}}})}d(o,"createFjallClickHouseClient");export{c as WIRE_FORMAT_CLICKHOUSE_SETTINGS,o as createFjallClickHouseClient};
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { type ConnectWithRetryOpts, connectWithRetry, } from "./connectWithRetry
5
5
  export { type ProvisionUsersFromEnvOpts, type ProvisionUsersFromEnvResult, provisionUsersFromEnv, } from "./provisionUsers.js";
6
6
  export { type RunSqlMigrationsOpts, type RunSqlMigrationsResult, runSqlMigrations, } from "./runSqlMigrations.js";
7
7
  export { type VerifyExpectedClickHouseSchemaVersionOpts, type VerifyExpectedClickHouseSchemaVersionResult, verifyExpectedClickHouseSchemaVersion, } from "./verifyExpectedClickHouseSchemaVersion.js";
8
- export { type CreateFjallClickHouseClientOptions, createFjallClickHouseClient, } from "./createClient.js";
8
+ export { type CreateFjallClickHouseClientOptions, createFjallClickHouseClient, WIRE_FORMAT_CLICKHOUSE_SETTINGS, } from "./createClient.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{CLICKHOUSE_MANAGED_USERS_ENV as o,userPasswordEnvName as t}from"./constants.js";import{ManagedUserNameSchema as m,ManagedUserNamesSchema as s}from"./schemas.js";import{createConsoleMigrationLogger as i}from"./logger.js";import{connectWithRetry as p}from"./connectWithRetry.js";import{provisionUsersFromEnv as x}from"./provisionUsers.js";import{runSqlMigrations as E}from"./runSqlMigrations.js";import{verifyExpectedClickHouseSchemaVersion as g}from"./verifyExpectedClickHouseSchemaVersion.js";import{createFjallClickHouseClient as M}from"./createClient.js";export{o as CLICKHOUSE_MANAGED_USERS_ENV,m as ManagedUserNameSchema,s as ManagedUserNamesSchema,p as connectWithRetry,i as createConsoleMigrationLogger,M as createFjallClickHouseClient,x as provisionUsersFromEnv,E as runSqlMigrations,t as userPasswordEnvName,g as verifyExpectedClickHouseSchemaVersion};
1
+ import{CLICKHOUSE_MANAGED_USERS_ENV as o,userPasswordEnvName as t}from"./constants.js";import{ManagedUserNameSchema as m,ManagedUserNamesSchema as s}from"./schemas.js";import{createConsoleMigrationLogger as i}from"./logger.js";import{connectWithRetry as p}from"./connectWithRetry.js";import{provisionUsersFromEnv as S}from"./provisionUsers.js";import{runSqlMigrations as x}from"./runSqlMigrations.js";import{verifyExpectedClickHouseSchemaVersion as l}from"./verifyExpectedClickHouseSchemaVersion.js";import{createFjallClickHouseClient as M,WIRE_FORMAT_CLICKHOUSE_SETTINGS as N}from"./createClient.js";export{o as CLICKHOUSE_MANAGED_USERS_ENV,m as ManagedUserNameSchema,s as ManagedUserNamesSchema,N as WIRE_FORMAT_CLICKHOUSE_SETTINGS,p as connectWithRetry,i as createConsoleMigrationLogger,M as createFjallClickHouseClient,S as provisionUsersFromEnv,x as runSqlMigrations,t as userPasswordEnvName,l as verifyExpectedClickHouseSchemaVersion};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/clickhouse",
3
- "version": "16.0.1",
3
+ "version": "18.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fjall-tech/fjall.git",
@@ -50,7 +50,7 @@
50
50
  "@clickhouse/client": "^1.18.0"
51
51
  },
52
52
  "dependencies": {
53
- "@fjall/util": "^16.0.1",
53
+ "@fjall/util": "^18.0.0",
54
54
  "zod": "^4.4.3"
55
55
  },
56
56
  "engines": {