@effect/sql-clickhouse 4.0.0-beta.67 → 4.0.0-beta.68
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/dist/ClickhouseClient.d.ts +5 -5
- package/dist/ClickhouseClient.js +4 -4
- package/dist/ClickhouseMigrator.d.ts +1 -1
- package/dist/ClickhouseMigrator.js +1 -1
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/ClickhouseClient.ts +5 -5
- package/src/ClickhouseMigrator.ts +1 -1
- package/src/index.ts +37 -0
|
@@ -35,14 +35,14 @@ import type { Readable } from "node:stream";
|
|
|
35
35
|
/**
|
|
36
36
|
* Unique runtime identifier used to tag `ClickhouseClient` values.
|
|
37
37
|
*
|
|
38
|
-
* @category type
|
|
38
|
+
* @category type IDs
|
|
39
39
|
* @since 4.0.0
|
|
40
40
|
*/
|
|
41
41
|
export declare const TypeId: TypeId;
|
|
42
42
|
/**
|
|
43
43
|
* Type-level literal for the `ClickhouseClient` runtime identifier.
|
|
44
44
|
*
|
|
45
|
-
* @category type
|
|
45
|
+
* @category type IDs
|
|
46
46
|
* @since 4.0.0
|
|
47
47
|
*/
|
|
48
48
|
export type TypeId = "~@effect/sql-clickhouse/ClickhouseClient";
|
|
@@ -106,7 +106,7 @@ export declare const make: (options: ClickhouseClientConfig) => Effect.Effect<Cl
|
|
|
106
106
|
* Fiber reference read by the low-level ClickHouse connection to choose query
|
|
107
107
|
* or command execution for statements; defaults to `query`.
|
|
108
108
|
*
|
|
109
|
-
* @category
|
|
109
|
+
* @category references
|
|
110
110
|
* @since 4.0.0
|
|
111
111
|
*/
|
|
112
112
|
export declare const ClientMethod: Context.Reference<"query" | "command" | "insert">;
|
|
@@ -114,7 +114,7 @@ export declare const ClientMethod: Context.Reference<"query" | "command" | "inse
|
|
|
114
114
|
* Fiber reference for the ClickHouse `query_id` applied to queries and
|
|
115
115
|
* inserts; a random UUID is generated when no query ID is set.
|
|
116
116
|
*
|
|
117
|
-
* @category
|
|
117
|
+
* @category references
|
|
118
118
|
* @since 4.0.0
|
|
119
119
|
*/
|
|
120
120
|
export declare const QueryId: Context.Reference<string | undefined>;
|
|
@@ -122,7 +122,7 @@ export declare const QueryId: Context.Reference<string | undefined>;
|
|
|
122
122
|
* Fiber reference containing ClickHouse settings to attach to queries,
|
|
123
123
|
* commands, and inserts.
|
|
124
124
|
*
|
|
125
|
-
* @category
|
|
125
|
+
* @category references
|
|
126
126
|
* @since 4.0.0
|
|
127
127
|
*/
|
|
128
128
|
export declare const ClickhouseSettings: Context.Reference<NonNullable<Clickhouse.BaseQueryParams["clickhouse_settings"]>>;
|
package/dist/ClickhouseClient.js
CHANGED
|
@@ -79,7 +79,7 @@ const classifyError = (cause, message, operation, fallback = "unknown") => {
|
|
|
79
79
|
/**
|
|
80
80
|
* Unique runtime identifier used to tag `ClickhouseClient` values.
|
|
81
81
|
*
|
|
82
|
-
* @category type
|
|
82
|
+
* @category type IDs
|
|
83
83
|
* @since 4.0.0
|
|
84
84
|
*/
|
|
85
85
|
export const TypeId = "~@effect/sql-clickhouse/ClickhouseClient";
|
|
@@ -260,7 +260,7 @@ export const make = options => Effect.gen(function* () {
|
|
|
260
260
|
* Fiber reference read by the low-level ClickHouse connection to choose query
|
|
261
261
|
* or command execution for statements; defaults to `query`.
|
|
262
262
|
*
|
|
263
|
-
* @category
|
|
263
|
+
* @category references
|
|
264
264
|
* @since 4.0.0
|
|
265
265
|
*/
|
|
266
266
|
export const ClientMethod = /*#__PURE__*/Context.Reference("@effect/sql-clickhouse/ClickhouseClient/ClientMethod", {
|
|
@@ -270,7 +270,7 @@ export const ClientMethod = /*#__PURE__*/Context.Reference("@effect/sql-clickhou
|
|
|
270
270
|
* Fiber reference for the ClickHouse `query_id` applied to queries and
|
|
271
271
|
* inserts; a random UUID is generated when no query ID is set.
|
|
272
272
|
*
|
|
273
|
-
* @category
|
|
273
|
+
* @category references
|
|
274
274
|
* @since 4.0.0
|
|
275
275
|
*/
|
|
276
276
|
export const QueryId = /*#__PURE__*/Context.Reference("@effect/sql-clickhouse/ClickhouseClient/QueryId", {
|
|
@@ -280,7 +280,7 @@ export const QueryId = /*#__PURE__*/Context.Reference("@effect/sql-clickhouse/Cl
|
|
|
280
280
|
* Fiber reference containing ClickHouse settings to attach to queries,
|
|
281
281
|
* commands, and inserts.
|
|
282
282
|
*
|
|
283
|
-
* @category
|
|
283
|
+
* @category references
|
|
284
284
|
* @since 4.0.0
|
|
285
285
|
*/
|
|
286
286
|
export const ClickhouseSettings = /*#__PURE__*/Context.Reference("@effect/sql-clickhouse/ClickhouseClient/ClickhouseSettings", {
|
|
@@ -31,7 +31,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
31
31
|
* Runs SQL migrations for ClickHouse using the supplied migrator options and
|
|
32
32
|
* returns the applied migration IDs and names.
|
|
33
33
|
*
|
|
34
|
-
* @category
|
|
34
|
+
* @category constructors
|
|
35
35
|
* @since 4.0.0
|
|
36
36
|
*/
|
|
37
37
|
export declare const run: <R2 = never>({ loader, schemaDirectory, table }: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, Client.SqlClient | R2>;
|
|
@@ -8,7 +8,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
8
8
|
* Runs SQL migrations for ClickHouse using the supplied migrator options and
|
|
9
9
|
* returns the applied migration IDs and names.
|
|
10
10
|
*
|
|
11
|
-
* @category
|
|
11
|
+
* @category constructors
|
|
12
12
|
* @since 4.0.0
|
|
13
13
|
*/
|
|
14
14
|
export const run = /*#__PURE__*/Migrator.make({});
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,47 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* ClickHouse client implementation for Effect SQL, backed by
|
|
6
|
+
* `@clickhouse/client`.
|
|
7
|
+
*
|
|
8
|
+
* This module exposes constructors and layers for providing both the
|
|
9
|
+
* ClickHouse-specific `ClickhouseClient` service and the generic `SqlClient`
|
|
10
|
+
* service. It is intended for analytical application queries, migrations,
|
|
11
|
+
* background jobs, bulk inserts, and streaming reads that need Effect SQL query
|
|
12
|
+
* compilation, scoped lifecycle management, interruption, and consistent
|
|
13
|
+
* `SqlError` classification for ClickHouse failures.
|
|
14
|
+
*
|
|
15
|
+
* The client uses the ClickHouse HTTP client APIs for `query`, `command`, and
|
|
16
|
+
* `insert` operations. Regular queries read JSON result sets, `executeValues`
|
|
17
|
+
* requests `JSONCompact`, streams request `JSONEachRow`, and `insertQuery`
|
|
18
|
+
* defaults inserts to `JSONEachRow`. Interrupting an operation aborts the
|
|
19
|
+
* underlying HTTP request and attempts to kill the generated or supplied
|
|
20
|
+
* `query_id`. The statement compiler emits ClickHouse typed placeholders such
|
|
21
|
+
* as `{p1: Type}`; use `param` when the inferred type is too broad, and write
|
|
22
|
+
* ClickHouse-specific clauses such as engines, `SETTINGS`, `FORMAT`, or
|
|
23
|
+
* cluster directives explicitly.
|
|
24
|
+
*
|
|
5
25
|
* @since 4.0.0
|
|
6
26
|
*/
|
|
7
27
|
export * as ClickhouseClient from "./ClickhouseClient.ts";
|
|
8
28
|
/**
|
|
29
|
+
* Utilities for applying Effect SQL migrations to ClickHouse databases.
|
|
30
|
+
*
|
|
31
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
32
|
+
* provides `run` and `layer` helpers for applying ordered migrations through
|
|
33
|
+
* the current ClickHouse `SqlClient`. It is typically used during application
|
|
34
|
+
* startup, deployment, or integration tests that need to prepare analytical
|
|
35
|
+
* tables before dependent services begin reading or writing data.
|
|
36
|
+
*
|
|
37
|
+
* Applied migrations are stored in `effect_sql_migrations` by default and use
|
|
38
|
+
* the shared `<id>_<name>` loader convention. Only migrations with ids greater
|
|
39
|
+
* than the latest recorded id are run. ClickHouse schema changes often depend
|
|
40
|
+
* on engine, `ORDER BY`, database, and cluster settings, and many deployments
|
|
41
|
+
* rely on explicit `ON CLUSTER` clauses or coordinated rollout tooling. This
|
|
42
|
+
* adapter does not add a ClickHouse-specific table lock or schema dumper, so
|
|
43
|
+
* coordinate concurrent migrators and do not expect `schemaDirectory` to emit a
|
|
44
|
+
* ClickHouse schema snapshot.
|
|
45
|
+
*
|
|
9
46
|
* @since 4.0.0
|
|
10
47
|
*/
|
|
11
48
|
export * as ClickhouseMigrator from "./ClickhouseMigrator.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,47 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
6
|
+
* ClickHouse client implementation for Effect SQL, backed by
|
|
7
|
+
* `@clickhouse/client`.
|
|
8
|
+
*
|
|
9
|
+
* This module exposes constructors and layers for providing both the
|
|
10
|
+
* ClickHouse-specific `ClickhouseClient` service and the generic `SqlClient`
|
|
11
|
+
* service. It is intended for analytical application queries, migrations,
|
|
12
|
+
* background jobs, bulk inserts, and streaming reads that need Effect SQL query
|
|
13
|
+
* compilation, scoped lifecycle management, interruption, and consistent
|
|
14
|
+
* `SqlError` classification for ClickHouse failures.
|
|
15
|
+
*
|
|
16
|
+
* The client uses the ClickHouse HTTP client APIs for `query`, `command`, and
|
|
17
|
+
* `insert` operations. Regular queries read JSON result sets, `executeValues`
|
|
18
|
+
* requests `JSONCompact`, streams request `JSONEachRow`, and `insertQuery`
|
|
19
|
+
* defaults inserts to `JSONEachRow`. Interrupting an operation aborts the
|
|
20
|
+
* underlying HTTP request and attempts to kill the generated or supplied
|
|
21
|
+
* `query_id`. The statement compiler emits ClickHouse typed placeholders such
|
|
22
|
+
* as `{p1: Type}`; use `param` when the inferred type is too broad, and write
|
|
23
|
+
* ClickHouse-specific clauses such as engines, `SETTINGS`, `FORMAT`, or
|
|
24
|
+
* cluster directives explicitly.
|
|
25
|
+
*
|
|
6
26
|
* @since 4.0.0
|
|
7
27
|
*/
|
|
8
28
|
export * as ClickhouseClient from "./ClickhouseClient.js";
|
|
9
29
|
/**
|
|
30
|
+
* Utilities for applying Effect SQL migrations to ClickHouse databases.
|
|
31
|
+
*
|
|
32
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
33
|
+
* provides `run` and `layer` helpers for applying ordered migrations through
|
|
34
|
+
* the current ClickHouse `SqlClient`. It is typically used during application
|
|
35
|
+
* startup, deployment, or integration tests that need to prepare analytical
|
|
36
|
+
* tables before dependent services begin reading or writing data.
|
|
37
|
+
*
|
|
38
|
+
* Applied migrations are stored in `effect_sql_migrations` by default and use
|
|
39
|
+
* the shared `<id>_<name>` loader convention. Only migrations with ids greater
|
|
40
|
+
* than the latest recorded id are run. ClickHouse schema changes often depend
|
|
41
|
+
* on engine, `ORDER BY`, database, and cluster settings, and many deployments
|
|
42
|
+
* rely on explicit `ON CLUSTER` clauses or coordinated rollout tooling. This
|
|
43
|
+
* adapter does not add a ClickHouse-specific table lock or schema dumper, so
|
|
44
|
+
* coordinate concurrent migrators and do not expect `schemaDirectory` to emit a
|
|
45
|
+
* ClickHouse schema snapshot.
|
|
46
|
+
*
|
|
10
47
|
* @since 4.0.0
|
|
11
48
|
*/
|
|
12
49
|
export * as ClickhouseMigrator from "./ClickhouseMigrator.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ClickhouseClient","ClickhouseMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA
|
|
1
|
+
{"version":3,"file":"index.js","names":["ClickhouseClient","ClickhouseMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKA,gBAAgB,MAAM,uBAAuB;AAEzD;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKC,kBAAkB,MAAM,yBAAyB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-clickhouse",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Clickhouse toolkit for Effect",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"provenance": true
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"effect": "^4.0.0-beta.
|
|
47
|
-
"
|
|
46
|
+
"@effect/platform-node": "^4.0.0-beta.68",
|
|
47
|
+
"effect": "^4.0.0-beta.68"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@effect/platform-node": "^4.0.0-beta.
|
|
51
|
-
"effect": "^4.0.0-beta.
|
|
50
|
+
"@effect/platform-node": "^4.0.0-beta.68",
|
|
51
|
+
"effect": "^4.0.0-beta.68"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@clickhouse/client": "^1.18.4"
|
package/src/ClickhouseClient.ts
CHANGED
|
@@ -96,7 +96,7 @@ const classifyError = (
|
|
|
96
96
|
/**
|
|
97
97
|
* Unique runtime identifier used to tag `ClickhouseClient` values.
|
|
98
98
|
*
|
|
99
|
-
* @category type
|
|
99
|
+
* @category type IDs
|
|
100
100
|
* @since 4.0.0
|
|
101
101
|
*/
|
|
102
102
|
export const TypeId: TypeId = "~@effect/sql-clickhouse/ClickhouseClient"
|
|
@@ -104,7 +104,7 @@ export const TypeId: TypeId = "~@effect/sql-clickhouse/ClickhouseClient"
|
|
|
104
104
|
/**
|
|
105
105
|
* Type-level literal for the `ClickhouseClient` runtime identifier.
|
|
106
106
|
*
|
|
107
|
-
* @category type
|
|
107
|
+
* @category type IDs
|
|
108
108
|
* @since 4.0.0
|
|
109
109
|
*/
|
|
110
110
|
export type TypeId = "~@effect/sql-clickhouse/ClickhouseClient"
|
|
@@ -402,7 +402,7 @@ export const make = (
|
|
|
402
402
|
* Fiber reference read by the low-level ClickHouse connection to choose query
|
|
403
403
|
* or command execution for statements; defaults to `query`.
|
|
404
404
|
*
|
|
405
|
-
* @category
|
|
405
|
+
* @category references
|
|
406
406
|
* @since 4.0.0
|
|
407
407
|
*/
|
|
408
408
|
export const ClientMethod = Context.Reference<"query" | "command" | "insert">(
|
|
@@ -416,7 +416,7 @@ export const ClientMethod = Context.Reference<"query" | "command" | "insert">(
|
|
|
416
416
|
* Fiber reference for the ClickHouse `query_id` applied to queries and
|
|
417
417
|
* inserts; a random UUID is generated when no query ID is set.
|
|
418
418
|
*
|
|
419
|
-
* @category
|
|
419
|
+
* @category references
|
|
420
420
|
* @since 4.0.0
|
|
421
421
|
*/
|
|
422
422
|
export const QueryId = Context.Reference<string | undefined>(
|
|
@@ -428,7 +428,7 @@ export const QueryId = Context.Reference<string | undefined>(
|
|
|
428
428
|
* Fiber reference containing ClickHouse settings to attach to queries,
|
|
429
429
|
* commands, and inserts.
|
|
430
430
|
*
|
|
431
|
-
* @category
|
|
431
|
+
* @category references
|
|
432
432
|
* @since 4.0.0
|
|
433
433
|
*/
|
|
434
434
|
export const ClickhouseSettings: Context.Reference<
|
|
@@ -33,7 +33,7 @@ export * from "effect/unstable/sql/Migrator"
|
|
|
33
33
|
* Runs SQL migrations for ClickHouse using the supplied migrator options and
|
|
34
34
|
* returns the applied migration IDs and names.
|
|
35
35
|
*
|
|
36
|
-
* @category
|
|
36
|
+
* @category constructors
|
|
37
37
|
* @since 4.0.0
|
|
38
38
|
*/
|
|
39
39
|
export const run: <R2 = never>(
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,48 @@
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* ClickHouse client implementation for Effect SQL, backed by
|
|
9
|
+
* `@clickhouse/client`.
|
|
10
|
+
*
|
|
11
|
+
* This module exposes constructors and layers for providing both the
|
|
12
|
+
* ClickHouse-specific `ClickhouseClient` service and the generic `SqlClient`
|
|
13
|
+
* service. It is intended for analytical application queries, migrations,
|
|
14
|
+
* background jobs, bulk inserts, and streaming reads that need Effect SQL query
|
|
15
|
+
* compilation, scoped lifecycle management, interruption, and consistent
|
|
16
|
+
* `SqlError` classification for ClickHouse failures.
|
|
17
|
+
*
|
|
18
|
+
* The client uses the ClickHouse HTTP client APIs for `query`, `command`, and
|
|
19
|
+
* `insert` operations. Regular queries read JSON result sets, `executeValues`
|
|
20
|
+
* requests `JSONCompact`, streams request `JSONEachRow`, and `insertQuery`
|
|
21
|
+
* defaults inserts to `JSONEachRow`. Interrupting an operation aborts the
|
|
22
|
+
* underlying HTTP request and attempts to kill the generated or supplied
|
|
23
|
+
* `query_id`. The statement compiler emits ClickHouse typed placeholders such
|
|
24
|
+
* as `{p1: Type}`; use `param` when the inferred type is too broad, and write
|
|
25
|
+
* ClickHouse-specific clauses such as engines, `SETTINGS`, `FORMAT`, or
|
|
26
|
+
* cluster directives explicitly.
|
|
27
|
+
*
|
|
8
28
|
* @since 4.0.0
|
|
9
29
|
*/
|
|
10
30
|
export * as ClickhouseClient from "./ClickhouseClient.ts"
|
|
11
31
|
|
|
12
32
|
/**
|
|
33
|
+
* Utilities for applying Effect SQL migrations to ClickHouse databases.
|
|
34
|
+
*
|
|
35
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
36
|
+
* provides `run` and `layer` helpers for applying ordered migrations through
|
|
37
|
+
* the current ClickHouse `SqlClient`. It is typically used during application
|
|
38
|
+
* startup, deployment, or integration tests that need to prepare analytical
|
|
39
|
+
* tables before dependent services begin reading or writing data.
|
|
40
|
+
*
|
|
41
|
+
* Applied migrations are stored in `effect_sql_migrations` by default and use
|
|
42
|
+
* the shared `<id>_<name>` loader convention. Only migrations with ids greater
|
|
43
|
+
* than the latest recorded id are run. ClickHouse schema changes often depend
|
|
44
|
+
* on engine, `ORDER BY`, database, and cluster settings, and many deployments
|
|
45
|
+
* rely on explicit `ON CLUSTER` clauses or coordinated rollout tooling. This
|
|
46
|
+
* adapter does not add a ClickHouse-specific table lock or schema dumper, so
|
|
47
|
+
* coordinate concurrent migrators and do not expect `schemaDirectory` to emit a
|
|
48
|
+
* ClickHouse schema snapshot.
|
|
49
|
+
*
|
|
13
50
|
* @since 4.0.0
|
|
14
51
|
*/
|
|
15
52
|
export * as ClickhouseMigrator from "./ClickhouseMigrator.ts"
|