pgsql-test 2.16.2 → 2.16.3

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/README.md CHANGED
@@ -60,7 +60,7 @@ Part of the [pgpm](https://pgpm.io) ecosystem, `pgsql-test` is built to pair sea
60
60
  * [Programmatic Seeding](#-programmatic-seeding)
61
61
  * [CSV Seeding](#️-csv-seeding)
62
62
  * [JSON Seeding](#️-json-seeding)
63
- * [LaunchQL Seeding](#-launchql-seeding)
63
+ * [pgpm Seeding](#-pgpm-seeding)
64
64
  7. [`getConnections() Options` ](#getconnections-options)
65
65
  8. [Disclaimer](#disclaimer)
66
66
 
@@ -241,9 +241,9 @@ This array lets you fully customize how your test database is seeded. You can co
241
241
  * [`seed.fn()`](#-programmatic-seeding) – Run JavaScript/TypeScript logic to programmatically insert data
242
242
  * [`seed.csv()`](#️-csv-seeding) – Load tabular data from CSV files
243
243
  * [`seed.json()`](#️-json-seeding) – Use in-memory objects as seed data
244
- * [`seed.launchql()`](#-launchql-seeding) – Apply a LaunchQL project or set of packages (compatible with sqitch)
244
+ * [`seed.loadPgpm()`](#-pgpm-seeding) – Apply a pgpm project or set of packages (compatible with sqitch)
245
245
 
246
- > ✨ **Default Behavior:** If no `SeedAdapter[]` is passed, LaunchQL seeding is assumed. This makes `pgsql-test` zero-config for LaunchQL-based projects.
246
+ > ✨ **Default Behavior:** If no `SeedAdapter[]` is passed, pgpm seeding is assumed. This makes `pgsql-test` zero-config for pgpm-based projects.
247
247
 
248
248
  This composable system allows you to mix-and-match data setup strategies for flexible, realistic, and fast database tests.
249
249
 
@@ -265,7 +265,7 @@ await db.loadCsv({ 'users': '/path/to/users.csv' });
265
265
  await db.loadSql(['/path/to/schema.sql']);
266
266
  ```
267
267
 
268
- > **Note:** `loadCsv()` and `loadLaunchql()` do not apply RLS context (PostgreSQL limitation). Use `loadJson()` or `loadSql()` for RLS-aware seeding.
268
+ > **Note:** `loadCsv()` and `loadPgpm()` do not apply RLS context (PostgreSQL limitation). Use `loadJson()` or `loadSql()` for RLS-aware seeding.
269
269
 
270
270
  ### 🔌 SQL File Seeding
271
271
 
@@ -506,32 +506,32 @@ it('has loaded rows', async () => {
506
506
 
507
507
  </details>
508
508
 
509
- ## 🚀 LaunchQL Seeding
509
+ ## 🚀 pgpm Seeding
510
510
 
511
511
  **Zero Configuration (Default):**
512
512
  ```ts
513
- // LaunchQL migrate is used automatically
513
+ // pgpm migrate is used automatically
514
514
  const { db, teardown } = await getConnections();
515
515
  ```
516
516
 
517
517
  **Adapter Pattern (Custom Path):**
518
518
  ```ts
519
519
  const { db, teardown } = await getConnections({}, [
520
- seed.launchql('/path/to/launchql', true) // with cache
520
+ seed.loadPgpm('/path/to/pgpm-workspace', true) // with cache
521
521
  ]);
522
522
  ```
523
523
 
524
524
  **Direct Load Method:**
525
525
  ```ts
526
- await db.loadLaunchql('/path/to/launchql', true); // with cache
526
+ await db.loadPpgm('/path/to/pgpm-workspace', true); // with cache
527
527
  ```
528
528
 
529
- > **Note:** LaunchQL deployment has its own client handling and does not apply RLS context.
529
+ > **Note:** pgpm deployment has its own client handling and does not apply RLS context.
530
530
 
531
531
  <details>
532
532
  <summary>Full example</summary>
533
533
 
534
- If your project uses LaunchQL modules with a precompiled `launchql.plan`, you can use `pgsql-test` with **zero configuration**. Just call `getConnections()` — and it *just works*:
534
+ If your project uses pgpm modules with a precompiled `pgpm.plan`, you can use `pgsql-test` with **zero configuration**. Just call `getConnections()` — and it *just works*:
535
535
 
536
536
  ```ts
537
537
  import { getConnections } from 'pgsql-test';
@@ -539,50 +539,39 @@ import { getConnections } from 'pgsql-test';
539
539
  let db, teardown;
540
540
 
541
541
  beforeAll(async () => {
542
- ({ db, teardown } = await getConnections()); // LaunchQL module is deployed automatically
542
+ ({ db, teardown } = await getConnections()); // pgpm module is deployed automatically
543
543
  });
544
544
  ```
545
545
 
546
- LaunchQL uses Sqitch-compatible syntax with a TypeScript-based migration engine. By default, `pgsql-test` automatically deploys any LaunchQL module found in the current working directory (`process.cwd()`).
546
+ pgpm uses Sqitch-compatible syntax with a TypeScript-based migration engine. By default, `pgsql-test` automatically deploys any pgpm module found in the current working directory (`process.cwd()`).
547
547
 
548
- To specify a custom path to your LaunchQL module, use `seed.launchql()` explicitly:
548
+ To specify a custom path to your pgpm module, use `seed.loadPgpm()` explicitly:
549
549
 
550
550
  ```ts
551
551
  import path from 'path';
552
552
  import { getConnections, seed } from 'pgsql-test';
553
553
 
554
- const cwd = path.resolve(__dirname, '../path/to/launchql');
554
+ const cwd = path.resolve(__dirname, '../path/to/pgpm-workspace');
555
555
 
556
556
  beforeAll(async () => {
557
557
  ({ db, teardown } = await getConnections({}, [
558
- seed.launchql(cwd)
558
+ seed.loadPgpm(cwd)
559
559
  ]));
560
560
  });
561
561
  ```
562
562
 
563
563
  </details>
564
564
 
565
- ## Why LaunchQL's Approach?
565
+ ## Why pgpm's Approach?
566
566
 
567
- LaunchQL provides the best of both worlds:
567
+ pgpm provides the best of both worlds:
568
568
 
569
569
  1. **Sqitch Compatibility**: Keep your familiar Sqitch syntax and migration approach
570
570
  2. **TypeScript Performance**: Our TS-rewritten deployment engine delivers up to 10x faster schema deployments
571
571
  3. **Developer Experience**: Tight feedback loops with near-instant schema setup for tests
572
572
  4. **CI Optimization**: Dramatically reduced test suite run times with optimized deployment
573
573
 
574
- By maintaining Sqitch compatibility while supercharging performance, LaunchQL enables you to keep your existing migration patterns while enjoying the speed benefits of our TypeScript engine.
575
-
576
- ## Why LaunchQL's Approach?
577
-
578
- LaunchQL provides the best of both worlds:
579
-
580
- 1. **Sqitch Compatibility**: Keep your familiar Sqitch syntax and migration approach
581
- 2. **TypeScript Performance**: Our TS-rewritten deployment engine delivers up to 10x faster schema deployments
582
- 3. **Developer Experience**: Tight feedback loops with near-instant schema setup for tests
583
- 4. **CI Optimization**: Dramatically reduced test suite run times with optimized deployment
584
-
585
- By maintaining Sqitch compatibility while supercharging performance, LaunchQL enables you to keep your existing migration patterns while enjoying the speed benefits of our TypeScript engine.
574
+ By maintaining Sqitch compatibility while supercharging performance, pgpm enables you to keep your existing migration patterns while enjoying the speed benefits of our TypeScript engine.
586
575
 
587
576
  ## `getConnections` Options
588
577
 
@@ -593,7 +582,7 @@ This table documents the available options for the `getConnections` function. Th
593
582
  | Option | Type | Default | Description |
594
583
  | ------------------------ | ---------- | ---------------- | --------------------------------------------------------------------------- |
595
584
  | `db.extensions` | `string[]` | `[]` | Array of PostgreSQL extensions to include in the test database |
596
- | `db.cwd` | `string` | `process.cwd()` | Working directory used for LaunchQL or Sqitch projects |
585
+ | `db.cwd` | `string` | `process.cwd()` | Working directory used for pgpm or Sqitch projects |
597
586
  | `db.connection.user` | `string` | `'app_user'` | User for simulating RLS via `setContext()` |
598
587
  | `db.connection.password` | `string` | `'app_password'` | Password for RLS test user |
599
588
  | `db.connection.role` | `string` | `'anonymous'` | Default role used during `setContext()` |
@@ -720,18 +709,18 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
720
709
 
721
710
  ### 🔁 Streaming & Uploads
722
711
 
712
+ * [etag-hash](https://github.com/constructive-io/constructive/tree/main/packages/etag-hash): **🏷️ S3-compatible ETags** created by streaming and hashing file uploads in chunks.
713
+ * [etag-stream](https://github.com/constructive-io/constructive/tree/main/packages/etag-stream): **🔄 ETag computation** via Node stream transformer during upload or transfer.
714
+ * [uuid-hash](https://github.com/constructive-io/constructive/tree/main/packages/uuid-hash): **🆔 Deterministic UUIDs** generated from hashed content, great for deduplication and asset referencing.
715
+ * [uuid-stream](https://github.com/constructive-io/constructive/tree/main/packages/uuid-stream): **🌊 Streaming UUID generation** based on piped file content—ideal for upload pipelines.
723
716
  * [launchql/s3-streamer](https://github.com/constructive-io/constructive/tree/main/packages/s3-streamer): **📤 Direct S3 streaming** for large files with support for metadata injection and content validation.
724
- * [launchql/etag-hash](https://github.com/constructive-io/constructive/tree/main/packages/etag-hash): **🏷️ S3-compatible ETags** created by streaming and hashing file uploads in chunks.
725
- * [launchql/etag-stream](https://github.com/constructive-io/constructive/tree/main/packages/etag-stream): **🔄 ETag computation** via Node stream transformer during upload or transfer.
726
- * [launchql/uuid-hash](https://github.com/constructive-io/constructive/tree/main/packages/uuid-hash): **🆔 Deterministic UUIDs** generated from hashed content, great for deduplication and asset referencing.
727
- * [launchql/uuid-stream](https://github.com/constructive-io/constructive/tree/main/packages/uuid-stream): **🌊 Streaming UUID generation** based on piped file content—ideal for upload pipelines.
728
717
  * [launchql/upload-names](https://github.com/constructive-io/constructive/tree/main/packages/upload-names): **📂 Collision-resistant filenames** utility for structured and unique file names for uploads.
729
718
 
730
719
  ### 🧰 CLI & Codegen
731
720
 
732
721
  * [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
733
722
  * [@launchql/cli](https://github.com/constructive-io/constructive/tree/main/packages/cli): **🖥️ Command-line toolkit** for managing LaunchQL projects—supports database scaffolding, migrations, seeding, code generation, and automation.
734
- * [constructive-io/constructive-gen](https://github.com/constructive-io/constructive/tree/main/packages/launchql-gen): **✨ Auto-generated GraphQL** mutations and queries dynamically built from introspected schema data.
723
+ * [launchql-gen](https://github.com/constructive-io/constructive/tree/main/packages/launchql-gen): **✨ Auto-generated GraphQL** mutations and queries dynamically built from introspected schema data.
735
724
  * [@launchql/query-builder](https://github.com/constructive-io/constructive/tree/main/packages/query-builder): **🏗️ SQL constructor** providing a robust TypeScript-based query builder for dynamic generation of `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and stored procedure calls—supports advanced SQL features like `JOIN`, `GROUP BY`, and schema-qualified queries.
736
725
  * [@launchql/query](https://github.com/constructive-io/constructive/tree/main/packages/query): **🧩 Fluent GraphQL builder** for PostGraphile schemas. ⚡ Schema-aware via introspection, 🧩 composable and ergonomic for building deeply nested queries.
737
726
 
package/connect.js CHANGED
@@ -33,7 +33,7 @@ const getConnOopts = (cn = {}) => {
33
33
  db: connect
34
34
  };
35
35
  };
36
- const getConnections = async (cn = {}, seedAdapters = [seed_1.seed.launchql()]) => {
36
+ const getConnections = async (cn = {}, seedAdapters = [seed_1.seed.pgpm()]) => {
37
37
  cn = getConnOopts(cn);
38
38
  const config = cn.pg;
39
39
  const connOpts = cn.db;
package/esm/connect.js CHANGED
@@ -29,7 +29,7 @@ const getConnOopts = (cn = {}) => {
29
29
  db: connect
30
30
  };
31
31
  };
32
- export const getConnections = async (cn = {}, seedAdapters = [seed.launchql()]) => {
32
+ export const getConnections = async (cn = {}, seedAdapters = [seed.pgpm()]) => {
33
33
  cn = getConnOopts(cn);
34
34
  const config = cn.pg;
35
35
  const connOpts = cn.db;
package/esm/seed/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { compose, fn, sqlfile } from './adapters';
2
2
  import { csv } from './csv';
3
3
  import { json } from './json';
4
- import { launchql } from './launchql';
4
+ import { pgpm } from './pgpm';
5
5
  export * from './csv';
6
6
  export * from './types';
7
7
  export const seed = {
8
- launchql,
8
+ pgpm,
9
9
  json,
10
10
  csv,
11
11
  compose,
@@ -1,12 +1,12 @@
1
1
  import { PgpmPackage } from '@pgpmjs/core';
2
2
  import { getEnvOptions } from '@pgpmjs/env';
3
3
  /**
4
- * Standalone helper function to deploy LaunchQL package
4
+ * Standalone helper function to deploy pgpm package
5
5
  * @param config - PostgreSQL configuration
6
6
  * @param cwd - Current working directory (defaults to process.cwd())
7
7
  * @param cache - Whether to enable caching (defaults to false)
8
8
  */
9
- export async function deployLaunchql(config, cwd, cache = false) {
9
+ export async function deployPgpm(config, cwd, cache = false) {
10
10
  const proj = new PgpmPackage(cwd ?? process.cwd());
11
11
  if (!proj.isInModule())
12
12
  return;
@@ -19,10 +19,10 @@ export async function deployLaunchql(config, cwd, cache = false) {
19
19
  }
20
20
  }), proj.getModuleName());
21
21
  }
22
- export function launchql(cwd, cache = false) {
22
+ export function pgpm(cwd, cache = false) {
23
23
  return {
24
24
  async seed(ctx) {
25
- await deployLaunchql(ctx.config, cwd ?? ctx.connect.cwd, cache);
25
+ await deployPgpm(ctx.config, cwd ?? ctx.connect.cwd, cache);
26
26
  }
27
27
  };
28
28
  }
@@ -4,7 +4,7 @@ import { generateContextStatements } from './context-utils';
4
4
  import { insertJson } from './seed/json';
5
5
  import { loadCsvMap } from './seed/csv';
6
6
  import { loadSqlFiles } from './seed/sql';
7
- import { deployLaunchql } from './seed/launchql';
7
+ import { deployPgpm } from './seed/pgpm';
8
8
  export class PgTestClient {
9
9
  config;
10
10
  client;
@@ -159,10 +159,10 @@ export class PgTestClient {
159
159
  // because POSTGRES doesn't support row-level security on COPY FROM...
160
160
  await loadCsvMap(this.client, tables);
161
161
  }
162
- async loadLaunchql(cwd, cache = false) {
162
+ async loadPgpm(cwd, cache = false) {
163
163
  // await this.ctxQuery(); // no point to call ctxQuery() here
164
- // because deployLaunchql() has it's own way of getting the client...
164
+ // because deployPgpm() has it's own way of getting the client...
165
165
  // so for now, we'll expose this but it's limited
166
- await deployLaunchql(this.config, cwd, cache);
166
+ await deployPgpm(this.config, cwd, cache);
167
167
  }
168
168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgsql-test",
3
- "version": "2.16.2",
3
+ "version": "2.16.3",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "pgsql-test offers isolated, role-aware, and rollback-friendly PostgreSQL environments for integration tests — giving developers realistic test coverage without external state pollution",
6
6
  "main": "index.js",
@@ -60,16 +60,16 @@
60
60
  "makage": "^0.1.8"
61
61
  },
62
62
  "dependencies": {
63
- "@pgpmjs/core": "^3.0.2",
64
- "@pgpmjs/env": "^2.8.0",
65
- "@pgpmjs/logger": "^1.3.1",
66
- "@pgpmjs/server-utils": "^2.8.2",
67
- "@pgpmjs/types": "^2.12.0",
63
+ "@pgpmjs/core": "^3.0.3",
64
+ "@pgpmjs/env": "^2.8.1",
65
+ "@pgpmjs/logger": "^1.3.2",
66
+ "@pgpmjs/server-utils": "^2.8.3",
67
+ "@pgpmjs/types": "^2.12.1",
68
68
  "csv-parse": "^6.1.0",
69
69
  "pg": "^8.16.3",
70
- "pg-cache": "^1.6.2",
70
+ "pg-cache": "^1.6.3",
71
71
  "pg-copy-streams": "^7.0.0",
72
72
  "pg-env": "^1.2.1"
73
73
  },
74
- "gitHead": "0f810b087435df60801bfa63d4f780e95acb6d02"
74
+ "gitHead": "52828c38b144fdc02b6a9a0c8b0ff795d1752d53"
75
75
  }
package/seed/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { compose, fn, sqlfile } from './adapters';
2
2
  import { csv } from './csv';
3
3
  import { json } from './json';
4
- import { launchql } from './launchql';
4
+ import { pgpm } from './pgpm';
5
5
  export * from './csv';
6
6
  export * from './types';
7
7
  export declare const seed: {
8
- launchql: typeof launchql;
8
+ pgpm: typeof pgpm;
9
9
  json: typeof json;
10
10
  csv: typeof csv;
11
11
  compose: typeof compose;
package/seed/index.js CHANGED
@@ -18,11 +18,11 @@ exports.seed = void 0;
18
18
  const adapters_1 = require("./adapters");
19
19
  const csv_1 = require("./csv");
20
20
  const json_1 = require("./json");
21
- const launchql_1 = require("./launchql");
21
+ const pgpm_1 = require("./pgpm");
22
22
  __exportStar(require("./csv"), exports);
23
23
  __exportStar(require("./types"), exports);
24
24
  exports.seed = {
25
- launchql: launchql_1.launchql,
25
+ pgpm: pgpm_1.pgpm,
26
26
  json: json_1.json,
27
27
  csv: csv_1.csv,
28
28
  compose: adapters_1.compose,
@@ -1,10 +1,10 @@
1
1
  import type { PgConfig } from 'pg-env';
2
2
  import { SeedAdapter } from './types';
3
3
  /**
4
- * Standalone helper function to deploy LaunchQL package
4
+ * Standalone helper function to deploy pgpm package
5
5
  * @param config - PostgreSQL configuration
6
6
  * @param cwd - Current working directory (defaults to process.cwd())
7
7
  * @param cache - Whether to enable caching (defaults to false)
8
8
  */
9
- export declare function deployLaunchql(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
10
- export declare function launchql(cwd?: string, cache?: boolean): SeedAdapter;
9
+ export declare function deployPgpm(config: PgConfig, cwd?: string, cache?: boolean): Promise<void>;
10
+ export declare function pgpm(cwd?: string, cache?: boolean): SeedAdapter;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deployLaunchql = deployLaunchql;
4
- exports.launchql = launchql;
3
+ exports.deployPgpm = deployPgpm;
4
+ exports.pgpm = pgpm;
5
5
  const core_1 = require("@pgpmjs/core");
6
6
  const env_1 = require("@pgpmjs/env");
7
7
  /**
8
- * Standalone helper function to deploy LaunchQL package
8
+ * Standalone helper function to deploy pgpm package
9
9
  * @param config - PostgreSQL configuration
10
10
  * @param cwd - Current working directory (defaults to process.cwd())
11
11
  * @param cache - Whether to enable caching (defaults to false)
12
12
  */
13
- async function deployLaunchql(config, cwd, cache = false) {
13
+ async function deployPgpm(config, cwd, cache = false) {
14
14
  const proj = new core_1.PgpmPackage(cwd ?? process.cwd());
15
15
  if (!proj.isInModule())
16
16
  return;
@@ -23,10 +23,10 @@ async function deployLaunchql(config, cwd, cache = false) {
23
23
  }
24
24
  }), proj.getModuleName());
25
25
  }
26
- function launchql(cwd, cache = false) {
26
+ function pgpm(cwd, cache = false) {
27
27
  return {
28
28
  async seed(ctx) {
29
- await deployLaunchql(ctx.config, cwd ?? ctx.connect.cwd, cache);
29
+ await deployPgpm(ctx.config, cwd ?? ctx.connect.cwd, cache);
30
30
  }
31
31
  };
32
32
  }
package/test-client.d.ts CHANGED
@@ -51,5 +51,5 @@ export declare class PgTestClient {
51
51
  loadJson(data: JsonSeedMap): Promise<void>;
52
52
  loadSql(files: string[]): Promise<void>;
53
53
  loadCsv(tables: CsvSeedMap): Promise<void>;
54
- loadLaunchql(cwd?: string, cache?: boolean): Promise<void>;
54
+ loadPgpm(cwd?: string, cache?: boolean): Promise<void>;
55
55
  }
package/test-client.js CHANGED
@@ -7,7 +7,7 @@ const context_utils_1 = require("./context-utils");
7
7
  const json_1 = require("./seed/json");
8
8
  const csv_1 = require("./seed/csv");
9
9
  const sql_1 = require("./seed/sql");
10
- const launchql_1 = require("./seed/launchql");
10
+ const pgpm_1 = require("./seed/pgpm");
11
11
  class PgTestClient {
12
12
  config;
13
13
  client;
@@ -162,11 +162,11 @@ class PgTestClient {
162
162
  // because POSTGRES doesn't support row-level security on COPY FROM...
163
163
  await (0, csv_1.loadCsvMap)(this.client, tables);
164
164
  }
165
- async loadLaunchql(cwd, cache = false) {
165
+ async loadPgpm(cwd, cache = false) {
166
166
  // await this.ctxQuery(); // no point to call ctxQuery() here
167
- // because deployLaunchql() has it's own way of getting the client...
167
+ // because deployPgpm() has it's own way of getting the client...
168
168
  // so for now, we'll expose this but it's limited
169
- await (0, launchql_1.deployLaunchql)(this.config, cwd, cache);
169
+ await (0, pgpm_1.deployPgpm)(this.config, cwd, cache);
170
170
  }
171
171
  }
172
172
  exports.PgTestClient = PgTestClient;