@effect/sql-pg 4.0.0-beta.67 → 4.0.0-beta.69
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/PgClient.d.ts +3 -3
- package/dist/PgClient.js +2 -2
- package/dist/PgMigrator.d.ts +1 -1
- package/dist/PgMigrator.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 +3 -3
- package/src/PgClient.ts +3 -3
- package/src/PgMigrator.ts +1 -1
- package/src/index.ts +37 -0
package/dist/PgClient.d.ts
CHANGED
|
@@ -18,14 +18,14 @@ import * as Pg from "pg";
|
|
|
18
18
|
/**
|
|
19
19
|
* Runtime type identifier used to mark `PgClient` values.
|
|
20
20
|
*
|
|
21
|
-
* @category type
|
|
21
|
+
* @category type IDs
|
|
22
22
|
* @since 4.0.0
|
|
23
23
|
*/
|
|
24
24
|
export declare const TypeId: TypeId;
|
|
25
25
|
/**
|
|
26
26
|
* Type-level identifier used to mark `PgClient` values.
|
|
27
27
|
*
|
|
28
|
-
* @category type
|
|
28
|
+
* @category type IDs
|
|
29
29
|
* @since 4.0.0
|
|
30
30
|
*/
|
|
31
31
|
export type TypeId = "~@effect/sql-pg/PgClient";
|
|
@@ -178,7 +178,7 @@ export declare const layer: (config: PgPoolConfig) => Layer.Layer<PgClient | Cli
|
|
|
178
178
|
/**
|
|
179
179
|
* Creates the PostgreSQL statement compiler, using `$1` placeholders, double-quoted identifiers, PostgreSQL returning clauses, and optional JSON value transformation.
|
|
180
180
|
*
|
|
181
|
-
* @category
|
|
181
|
+
* @category constructors
|
|
182
182
|
* @since 4.0.0
|
|
183
183
|
*/
|
|
184
184
|
export declare const makeCompiler: (transform?: (_: string) => string, transformJson?: boolean) => Statement.Compiler;
|
package/dist/PgClient.js
CHANGED
|
@@ -45,7 +45,7 @@ import Cursor from "pg-cursor";
|
|
|
45
45
|
/**
|
|
46
46
|
* Runtime type identifier used to mark `PgClient` values.
|
|
47
47
|
*
|
|
48
|
-
* @category type
|
|
48
|
+
* @category type IDs
|
|
49
49
|
* @since 4.0.0
|
|
50
50
|
*/
|
|
51
51
|
export const TypeId = "~@effect/sql-pg/PgClient";
|
|
@@ -511,7 +511,7 @@ export const layer = config => layerFrom(make(config));
|
|
|
511
511
|
/**
|
|
512
512
|
* Creates the PostgreSQL statement compiler, using `$1` placeholders, double-quoted identifiers, PostgreSQL returning clauses, and optional JSON value transformation.
|
|
513
513
|
*
|
|
514
|
-
* @category
|
|
514
|
+
* @category constructors
|
|
515
515
|
* @since 4.0.0
|
|
516
516
|
*/
|
|
517
517
|
export const makeCompiler = (transform, transformJson = true) => {
|
package/dist/PgMigrator.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
37
37
|
/**
|
|
38
38
|
* Runs PostgreSQL SQL migrations using the configured clients. Schema dumps use `pg_dump` and require child process, filesystem, and path services.
|
|
39
39
|
*
|
|
40
|
-
* @category
|
|
40
|
+
* @category constructors
|
|
41
41
|
* @since 4.0.0
|
|
42
42
|
*/
|
|
43
43
|
export declare const run: <R2 = never>(options: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, SqlClient | PgClient | ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem | Path.Path | R2>;
|
package/dist/PgMigrator.js
CHANGED
|
@@ -37,7 +37,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
37
37
|
/**
|
|
38
38
|
* Runs PostgreSQL SQL migrations using the configured clients. Schema dumps use `pg_dump` and require child process, filesystem, and path services.
|
|
39
39
|
*
|
|
40
|
-
* @category
|
|
40
|
+
* @category constructors
|
|
41
41
|
* @since 4.0.0
|
|
42
42
|
*/
|
|
43
43
|
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
|
+
* PostgreSQL client implementation for Effect SQL, backed by `pg`.
|
|
6
|
+
*
|
|
7
|
+
* This module exposes constructors for creating a scoped `PgClient` from a
|
|
8
|
+
* managed `pg` pool, a single managed `pg` client, or lower-level connection
|
|
9
|
+
* acquirers. The resulting service can be provided as both `PgClient` and the
|
|
10
|
+
* generic `SqlClient`, and is intended for application database access,
|
|
11
|
+
* migrations, transactional workflows, row streaming, JSON parameters, and
|
|
12
|
+
* PostgreSQL LISTEN/NOTIFY integration.
|
|
13
|
+
*
|
|
14
|
+
* Pool-backed clients acquire connections per operation and reserve dedicated
|
|
15
|
+
* connections for transactions and cursor streams. Clients built from one
|
|
16
|
+
* `pg.Client` serialize shared access; enable `acquireForStream` when streams
|
|
17
|
+
* or listeners need their own client instead of sharing the query connection.
|
|
18
|
+
* LISTEN uses a scoped long-lived client and automatically issues `UNLISTEN`
|
|
19
|
+
* when the stream scope closes, so listeners should be scoped for as long as
|
|
20
|
+
* notifications are needed.
|
|
21
|
+
*
|
|
5
22
|
* @since 4.0.0
|
|
6
23
|
*/
|
|
7
24
|
export * as PgClient from "./PgClient.ts";
|
|
8
25
|
/**
|
|
26
|
+
* Utilities for applying Effect SQL migrations to PostgreSQL databases.
|
|
27
|
+
*
|
|
28
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
29
|
+
* provides `run` and `layer` helpers for applying ordered migrations through
|
|
30
|
+
* the current PostgreSQL `SqlClient` and `PgClient`. It is typically used at
|
|
31
|
+
* application startup, during deployment, in integration tests that provision a
|
|
32
|
+
* temporary PostgreSQL database, or in layer graphs that must prepare the
|
|
33
|
+
* schema before dependent services are acquired.
|
|
34
|
+
*
|
|
35
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
36
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
37
|
+
* with an id greater than the latest recorded id are applied, so concurrent
|
|
38
|
+
* application instances should coordinate startup against the same database and
|
|
39
|
+
* avoid racing to install the same changes. When `schemaDirectory` is enabled,
|
|
40
|
+
* this adapter shells out to `pg_dump` using the active `PgClient`
|
|
41
|
+
* configuration, so `pg_dump` must be available on `PATH` and the layer must
|
|
42
|
+
* provide child process, filesystem, and path services. The generated dumps
|
|
43
|
+
* intentionally strip comments, session settings, ownership, and privilege
|
|
44
|
+
* statements to keep schema snapshots portable across PostgreSQL environments.
|
|
45
|
+
*
|
|
9
46
|
* @since 4.0.0
|
|
10
47
|
*/
|
|
11
48
|
export * as PgMigrator from "./PgMigrator.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,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,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
|
+
* PostgreSQL client implementation for Effect SQL, backed by `pg`.
|
|
7
|
+
*
|
|
8
|
+
* This module exposes constructors for creating a scoped `PgClient` from a
|
|
9
|
+
* managed `pg` pool, a single managed `pg` client, or lower-level connection
|
|
10
|
+
* acquirers. The resulting service can be provided as both `PgClient` and the
|
|
11
|
+
* generic `SqlClient`, and is intended for application database access,
|
|
12
|
+
* migrations, transactional workflows, row streaming, JSON parameters, and
|
|
13
|
+
* PostgreSQL LISTEN/NOTIFY integration.
|
|
14
|
+
*
|
|
15
|
+
* Pool-backed clients acquire connections per operation and reserve dedicated
|
|
16
|
+
* connections for transactions and cursor streams. Clients built from one
|
|
17
|
+
* `pg.Client` serialize shared access; enable `acquireForStream` when streams
|
|
18
|
+
* or listeners need their own client instead of sharing the query connection.
|
|
19
|
+
* LISTEN uses a scoped long-lived client and automatically issues `UNLISTEN`
|
|
20
|
+
* when the stream scope closes, so listeners should be scoped for as long as
|
|
21
|
+
* notifications are needed.
|
|
22
|
+
*
|
|
6
23
|
* @since 4.0.0
|
|
7
24
|
*/
|
|
8
25
|
export * as PgClient from "./PgClient.js";
|
|
9
26
|
/**
|
|
27
|
+
* Utilities for applying Effect SQL migrations to PostgreSQL databases.
|
|
28
|
+
*
|
|
29
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
30
|
+
* provides `run` and `layer` helpers for applying ordered migrations through
|
|
31
|
+
* the current PostgreSQL `SqlClient` and `PgClient`. It is typically used at
|
|
32
|
+
* application startup, during deployment, in integration tests that provision a
|
|
33
|
+
* temporary PostgreSQL database, or in layer graphs that must prepare the
|
|
34
|
+
* schema before dependent services are acquired.
|
|
35
|
+
*
|
|
36
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
37
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
38
|
+
* with an id greater than the latest recorded id are applied, so concurrent
|
|
39
|
+
* application instances should coordinate startup against the same database and
|
|
40
|
+
* avoid racing to install the same changes. When `schemaDirectory` is enabled,
|
|
41
|
+
* this adapter shells out to `pg_dump` using the active `PgClient`
|
|
42
|
+
* configuration, so `pg_dump` must be available on `PATH` and the layer must
|
|
43
|
+
* provide child process, filesystem, and path services. The generated dumps
|
|
44
|
+
* intentionally strip comments, session settings, ownership, and privilege
|
|
45
|
+
* statements to keep schema snapshots portable across PostgreSQL environments.
|
|
46
|
+
*
|
|
10
47
|
* @since 4.0.0
|
|
11
48
|
*/
|
|
12
49
|
export * as PgMigrator from "./PgMigrator.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PgClient","PgMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA
|
|
1
|
+
{"version":3,"file":"index.js","names":["PgClient","PgMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKA,QAAQ,MAAM,eAAe;AAEzC;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKC,UAAU,MAAM,iBAAiB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-pg",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.69",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A PostgreSQL toolkit for Effect",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@testcontainers/postgresql": "^11.14.0",
|
|
47
47
|
"@types/pg": "^8.20.0",
|
|
48
48
|
"@types/pg-cursor": "^2.7.2",
|
|
49
|
-
"effect": "^4.0.0-beta.
|
|
49
|
+
"effect": "^4.0.0-beta.69"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"effect": "^4.0.0-beta.
|
|
52
|
+
"effect": "^4.0.0-beta.69"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"pg": "^8.20.0",
|
package/src/PgClient.ts
CHANGED
|
@@ -64,7 +64,7 @@ import Cursor from "pg-cursor"
|
|
|
64
64
|
/**
|
|
65
65
|
* Runtime type identifier used to mark `PgClient` values.
|
|
66
66
|
*
|
|
67
|
-
* @category type
|
|
67
|
+
* @category type IDs
|
|
68
68
|
* @since 4.0.0
|
|
69
69
|
*/
|
|
70
70
|
export const TypeId: TypeId = "~@effect/sql-pg/PgClient"
|
|
@@ -72,7 +72,7 @@ export const TypeId: TypeId = "~@effect/sql-pg/PgClient"
|
|
|
72
72
|
/**
|
|
73
73
|
* Type-level identifier used to mark `PgClient` values.
|
|
74
74
|
*
|
|
75
|
-
* @category type
|
|
75
|
+
* @category type IDs
|
|
76
76
|
* @since 4.0.0
|
|
77
77
|
*/
|
|
78
78
|
export type TypeId = "~@effect/sql-pg/PgClient"
|
|
@@ -810,7 +810,7 @@ export const layer = (
|
|
|
810
810
|
/**
|
|
811
811
|
* Creates the PostgreSQL statement compiler, using `$1` placeholders, double-quoted identifiers, PostgreSQL returning clauses, and optional JSON value transformation.
|
|
812
812
|
*
|
|
813
|
-
* @category
|
|
813
|
+
* @category constructors
|
|
814
814
|
* @since 4.0.0
|
|
815
815
|
*/
|
|
816
816
|
export const makeCompiler = (
|
package/src/PgMigrator.ts
CHANGED
|
@@ -41,7 +41,7 @@ export * from "effect/unstable/sql/Migrator"
|
|
|
41
41
|
/**
|
|
42
42
|
* Runs PostgreSQL SQL migrations using the configured clients. Schema dumps use `pg_dump` and require child process, filesystem, and path services.
|
|
43
43
|
*
|
|
44
|
-
* @category
|
|
44
|
+
* @category constructors
|
|
45
45
|
* @since 4.0.0
|
|
46
46
|
*/
|
|
47
47
|
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
|
+
* PostgreSQL client implementation for Effect SQL, backed by `pg`.
|
|
9
|
+
*
|
|
10
|
+
* This module exposes constructors for creating a scoped `PgClient` from a
|
|
11
|
+
* managed `pg` pool, a single managed `pg` client, or lower-level connection
|
|
12
|
+
* acquirers. The resulting service can be provided as both `PgClient` and the
|
|
13
|
+
* generic `SqlClient`, and is intended for application database access,
|
|
14
|
+
* migrations, transactional workflows, row streaming, JSON parameters, and
|
|
15
|
+
* PostgreSQL LISTEN/NOTIFY integration.
|
|
16
|
+
*
|
|
17
|
+
* Pool-backed clients acquire connections per operation and reserve dedicated
|
|
18
|
+
* connections for transactions and cursor streams. Clients built from one
|
|
19
|
+
* `pg.Client` serialize shared access; enable `acquireForStream` when streams
|
|
20
|
+
* or listeners need their own client instead of sharing the query connection.
|
|
21
|
+
* LISTEN uses a scoped long-lived client and automatically issues `UNLISTEN`
|
|
22
|
+
* when the stream scope closes, so listeners should be scoped for as long as
|
|
23
|
+
* notifications are needed.
|
|
24
|
+
*
|
|
8
25
|
* @since 4.0.0
|
|
9
26
|
*/
|
|
10
27
|
export * as PgClient from "./PgClient.ts"
|
|
11
28
|
|
|
12
29
|
/**
|
|
30
|
+
* Utilities for applying Effect SQL migrations to PostgreSQL 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 PostgreSQL `SqlClient` and `PgClient`. It is typically used at
|
|
35
|
+
* application startup, during deployment, in integration tests that provision a
|
|
36
|
+
* temporary PostgreSQL database, or in layer graphs that must prepare the
|
|
37
|
+
* schema before dependent services are acquired.
|
|
38
|
+
*
|
|
39
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
40
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
41
|
+
* with an id greater than the latest recorded id are applied, so concurrent
|
|
42
|
+
* application instances should coordinate startup against the same database and
|
|
43
|
+
* avoid racing to install the same changes. When `schemaDirectory` is enabled,
|
|
44
|
+
* this adapter shells out to `pg_dump` using the active `PgClient`
|
|
45
|
+
* configuration, so `pg_dump` must be available on `PATH` and the layer must
|
|
46
|
+
* provide child process, filesystem, and path services. The generated dumps
|
|
47
|
+
* intentionally strip comments, session settings, ownership, and privilege
|
|
48
|
+
* statements to keep schema snapshots portable across PostgreSQL environments.
|
|
49
|
+
*
|
|
13
50
|
* @since 4.0.0
|
|
14
51
|
*/
|
|
15
52
|
export * as PgMigrator from "./PgMigrator.ts"
|