@protobase/server 0.45.21 → 0.45.22
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/app-pool.d.ts +3 -1
- package/dist/app-pool.js +4 -1
- package/dist/package.js +1 -1
- package/package.json +4 -4
package/dist/app-pool.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type AppPoolConfig = {
|
|
|
9
9
|
connectionString: string;
|
|
10
10
|
max: number;
|
|
11
11
|
connectionTimeoutMillis: number;
|
|
12
|
+
allowExitOnIdle: true;
|
|
12
13
|
statement_timeout?: number;
|
|
13
14
|
types: {
|
|
14
15
|
getTypeParser: TypeParser;
|
|
@@ -34,7 +35,8 @@ export type PgModule<P extends PgPool> = {
|
|
|
34
35
|
* Whoever asks first opens it, and everyone in the process shares it, across a dev server's reloads too, until it ends;
|
|
35
36
|
* so the app never opens more connections than it may. Date and timestamp (without zone) come back as text, which the
|
|
36
37
|
* API formats itself, a dropped connection is printed rather than fatal, and a query waits at most `poolWaitMs` for a
|
|
37
|
-
* free connection.
|
|
38
|
+
* free connection. Idle connections keep no process alive, so a command exits when its work is done even while
|
|
39
|
+
* nobody ends the pool, such as one that sent no query of its own after Better Auth's schema check.
|
|
38
40
|
*/
|
|
39
41
|
export declare const appPool: <P extends PgPool>(pg: PgModule<P>, url: string, max?: number) => P;
|
|
40
42
|
/**
|
package/dist/app-pool.js
CHANGED
|
@@ -18,7 +18,8 @@ const store = globalThis;
|
|
|
18
18
|
* Whoever asks first opens it, and everyone in the process shares it, across a dev server's reloads too, until it ends;
|
|
19
19
|
* so the app never opens more connections than it may. Date and timestamp (without zone) come back as text, which the
|
|
20
20
|
* API formats itself, a dropped connection is printed rather than fatal, and a query waits at most `poolWaitMs` for a
|
|
21
|
-
* free connection.
|
|
21
|
+
* free connection. Idle connections keep no process alive, so a command exits when its work is done even while
|
|
22
|
+
* nobody ends the pool, such as one that sent no query of its own after Better Auth's schema check.
|
|
22
23
|
*/
|
|
23
24
|
const appPool = (pg, url, max = readDbConnections(globalThis.process?.env ?? {})) => {
|
|
24
25
|
const pools = store.__protobaseAppPools ??= /* @__PURE__ */ new Map();
|
|
@@ -32,6 +33,7 @@ const appPool = (pg, url, max = readDbConnections(globalThis.process?.env ?? {})
|
|
|
32
33
|
connectionString: url,
|
|
33
34
|
max,
|
|
34
35
|
connectionTimeoutMillis: poolWaitMs,
|
|
36
|
+
allowExitOnIdle: true,
|
|
35
37
|
types: textDates(pg)
|
|
36
38
|
}));
|
|
37
39
|
pools.set(url, {
|
|
@@ -50,6 +52,7 @@ const longQueryPool = (pg, url) => handleDroppedConnections(new pg.Pool({
|
|
|
50
52
|
connectionString: url,
|
|
51
53
|
max: 1,
|
|
52
54
|
connectionTimeoutMillis: longQueryTimeoutMs,
|
|
55
|
+
allowExitOnIdle: true,
|
|
53
56
|
statement_timeout: longQueryTimeoutMs,
|
|
54
57
|
types: textDates(pg)
|
|
55
58
|
}));
|
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/server",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.22",
|
|
4
4
|
"description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"@better-auth/passkey": "^1.7.12",
|
|
37
37
|
"@better-auth/sso": "^1.7.12",
|
|
38
38
|
"@modelcontextprotocol/server": "^2.3.1",
|
|
39
|
-
"@protobase/layout": "0.45.
|
|
40
|
-
"@protobase/query": "0.45.
|
|
41
|
-
"@protobase/schema": "0.45.
|
|
39
|
+
"@protobase/layout": "0.45.22",
|
|
40
|
+
"@protobase/query": "0.45.22",
|
|
41
|
+
"@protobase/schema": "0.45.22",
|
|
42
42
|
"@react-email/render": "^2.1.0",
|
|
43
43
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
44
44
|
"@sentry/core": "^11.7.0",
|