@prisma-next/postgres 0.6.0-dev.3 → 0.6.0-dev.5

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.
@@ -0,0 +1,20 @@
1
+ import { ControlClient, ControlClientOptions } from "@prisma-next/cli/control-api";
2
+
3
+ //#region src/exports/control.d.ts
4
+ interface PostgresControlClientOptions {
5
+ /**
6
+ * Default Postgres connection string. When set, operations like `dbInit`
7
+ * auto-connect without an explicit `connect()` call. Equivalent to the
8
+ * `connection` field on the underlying `ControlClientOptions`.
9
+ */
10
+ readonly connection?: string;
11
+ /**
12
+ * Composed extension descriptors. Pass the same descriptors here that
13
+ * the contract was authored against.
14
+ */
15
+ readonly extensionPacks?: ControlClientOptions['extensionPacks'];
16
+ }
17
+ declare function createPostgresControlClient(options?: PostgresControlClientOptions): ControlClient;
18
+ //#endregion
19
+ export { type ControlClient, PostgresControlClientOptions, createPostgresControlClient };
20
+ //# sourceMappingURL=control.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/exports/control.ts"],"mappings":";;;UAoBiB,4BAAA;EAW+B;;AAGhD;;;EAHgD,SALrC,UAAA;EASA;;;;EAAA,SAJA,cAAA,GAAiB,oBAAA;AAAA;AAAA,iBAGZ,2BAAA,CACd,OAAA,GAAS,4BAAA,GACR,aAAA"}
@@ -0,0 +1,29 @@
1
+ import postgresAdapter from "@prisma-next/adapter-postgres/control";
2
+ import postgresDriver from "@prisma-next/driver-postgres/control";
3
+ import sql from "@prisma-next/family-sql/control";
4
+ import postgres from "@prisma-next/target-postgres/control";
5
+ import { ifDefined } from "@prisma-next/utils/defined";
6
+ import { createControlClient } from "@prisma-next/cli/control-api";
7
+ //#region src/exports/control.ts
8
+ /**
9
+ * Control-API facade for Postgres.
10
+ *
11
+ * Collapses the five-package wiring required to drive control-side
12
+ * operations (`dbInit`, `dbUpdate`, `dbVerify`, `migrationApply`, …) into
13
+ * a single `createPostgresControlClient()` call. Mirrors what
14
+ * `@prisma-next/postgres/runtime` did for the query side.
15
+ */
16
+ function createPostgresControlClient(options = {}) {
17
+ return createControlClient({
18
+ family: sql,
19
+ target: postgres,
20
+ adapter: postgresAdapter,
21
+ driver: postgresDriver,
22
+ ...ifDefined("connection", options.connection),
23
+ ...ifDefined("extensionPacks", options.extensionPacks)
24
+ });
25
+ }
26
+ //#endregion
27
+ export { createPostgresControlClient };
28
+
29
+ //# sourceMappingURL=control.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../src/exports/control.ts"],"sourcesContent":["/**\n * Control-API facade for Postgres.\n *\n * Collapses the five-package wiring required to drive control-side\n * operations (`dbInit`, `dbUpdate`, `dbVerify`, `migrationApply`, …) into\n * a single `createPostgresControlClient()` call. Mirrors what\n * `@prisma-next/postgres/runtime` did for the query side.\n */\n\nimport postgresAdapter from '@prisma-next/adapter-postgres/control';\nimport {\n type ControlClient,\n type ControlClientOptions,\n createControlClient,\n} from '@prisma-next/cli/control-api';\nimport postgresDriver from '@prisma-next/driver-postgres/control';\nimport sql from '@prisma-next/family-sql/control';\nimport postgres from '@prisma-next/target-postgres/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\n\nexport interface PostgresControlClientOptions {\n /**\n * Default Postgres connection string. When set, operations like `dbInit`\n * auto-connect without an explicit `connect()` call. Equivalent to the\n * `connection` field on the underlying `ControlClientOptions`.\n */\n readonly connection?: string;\n /**\n * Composed extension descriptors. Pass the same descriptors here that\n * the contract was authored against.\n */\n readonly extensionPacks?: ControlClientOptions['extensionPacks'];\n}\n\nexport function createPostgresControlClient(\n options: PostgresControlClientOptions = {},\n): ControlClient {\n const clientOptions: ControlClientOptions = {\n family: sql,\n target: postgres,\n adapter: postgresAdapter,\n driver: postgresDriver,\n ...ifDefined('connection', options.connection),\n ...ifDefined('extensionPacks', options.extensionPacks),\n };\n return createControlClient(clientOptions);\n}\n\nexport type { ControlClient };\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,SAAgB,4BACd,UAAwC,EAAE,EAC3B;CASf,OAAO,oBAAoB;EAPzB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,GAAG,UAAU,cAAc,QAAQ,WAAW;EAC9C,GAAG,UAAU,kBAAkB,QAAQ,eAAe;EAEhB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma-next/postgres",
3
- "version": "0.6.0-dev.3",
3
+ "version": "0.6.0-dev.5",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -8,21 +8,22 @@
8
8
  "dependencies": {
9
9
  "pathe": "^2.0.3",
10
10
  "pg": "8.20.0",
11
- "@prisma-next/config": "0.6.0-dev.3",
12
- "@prisma-next/contract": "0.6.0-dev.3",
13
- "@prisma-next/family-sql": "0.6.0-dev.3",
14
- "@prisma-next/adapter-postgres": "0.6.0-dev.3",
15
- "@prisma-next/framework-components": "0.6.0-dev.3",
16
- "@prisma-next/sql-contract": "0.6.0-dev.3",
17
- "@prisma-next/driver-postgres": "0.6.0-dev.3",
18
- "@prisma-next/sql-contract-psl": "0.6.0-dev.3",
19
- "@prisma-next/sql-builder": "0.6.0-dev.3",
20
- "@prisma-next/sql-contract-ts": "0.6.0-dev.3",
21
- "@prisma-next/sql-orm-client": "0.6.0-dev.3",
22
- "@prisma-next/sql-relational-core": "0.6.0-dev.3",
23
- "@prisma-next/sql-runtime": "0.6.0-dev.3",
24
- "@prisma-next/utils": "0.6.0-dev.3",
25
- "@prisma-next/target-postgres": "0.6.0-dev.3"
11
+ "@prisma-next/config": "0.6.0-dev.5",
12
+ "@prisma-next/cli": "0.6.0-dev.5",
13
+ "@prisma-next/adapter-postgres": "0.6.0-dev.5",
14
+ "@prisma-next/contract": "0.6.0-dev.5",
15
+ "@prisma-next/driver-postgres": "0.6.0-dev.5",
16
+ "@prisma-next/sql-contract-psl": "0.6.0-dev.5",
17
+ "@prisma-next/family-sql": "0.6.0-dev.5",
18
+ "@prisma-next/sql-contract": "0.6.0-dev.5",
19
+ "@prisma-next/sql-contract-ts": "0.6.0-dev.5",
20
+ "@prisma-next/sql-orm-client": "0.6.0-dev.5",
21
+ "@prisma-next/sql-builder": "0.6.0-dev.5",
22
+ "@prisma-next/sql-relational-core": "0.6.0-dev.5",
23
+ "@prisma-next/sql-runtime": "0.6.0-dev.5",
24
+ "@prisma-next/utils": "0.6.0-dev.5",
25
+ "@prisma-next/framework-components": "0.6.0-dev.5",
26
+ "@prisma-next/target-postgres": "0.6.0-dev.5"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/pg": "8.20.0",
@@ -48,6 +49,7 @@
48
49
  "exports": {
49
50
  "./config": "./dist/config.mjs",
50
51
  "./contract-builder": "./dist/contract-builder.mjs",
52
+ "./control": "./dist/control.mjs",
51
53
  "./family": "./dist/family.mjs",
52
54
  "./runtime": "./dist/runtime.mjs",
53
55
  "./serverless": "./dist/serverless.mjs",
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Control-API facade for Postgres.
3
+ *
4
+ * Collapses the five-package wiring required to drive control-side
5
+ * operations (`dbInit`, `dbUpdate`, `dbVerify`, `migrationApply`, …) into
6
+ * a single `createPostgresControlClient()` call. Mirrors what
7
+ * `@prisma-next/postgres/runtime` did for the query side.
8
+ */
9
+
10
+ import postgresAdapter from '@prisma-next/adapter-postgres/control';
11
+ import {
12
+ type ControlClient,
13
+ type ControlClientOptions,
14
+ createControlClient,
15
+ } from '@prisma-next/cli/control-api';
16
+ import postgresDriver from '@prisma-next/driver-postgres/control';
17
+ import sql from '@prisma-next/family-sql/control';
18
+ import postgres from '@prisma-next/target-postgres/control';
19
+ import { ifDefined } from '@prisma-next/utils/defined';
20
+
21
+ export interface PostgresControlClientOptions {
22
+ /**
23
+ * Default Postgres connection string. When set, operations like `dbInit`
24
+ * auto-connect without an explicit `connect()` call. Equivalent to the
25
+ * `connection` field on the underlying `ControlClientOptions`.
26
+ */
27
+ readonly connection?: string;
28
+ /**
29
+ * Composed extension descriptors. Pass the same descriptors here that
30
+ * the contract was authored against.
31
+ */
32
+ readonly extensionPacks?: ControlClientOptions['extensionPacks'];
33
+ }
34
+
35
+ export function createPostgresControlClient(
36
+ options: PostgresControlClientOptions = {},
37
+ ): ControlClient {
38
+ const clientOptions: ControlClientOptions = {
39
+ family: sql,
40
+ target: postgres,
41
+ adapter: postgresAdapter,
42
+ driver: postgresDriver,
43
+ ...ifDefined('connection', options.connection),
44
+ ...ifDefined('extensionPacks', options.extensionPacks),
45
+ };
46
+ return createControlClient(clientOptions);
47
+ }
48
+
49
+ export type { ControlClient };