@effect/sql-clickhouse 4.1.0 → 4.1.1
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.
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @stability unstable
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
14
14
|
import * as Layer from "effect/Layer";
|
|
15
15
|
import * as Migrator from "effect/sql/Migrator";
|
|
16
16
|
import type * as Client from "effect/sql/SqlClient";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickhouseMigrator.d.ts","sourceRoot":"","sources":["../src/ClickhouseMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ClickhouseMigrator.d.ts","sourceRoot":"","sources":["../src/ClickhouseMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAGnD;;GAEG;AACH,cAAc,qBAAqB,CAAA;AACnC,OAAO;AACL;;;;GAIG;AACH,cAAc,EACf,MAAM,+BAA+B,CAAA;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,EAC3B,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,KAC7D,MAAM,CAAC,MAAM,CAChB,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAClD,QAAQ,CAAC,cAAc,GAAG,QAAQ,EAClC,MAAM,CAAC,SAAS,GAAG,EAAE,CAGrB,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,WACZ,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,KACnC,KAAK,CAAC,KAAK,CACZ,KAAK,EACL,QAAQ,CAAC,cAAc,GAAG,QAAQ,EAClC,MAAM,CAAC,SAAS,GAAG,CAAC,CACgB,CAAA"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouse adapter for the shared Effect SQL migration runner.
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports the common `Migrator` loaders and error types, then
|
|
5
|
+
* provides `run` and `layer` helpers that apply ordered migrations through the
|
|
6
|
+
* current ClickHouse `SqlClient`. `run` returns the applied migration IDs and
|
|
7
|
+
* names, while `layer` runs the migrations during layer construction and
|
|
8
|
+
* provides no services.
|
|
9
|
+
*
|
|
10
|
+
* @stability unstable
|
|
11
|
+
* @since 4.0.0
|
|
12
|
+
*/
|
|
13
|
+
import * as Effect from "effect/Effect";
|
|
1
14
|
import * as Layer from "effect/Layer";
|
|
2
15
|
import * as Migrator from "effect/sql/Migrator";
|
|
16
|
+
import { ClientMethod } from "./ClickhouseClient.js";
|
|
3
17
|
/**
|
|
4
18
|
* @since 4.0.0
|
|
5
19
|
*/
|
|
@@ -19,7 +33,9 @@ fromFileSystem } from "effect/sql/MigratorFileSystem";
|
|
|
19
33
|
* @category running
|
|
20
34
|
* @since 4.0.0
|
|
21
35
|
*/
|
|
22
|
-
export const run = /*#__PURE__*/Migrator.make({
|
|
36
|
+
export const run = /*#__PURE__*/Migrator.make({
|
|
37
|
+
transformWrites: effect => Effect.provideService(effect, ClientMethod, "command")
|
|
38
|
+
});
|
|
23
39
|
/**
|
|
24
40
|
* Creates a layer that runs the configured ClickHouse migrations during layer
|
|
25
41
|
* construction and provides no services.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickhouseMigrator.js","names":[],"sources":["../src/ClickhouseMigrator.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClickhouseMigrator.js","names":[],"sources":["../src/ClickhouseMigrator.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;AAYA,OAAO,KAAK,MAAM,MAAM,eAAe;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,QAAQ,MAAM,qBAAqB;AAG/C,SAAS,YAAY,QAAQ,uBAAuB;AAEpD;;;AAGA,cAAc,qBAAqB;AACnC;AACE;;;;;AAKA,cAAc,QACT,+BAA+B;AAEtC;;;;;;;;AAQA,OAAO,MAAM,GAAG,gBAMZ,QAAQ,CAAC,IAAI,CAAC;EAChB,eAAe,EAAG,MAAM,IAAK,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS;CACnF,CAAC;AAEF;;;;;;;;AAQA,OAAO,MAAM,KAAK,GAChB,OAAoC,IAKjC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-clickhouse",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Clickhouse toolkit for Effect",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"provenance": true
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@effect/platform-node": "^4.1.
|
|
51
|
-
"effect": "^4.1.
|
|
50
|
+
"@effect/platform-node": "^4.1.1",
|
|
51
|
+
"effect": "^4.1.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@effect/platform-node": "^4.1.
|
|
55
|
-
"effect": "^4.1.
|
|
54
|
+
"@effect/platform-node": "^4.1.1",
|
|
55
|
+
"effect": "^4.1.1"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@clickhouse/client": "^1.24.1"
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* @stability unstable
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import * as Effect from "effect/Effect"
|
|
14
14
|
import * as Layer from "effect/Layer"
|
|
15
15
|
import * as Migrator from "effect/sql/Migrator"
|
|
16
16
|
import type * as Client from "effect/sql/SqlClient"
|
|
17
17
|
import type { SqlError } from "effect/sql/SqlError"
|
|
18
|
+
import { ClientMethod } from "./ClickhouseClient.ts"
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* @since 4.0.0
|
|
@@ -43,7 +44,9 @@ export const run: <R2 = never>(
|
|
|
43
44
|
ReadonlyArray<readonly [id: number, name: string]>,
|
|
44
45
|
Migrator.MigrationError | SqlError,
|
|
45
46
|
Client.SqlClient | R2
|
|
46
|
-
> = Migrator.make({
|
|
47
|
+
> = Migrator.make({
|
|
48
|
+
transformWrites: (effect) => Effect.provideService(effect, ClientMethod, "command")
|
|
49
|
+
})
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* Creates a layer that runs the configured ClickHouse migrations during layer
|