@constructive-io/graphql-codegen 4.15.2 → 4.15.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/core/generate.js
CHANGED
|
@@ -50,6 +50,7 @@ const fs = __importStar(require("node:fs"));
|
|
|
50
50
|
const node_path_1 = __importDefault(require("node:path"));
|
|
51
51
|
const graphql_1 = require("graphql");
|
|
52
52
|
const core_1 = require("@pgpmjs/core");
|
|
53
|
+
const pg_cache_1 = require("pg-cache");
|
|
53
54
|
const pgsql_client_1 = require("pgsql-client");
|
|
54
55
|
const pgsql_seed_1 = require("pgsql-seed");
|
|
55
56
|
const config_1 = require("../types/config");
|
|
@@ -681,6 +682,10 @@ async function generateMulti(options) {
|
|
|
681
682
|
finally {
|
|
682
683
|
for (const shared of sharedSources.values()) {
|
|
683
684
|
const keepDb = Object.values(configs).some((c) => c.db?.keepDb);
|
|
685
|
+
// Release pg-cache pool for this ephemeral database before dropping
|
|
686
|
+
// deployPgpm() caches connections that must be closed first
|
|
687
|
+
pg_cache_1.pgCache.delete(shared.ephemeralDb.config.database);
|
|
688
|
+
await pg_cache_1.pgCache.waitForDisposals();
|
|
684
689
|
shared.ephemeralDb.teardown({ keepDb });
|
|
685
690
|
}
|
|
686
691
|
}
|
|
@@ -136,6 +136,10 @@ class PgpmModuleSchemaSource {
|
|
|
136
136
|
return { introspection };
|
|
137
137
|
}
|
|
138
138
|
finally {
|
|
139
|
+
// Release pg-cache pool for this ephemeral database before dropping
|
|
140
|
+
// deployPgpm() and getPgPool() cache connections that must be closed first
|
|
141
|
+
pg_cache_1.pgCache.delete(dbConfig.database);
|
|
142
|
+
await pg_cache_1.pgCache.waitForDisposals();
|
|
139
143
|
// Clean up the ephemeral database
|
|
140
144
|
teardown({ keepDb });
|
|
141
145
|
if (keepDb) {
|
package/esm/core/generate.js
CHANGED
|
@@ -8,6 +8,7 @@ import * as fs from 'node:fs';
|
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { buildClientSchema, printSchema } from 'graphql';
|
|
10
10
|
import { PgpmPackage } from '@pgpmjs/core';
|
|
11
|
+
import { pgCache } from 'pg-cache';
|
|
11
12
|
import { createEphemeralDb } from 'pgsql-client';
|
|
12
13
|
import { deployPgpm } from 'pgsql-seed';
|
|
13
14
|
import { getConfigOptions } from '../types/config';
|
|
@@ -639,6 +640,10 @@ export async function generateMulti(options) {
|
|
|
639
640
|
finally {
|
|
640
641
|
for (const shared of sharedSources.values()) {
|
|
641
642
|
const keepDb = Object.values(configs).some((c) => c.db?.keepDb);
|
|
643
|
+
// Release pg-cache pool for this ephemeral database before dropping
|
|
644
|
+
// deployPgpm() caches connections that must be closed first
|
|
645
|
+
pgCache.delete(shared.ephemeralDb.config.database);
|
|
646
|
+
await pgCache.waitForDisposals();
|
|
642
647
|
shared.ephemeralDb.teardown({ keepDb });
|
|
643
648
|
}
|
|
644
649
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { PgpmPackage } from '@pgpmjs/core';
|
|
11
11
|
import { buildSchema, introspectionFromSchema } from 'graphql';
|
|
12
|
-
import { getPgPool } from 'pg-cache';
|
|
12
|
+
import { getPgPool, pgCache } from 'pg-cache';
|
|
13
13
|
import { createEphemeralDb } from 'pgsql-client';
|
|
14
14
|
import { deployPgpm } from 'pgsql-seed';
|
|
15
15
|
import { buildSchemaSDL } from 'graphile-schema';
|
|
@@ -131,6 +131,10 @@ export class PgpmModuleSchemaSource {
|
|
|
131
131
|
return { introspection };
|
|
132
132
|
}
|
|
133
133
|
finally {
|
|
134
|
+
// Release pg-cache pool for this ephemeral database before dropping
|
|
135
|
+
// deployPgpm() and getPgPool() cache connections that must be closed first
|
|
136
|
+
pgCache.delete(dbConfig.database);
|
|
137
|
+
await pgCache.waitForDisposals();
|
|
134
138
|
// Clean up the ephemeral database
|
|
135
139
|
teardown({ keepDb });
|
|
136
140
|
if (keepDb) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.3",
|
|
4
4
|
"description": "GraphQL SDK generator for Constructive databases with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"@0no-co/graphql.web": "^1.1.2",
|
|
57
57
|
"@babel/generator": "^7.29.1",
|
|
58
58
|
"@babel/types": "^7.29.0",
|
|
59
|
-
"@constructive-io/graphql-query": "^3.6.
|
|
59
|
+
"@constructive-io/graphql-query": "^3.6.5",
|
|
60
60
|
"@constructive-io/graphql-types": "^3.3.4",
|
|
61
61
|
"@inquirerer/utils": "^3.3.4",
|
|
62
|
-
"@pgpmjs/core": "^6.7.
|
|
62
|
+
"@pgpmjs/core": "^6.7.1",
|
|
63
63
|
"ajv": "^8.18.0",
|
|
64
64
|
"deepmerge": "^4.3.1",
|
|
65
65
|
"find-and-require-package-json": "^0.9.1",
|
|
66
66
|
"gql-ast": "^3.3.3",
|
|
67
|
-
"graphile-schema": "^1.6.
|
|
67
|
+
"graphile-schema": "^1.6.5",
|
|
68
68
|
"graphql": "16.13.0",
|
|
69
69
|
"inflekt": "^0.3.3",
|
|
70
70
|
"inquirerer": "^4.7.0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"oxfmt": "^0.40.0",
|
|
74
74
|
"pg-cache": "^3.3.4",
|
|
75
75
|
"pg-env": "^1.7.3",
|
|
76
|
-
"pgsql-client": "^3.5.
|
|
77
|
-
"pgsql-seed": "^2.5.
|
|
76
|
+
"pgsql-client": "^3.5.7",
|
|
77
|
+
"pgsql-seed": "^2.5.7",
|
|
78
78
|
"undici": "^7.24.3"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"tsx": "^4.21.0",
|
|
102
102
|
"typescript": "^5.9.3"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "c18ef8e002d958001fe69fff3758d1f89613eb2b"
|
|
105
105
|
}
|