@effect/sql-mysql2 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/MysqlClient.d.ts +2 -2
- package/dist/MysqlClient.js +1 -1
- package/dist/MysqlMigrator.d.ts +1 -1
- package/dist/MysqlMigrator.js +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/MysqlClient.ts +2 -2
- package/src/MysqlMigrator.ts +1 -1
- package/src/index.ts +35 -0
package/dist/MysqlClient.d.ts
CHANGED
|
@@ -33,14 +33,14 @@ import * as Mysql from "mysql2";
|
|
|
33
33
|
/**
|
|
34
34
|
* Runtime type identifier used to mark `MysqlClient` values.
|
|
35
35
|
*
|
|
36
|
-
* @category type
|
|
36
|
+
* @category type IDs
|
|
37
37
|
* @since 4.0.0
|
|
38
38
|
*/
|
|
39
39
|
export declare const TypeId: TypeId;
|
|
40
40
|
/**
|
|
41
41
|
* Type-level identifier used to mark `MysqlClient` values.
|
|
42
42
|
*
|
|
43
|
-
* @category type
|
|
43
|
+
* @category type IDs
|
|
44
44
|
* @since 4.0.0
|
|
45
45
|
*/
|
|
46
46
|
export type TypeId = "~@effect/sql-mysql2/MysqlClient";
|
package/dist/MysqlClient.js
CHANGED
|
@@ -122,7 +122,7 @@ const classifyError = (cause, message, operation) => {
|
|
|
122
122
|
/**
|
|
123
123
|
* Runtime type identifier used to mark `MysqlClient` values.
|
|
124
124
|
*
|
|
125
|
-
* @category type
|
|
125
|
+
* @category type IDs
|
|
126
126
|
* @since 4.0.0
|
|
127
127
|
*/
|
|
128
128
|
export const TypeId = "~@effect/sql-mysql2/MysqlClient";
|
package/dist/MysqlMigrator.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
31
31
|
/**
|
|
32
32
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
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>;
|
package/dist/MysqlMigrator.js
CHANGED
|
@@ -7,7 +7,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
7
7
|
/**
|
|
8
8
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
9
9
|
*
|
|
10
|
-
* @category
|
|
10
|
+
* @category constructors
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
export const run = /*#__PURE__*/Migrator.make({
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,45 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* MySQL client implementation for Effect SQL, backed by the `mysql2` driver.
|
|
6
|
+
*
|
|
7
|
+
* This module exposes constructors and layers for providing both the MySQL-specific
|
|
8
|
+
* `MysqlClient` service and the generic `SqlClient` service. It is intended for server
|
|
9
|
+
* applications, background workers, migrations, and tests that need Effect SQL query
|
|
10
|
+
* compilation, scoped resource management, streaming queries, and consistent `SqlError`
|
|
11
|
+
* classification for MySQL driver failures.
|
|
12
|
+
*
|
|
13
|
+
* Each client owns a scoped mysql2 pool, validates connectivity with `SELECT 1` during
|
|
14
|
+
* acquisition, and closes the pool when the surrounding scope is released. You can configure
|
|
15
|
+
* the pool from a connection URI or discrete connection fields; when `url` is supplied it
|
|
16
|
+
* takes precedence over the host, port, database, username, and password fields. Regular
|
|
17
|
+
* queries run through the shared pool, while transactions acquire a dedicated pooled
|
|
18
|
+
* connection for their lifetime, so long-running transactions and streams can occupy pool
|
|
19
|
+
* capacity. Size `maxConnections`, `connectionTTL`, and any mysql2 `poolConfig` with that in
|
|
20
|
+
* mind.
|
|
21
|
+
*
|
|
5
22
|
* @since 4.0.0
|
|
6
23
|
*/
|
|
7
24
|
export * as MysqlClient from "./MysqlClient.ts";
|
|
8
25
|
/**
|
|
26
|
+
* Utilities for applying Effect SQL migrations to MySQL databases through the
|
|
27
|
+
* mysql2-backed `SqlClient`.
|
|
28
|
+
*
|
|
29
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
30
|
+
* provides `run` and `layer` helpers for applying ordered migrations using the
|
|
31
|
+
* currently configured MySQL `SqlClient`. It is commonly used during application
|
|
32
|
+
* startup, in integration tests that provision a temporary schema, or in layer
|
|
33
|
+
* graphs where dependent services should not start until the database schema is
|
|
34
|
+
* current.
|
|
35
|
+
*
|
|
36
|
+
* Applied migrations are stored in `effect_sql_migrations` by default and use
|
|
37
|
+
* the shared `<id>_<name>` loader convention. Only migrations with ids greater
|
|
38
|
+
* than the latest recorded id are run. MySQL DDL can cause implicit commits, and
|
|
39
|
+
* this adapter relies on migration table constraints to detect concurrent
|
|
40
|
+
* runners, so coordinate startup runners and write migrations to tolerate
|
|
41
|
+
* MySQL's transactional semantics. Schema dump support is not enabled in this
|
|
42
|
+
* adapter, so `schemaDirectory` does not emit a MySQL dump.
|
|
43
|
+
*
|
|
9
44
|
* @since 4.0.0
|
|
10
45
|
*/
|
|
11
46
|
export * as MysqlMigrator from "./MysqlMigrator.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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,45 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
6
|
+
* MySQL client implementation for Effect SQL, backed by the `mysql2` driver.
|
|
7
|
+
*
|
|
8
|
+
* This module exposes constructors and layers for providing both the MySQL-specific
|
|
9
|
+
* `MysqlClient` service and the generic `SqlClient` service. It is intended for server
|
|
10
|
+
* applications, background workers, migrations, and tests that need Effect SQL query
|
|
11
|
+
* compilation, scoped resource management, streaming queries, and consistent `SqlError`
|
|
12
|
+
* classification for MySQL driver failures.
|
|
13
|
+
*
|
|
14
|
+
* Each client owns a scoped mysql2 pool, validates connectivity with `SELECT 1` during
|
|
15
|
+
* acquisition, and closes the pool when the surrounding scope is released. You can configure
|
|
16
|
+
* the pool from a connection URI or discrete connection fields; when `url` is supplied it
|
|
17
|
+
* takes precedence over the host, port, database, username, and password fields. Regular
|
|
18
|
+
* queries run through the shared pool, while transactions acquire a dedicated pooled
|
|
19
|
+
* connection for their lifetime, so long-running transactions and streams can occupy pool
|
|
20
|
+
* capacity. Size `maxConnections`, `connectionTTL`, and any mysql2 `poolConfig` with that in
|
|
21
|
+
* mind.
|
|
22
|
+
*
|
|
6
23
|
* @since 4.0.0
|
|
7
24
|
*/
|
|
8
25
|
export * as MysqlClient from "./MysqlClient.js";
|
|
9
26
|
/**
|
|
27
|
+
* Utilities for applying Effect SQL migrations to MySQL databases through the
|
|
28
|
+
* mysql2-backed `SqlClient`.
|
|
29
|
+
*
|
|
30
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
31
|
+
* provides `run` and `layer` helpers for applying ordered migrations using the
|
|
32
|
+
* currently configured MySQL `SqlClient`. It is commonly used during application
|
|
33
|
+
* startup, in integration tests that provision a temporary schema, or in layer
|
|
34
|
+
* graphs where dependent services should not start until the database schema is
|
|
35
|
+
* current.
|
|
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. MySQL DDL can cause implicit commits, and
|
|
40
|
+
* this adapter relies on migration table constraints to detect concurrent
|
|
41
|
+
* runners, so coordinate startup runners and write migrations to tolerate
|
|
42
|
+
* MySQL's transactional semantics. Schema dump support is not enabled in this
|
|
43
|
+
* adapter, so `schemaDirectory` does not emit a MySQL dump.
|
|
44
|
+
*
|
|
10
45
|
* @since 4.0.0
|
|
11
46
|
*/
|
|
12
47
|
export * as MysqlMigrator from "./MysqlMigrator.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MysqlClient","MysqlMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA
|
|
1
|
+
{"version":3,"file":"index.js","names":["MysqlClient","MysqlMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKA,WAAW,MAAM,kBAAkB;AAE/C;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKC,aAAa,MAAM,oBAAoB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-mysql2",
|
|
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 MySQL toolkit for Effect",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@testcontainers/mysql": "^11.14.0",
|
|
47
|
-
"effect": "^4.0.0-beta.
|
|
47
|
+
"effect": "^4.0.0-beta.68"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"effect": "^4.0.0-beta.
|
|
50
|
+
"effect": "^4.0.0-beta.68"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"mysql2": "^3.22.3"
|
package/src/MysqlClient.ts
CHANGED
|
@@ -145,7 +145,7 @@ const classifyError = (
|
|
|
145
145
|
/**
|
|
146
146
|
* Runtime type identifier used to mark `MysqlClient` values.
|
|
147
147
|
*
|
|
148
|
-
* @category type
|
|
148
|
+
* @category type IDs
|
|
149
149
|
* @since 4.0.0
|
|
150
150
|
*/
|
|
151
151
|
export const TypeId: TypeId = "~@effect/sql-mysql2/MysqlClient"
|
|
@@ -153,7 +153,7 @@ export const TypeId: TypeId = "~@effect/sql-mysql2/MysqlClient"
|
|
|
153
153
|
/**
|
|
154
154
|
* Type-level identifier used to mark `MysqlClient` values.
|
|
155
155
|
*
|
|
156
|
-
* @category type
|
|
156
|
+
* @category type IDs
|
|
157
157
|
* @since 4.0.0
|
|
158
158
|
*/
|
|
159
159
|
export type TypeId = "~@effect/sql-mysql2/MysqlClient"
|
package/src/MysqlMigrator.ts
CHANGED
|
@@ -33,7 +33,7 @@ export * from "effect/unstable/sql/Migrator"
|
|
|
33
33
|
/**
|
|
34
34
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
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,46 @@
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* MySQL client implementation for Effect SQL, backed by the `mysql2` driver.
|
|
9
|
+
*
|
|
10
|
+
* This module exposes constructors and layers for providing both the MySQL-specific
|
|
11
|
+
* `MysqlClient` service and the generic `SqlClient` service. It is intended for server
|
|
12
|
+
* applications, background workers, migrations, and tests that need Effect SQL query
|
|
13
|
+
* compilation, scoped resource management, streaming queries, and consistent `SqlError`
|
|
14
|
+
* classification for MySQL driver failures.
|
|
15
|
+
*
|
|
16
|
+
* Each client owns a scoped mysql2 pool, validates connectivity with `SELECT 1` during
|
|
17
|
+
* acquisition, and closes the pool when the surrounding scope is released. You can configure
|
|
18
|
+
* the pool from a connection URI or discrete connection fields; when `url` is supplied it
|
|
19
|
+
* takes precedence over the host, port, database, username, and password fields. Regular
|
|
20
|
+
* queries run through the shared pool, while transactions acquire a dedicated pooled
|
|
21
|
+
* connection for their lifetime, so long-running transactions and streams can occupy pool
|
|
22
|
+
* capacity. Size `maxConnections`, `connectionTTL`, and any mysql2 `poolConfig` with that in
|
|
23
|
+
* mind.
|
|
24
|
+
*
|
|
8
25
|
* @since 4.0.0
|
|
9
26
|
*/
|
|
10
27
|
export * as MysqlClient from "./MysqlClient.ts"
|
|
11
28
|
|
|
12
29
|
/**
|
|
30
|
+
* Utilities for applying Effect SQL migrations to MySQL databases through the
|
|
31
|
+
* mysql2-backed `SqlClient`.
|
|
32
|
+
*
|
|
33
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
34
|
+
* provides `run` and `layer` helpers for applying ordered migrations using the
|
|
35
|
+
* currently configured MySQL `SqlClient`. It is commonly used during application
|
|
36
|
+
* startup, in integration tests that provision a temporary schema, or in layer
|
|
37
|
+
* graphs where dependent services should not start until the database schema is
|
|
38
|
+
* current.
|
|
39
|
+
*
|
|
40
|
+
* Applied migrations are stored in `effect_sql_migrations` by default and use
|
|
41
|
+
* the shared `<id>_<name>` loader convention. Only migrations with ids greater
|
|
42
|
+
* than the latest recorded id are run. MySQL DDL can cause implicit commits, and
|
|
43
|
+
* this adapter relies on migration table constraints to detect concurrent
|
|
44
|
+
* runners, so coordinate startup runners and write migrations to tolerate
|
|
45
|
+
* MySQL's transactional semantics. Schema dump support is not enabled in this
|
|
46
|
+
* adapter, so `schemaDirectory` does not emit a MySQL dump.
|
|
47
|
+
*
|
|
13
48
|
* @since 4.0.0
|
|
14
49
|
*/
|
|
15
50
|
export * as MysqlMigrator from "./MysqlMigrator.ts"
|