void 0.8.8 → 0.8.9
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.
|
@@ -2,5 +2,11 @@ import { MigrationEntry } from "./migration-handler.mjs";
|
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/migration-handler-pg.d.ts
|
|
4
4
|
declare function createMigrationHandler(env: Record<string, unknown>, migrations: Array<MigrationEntry>, _dialect: "sqlite" | "postgresql", runAuthMigrations?: () => Promise<void>): (request: Request) => Promise<Response>;
|
|
5
|
+
/**
|
|
6
|
+
* `pg` falls back to `pgpass` when no password is present in the connection
|
|
7
|
+
* config and the server requests one. Workers have no pgpass file, and the
|
|
8
|
+
* Node fs/path polyfills can throw before `pg` reports the auth failure.
|
|
9
|
+
*/
|
|
10
|
+
declare function disablePgPassFallback(client: unknown): void;
|
|
5
11
|
//#endregion
|
|
6
|
-
export { createMigrationHandler };
|
|
12
|
+
export { createMigrationHandler, disablePgPassFallback };
|
|
@@ -29,6 +29,7 @@ async function runPgMigrations(env, migrations) {
|
|
|
29
29
|
};
|
|
30
30
|
const { Client } = await import("pg");
|
|
31
31
|
const client = new Client({ connectionString: hyperdrive.connectionString });
|
|
32
|
+
disablePgPassFallback(client);
|
|
32
33
|
await client.connect();
|
|
33
34
|
try {
|
|
34
35
|
await client.query(`CREATE TABLE IF NOT EXISTS _void_migrations (
|
|
@@ -81,5 +82,18 @@ async function runPgMigrations(env, migrations) {
|
|
|
81
82
|
await client.end();
|
|
82
83
|
}
|
|
83
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* `pg` falls back to `pgpass` when no password is present in the connection
|
|
87
|
+
* config and the server requests one. Workers have no pgpass file, and the
|
|
88
|
+
* Node fs/path polyfills can throw before `pg` reports the auth failure.
|
|
89
|
+
*/
|
|
90
|
+
function disablePgPassFallback(client) {
|
|
91
|
+
const pgClient = client;
|
|
92
|
+
if (pgClient.password == null) {
|
|
93
|
+
const noPassword = async () => void 0;
|
|
94
|
+
pgClient.password = noPassword;
|
|
95
|
+
if (pgClient.connectionParameters) pgClient.connectionParameters.password = noPassword;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
84
98
|
//#endregion
|
|
85
|
-
export { createMigrationHandler };
|
|
99
|
+
export { createMigrationHandler, disablePgPassFallback };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "void",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"valibot": ">=1.0.0-beta.7",
|
|
334
334
|
"vite": "^8.0.0",
|
|
335
335
|
"zod": "^3.25.0 || ^4.0.0",
|
|
336
|
-
"@void/md": "0.8.
|
|
336
|
+
"@void/md": "0.8.9"
|
|
337
337
|
},
|
|
338
338
|
"peerDependenciesMeta": {
|
|
339
339
|
"@void/md": {
|