@effect/sql-clickhouse 4.0.7 → 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 type * as Effect from "effect/Effect";
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";
@@ -19,6 +19,13 @@ import type { SqlError } from "effect/sql/SqlError";
19
19
  * @since 4.0.0
20
20
  */
21
21
  export * from "effect/sql/Migrator";
22
+ export {
23
+ /**
24
+ * @stability unstable
25
+ * @category loaders
26
+ * @since 4.0.0
27
+ */
28
+ fromFileSystem } from "effect/sql/MigratorFileSystem";
22
29
  /**
23
30
  * Runs SQL migrations for ClickHouse using the supplied migrator options and
24
31
  * returns the applied migration IDs and names.
@@ -1 +1 @@
1
- {"version":3,"file":"ClickhouseMigrator.d.ts","sourceRoot":"","sources":["../src/ClickhouseMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,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;AAEnD;;GAEG;AACH,cAAc,qBAAqB,CAAA;AAEnC;;;;;;;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,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AAC,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,9 +1,30 @@
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
  */
6
20
  export * from "effect/sql/Migrator";
21
+ export {
22
+ /**
23
+ * @stability unstable
24
+ * @category loaders
25
+ * @since 4.0.0
26
+ */
27
+ fromFileSystem } from "effect/sql/MigratorFileSystem";
7
28
  /**
8
29
  * Runs SQL migrations for ClickHouse using the supplied migrator options and
9
30
  * returns the applied migration IDs and names.
@@ -12,7 +33,9 @@ export * from "effect/sql/Migrator";
12
33
  * @category running
13
34
  * @since 4.0.0
14
35
  */
15
- export const run = /*#__PURE__*/Migrator.make({});
36
+ export const run = /*#__PURE__*/Migrator.make({
37
+ transformWrites: effect => Effect.provideService(effect, ClientMethod, "command")
38
+ });
16
39
  /**
17
40
  * Creates a layer that runs the configured ClickHouse migrations during layer
18
41
  * construction and provides no services.
@@ -1 +1 @@
1
- {"version":3,"file":"ClickhouseMigrator.js","names":[],"sources":["../src/ClickhouseMigrator.ts"],"sourcesContent":[null],"mappings":"AAaA,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,QAAQ,MAAM,qBAAqB;AAI/C;;;AAGA,cAAc,qBAAqB;AAEnC;;;;;;;;AAQA,OAAO,MAAM,GAAG,gBAMZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAErB;;;;;;;;AAQA,OAAO,MAAM,KAAK,GAChB,OAAoC,IAKjC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC","ignoreList":[]}
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.0.7",
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.0.7",
51
- "effect": "^4.0.7"
50
+ "@effect/platform-node": "^4.1.1",
51
+ "effect": "^4.1.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@effect/platform-node": "^4.0.7",
55
- "effect": "^4.0.7"
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,16 +10,25 @@
10
10
  * @stability unstable
11
11
  * @since 4.0.0
12
12
  */
13
- import type * as Effect from "effect/Effect"
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
21
22
  */
22
23
  export * from "effect/sql/Migrator"
24
+ export {
25
+ /**
26
+ * @stability unstable
27
+ * @category loaders
28
+ * @since 4.0.0
29
+ */
30
+ fromFileSystem
31
+ } from "effect/sql/MigratorFileSystem"
23
32
 
24
33
  /**
25
34
  * Runs SQL migrations for ClickHouse using the supplied migrator options and
@@ -35,7 +44,9 @@ export const run: <R2 = never>(
35
44
  ReadonlyArray<readonly [id: number, name: string]>,
36
45
  Migrator.MigrationError | SqlError,
37
46
  Client.SqlClient | R2
38
- > = Migrator.make({})
47
+ > = Migrator.make({
48
+ transformWrites: (effect) => Effect.provideService(effect, ClientMethod, "command")
49
+ })
39
50
 
40
51
  /**
41
52
  * Creates a layer that runs the configured ClickHouse migrations during layer