@parlor/data 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +15 -2
- package/dist/database.d.ts +24 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +107 -0
- package/dist/database.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cychien
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @parlor/data
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The app's PostgreSQL database through Drizzle: embedded PGlite in development, `DATABASE_URL` in production, migrations applied on start.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @parlor/data drizzle-orm
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createDatabase } from "@parlor/data";
|
|
11
|
+
|
|
12
|
+
const database = await createDatabase({ migrationsFolder: "migrations" });
|
|
13
|
+
const rows = await database.db.execute("select 1");
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Docs: https://cychien.github.io/parlor/guides/data/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DataProvider, ListenOptions, Unlisten } from "@parlor/core";
|
|
2
|
+
import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
|
|
3
|
+
export type Database = PgDatabase<PgQueryResultHKT>;
|
|
4
|
+
declare module "@parlor/core" {
|
|
5
|
+
interface DataRegister {
|
|
6
|
+
database: Database;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export interface DatabaseOptions {
|
|
10
|
+
readonly url?: string | undefined;
|
|
11
|
+
readonly dataDir?: string | undefined;
|
|
12
|
+
readonly migrationsFolder?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface DatabaseHandle extends DataProvider<Database> {
|
|
15
|
+
readonly db: Database;
|
|
16
|
+
readonly driver: "pglite" | "node-postgres";
|
|
17
|
+
listen(channel: string, handler: (payload: string) => void, options?: ListenOptions): Promise<Unlisten>;
|
|
18
|
+
migrate(folder: string): Promise<void>;
|
|
19
|
+
close(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_PGLITE_DIR = ".parlor/pglite";
|
|
22
|
+
export declare function resolveDatabaseUrl(env?: NodeJS.ProcessEnv): string | undefined;
|
|
23
|
+
export declare function createDatabase(options?: DatabaseOptions): Promise<DatabaseHandle>;
|
|
24
|
+
//# sourceMappingURL=database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAKxE,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEpD,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,YAAY;QACpB,QAAQ,EAAE,QAAQ,CAAC;KACpB;CACF;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,QAAQ,CAAC;IAC5D,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,eAAe,CAAC;IAC5C,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAClC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AAEnD,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAEpB;AAqFD,wBAAsB,cAAc,CAClC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,cAAc,CAAC,CAOzB"}
|
package/dist/database.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
import { PGlite } from "@electric-sql/pglite";
|
|
4
|
+
import { drizzle as drizzlePg } from "drizzle-orm/node-postgres";
|
|
5
|
+
import { migrate as migratePg } from "drizzle-orm/node-postgres/migrator";
|
|
6
|
+
import { drizzle as drizzlePglite } from "drizzle-orm/pglite";
|
|
7
|
+
import { migrate as migratePglite } from "drizzle-orm/pglite/migrator";
|
|
8
|
+
import pg from "pg";
|
|
9
|
+
export const DEFAULT_PGLITE_DIR = ".parlor/pglite";
|
|
10
|
+
export function resolveDatabaseUrl(env = process.env) {
|
|
11
|
+
return env.DATABASE_URL || undefined;
|
|
12
|
+
}
|
|
13
|
+
function once(run) {
|
|
14
|
+
let result;
|
|
15
|
+
return () => (result ??= run());
|
|
16
|
+
}
|
|
17
|
+
function pgliteHandle(dataDir) {
|
|
18
|
+
const client = new PGlite(dataDir);
|
|
19
|
+
const db = drizzlePglite(client);
|
|
20
|
+
return {
|
|
21
|
+
db,
|
|
22
|
+
driver: "pglite",
|
|
23
|
+
read: () => db,
|
|
24
|
+
transaction: (run) => db.transaction((tx) => run(tx)),
|
|
25
|
+
listen: async (channel, handler) => {
|
|
26
|
+
const unlisten = await client.listen(channel, handler);
|
|
27
|
+
return () => unlisten();
|
|
28
|
+
},
|
|
29
|
+
migrate: (folder) => migratePglite(db, { migrationsFolder: folder }),
|
|
30
|
+
close: once(() => client.close()),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function nodePostgresHandle(url) {
|
|
34
|
+
const pool = new pg.Pool({ connectionString: url });
|
|
35
|
+
pool.on("error", (error) => {
|
|
36
|
+
console.warn("[parlor] an idle database connection dropped:", error.message);
|
|
37
|
+
});
|
|
38
|
+
const db = drizzlePg(pool);
|
|
39
|
+
const listeners = new Set();
|
|
40
|
+
return {
|
|
41
|
+
db,
|
|
42
|
+
driver: "node-postgres",
|
|
43
|
+
read: () => db,
|
|
44
|
+
transaction: (run) => db.transaction((tx) => run(tx)),
|
|
45
|
+
listen: async (channel, handler, options = {}) => {
|
|
46
|
+
const client = new pg.Client({ connectionString: url });
|
|
47
|
+
let state = "listening";
|
|
48
|
+
const current = () => state;
|
|
49
|
+
const lose = () => {
|
|
50
|
+
if (state !== "listening")
|
|
51
|
+
return;
|
|
52
|
+
state = "lost";
|
|
53
|
+
listeners.delete(client);
|
|
54
|
+
client.end().catch(() => { });
|
|
55
|
+
options.onLost?.();
|
|
56
|
+
};
|
|
57
|
+
client.on("error", lose);
|
|
58
|
+
client.on("end", lose);
|
|
59
|
+
client.on("notification", (message) => {
|
|
60
|
+
if (message.channel === channel)
|
|
61
|
+
handler(message.payload ?? "");
|
|
62
|
+
});
|
|
63
|
+
const identifier = pg.escapeIdentifier(channel);
|
|
64
|
+
try {
|
|
65
|
+
await client.connect();
|
|
66
|
+
await client.query(`LISTEN ${identifier}`);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
state = "closed";
|
|
70
|
+
await client.end().catch(() => { });
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
if (current() === "lost")
|
|
74
|
+
throw new Error(`LISTEN ${identifier} lost its connection`);
|
|
75
|
+
listeners.add(client);
|
|
76
|
+
return async () => {
|
|
77
|
+
if (state !== "listening")
|
|
78
|
+
return;
|
|
79
|
+
state = "closed";
|
|
80
|
+
listeners.delete(client);
|
|
81
|
+
await client.query(`UNLISTEN ${identifier}`).catch(() => { });
|
|
82
|
+
await client.end();
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
migrate: (folder) => migratePg(db, { migrationsFolder: folder }),
|
|
86
|
+
close: once(async () => {
|
|
87
|
+
await Promise.all([...listeners].map((client) => client.end()));
|
|
88
|
+
await pool.end();
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
async function preparePgliteDir(dataDir) {
|
|
93
|
+
if (/^[a-z]+:\/\//i.test(dataDir))
|
|
94
|
+
return;
|
|
95
|
+
await mkdir(dirname(dataDir), { recursive: true });
|
|
96
|
+
}
|
|
97
|
+
export async function createDatabase(options = {}) {
|
|
98
|
+
const url = options.url ?? resolveDatabaseUrl();
|
|
99
|
+
const dataDir = options.dataDir ?? DEFAULT_PGLITE_DIR;
|
|
100
|
+
if (!url)
|
|
101
|
+
await preparePgliteDir(dataDir);
|
|
102
|
+
const handle = url ? nodePostgresHandle(url) : pgliteHandle(dataDir);
|
|
103
|
+
if (options.migrationsFolder)
|
|
104
|
+
await handle.migrate(options.migrationsFolder);
|
|
105
|
+
return handle;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,CAAC;AA4BpB,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD,MAAM,UAAU,kBAAkB,CAChC,GAAG,GAAsB,OAAO,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AC,CAAC,CAAC;YAChE,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,OAAe;IAC7C,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO;IAC1C,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAO,GAAoB,EAAE;IAE7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAChD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,kBAAkB,CAAC;IACtD,IAAI,CAAC,GAAG;QAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrE,IAAI,OAAO,CAAC,gBAAgB;QAAE,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAId,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parlor/data",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"homepage": "https://cychien.github.io/parlor",
|
|
5
|
+
"bugs": "https://github.com/cychien/parlor/issues",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/cychien/parlor.git",
|
|
10
|
+
"directory": "packages/data"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@electric-sql/pglite": "^0.5.9",
|
|
24
|
+
"drizzle-orm": "^0.45.4",
|
|
25
|
+
"pg": "^8.23.1",
|
|
26
|
+
"@parlor/core": "0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^24.14.0",
|
|
30
|
+
"@types/pg": "^8.23.1",
|
|
31
|
+
"typescript": "^7.0.2",
|
|
32
|
+
"vitest": "^5.0.3"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsc -p tsconfig.json",
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
37
|
+
"test": "vitest run"
|
|
38
|
+
}
|
|
6
39
|
}
|