@dyrected/db-postgres 0.0.1 → 1.0.1
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.md +50 -0
- package/README.md +28 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -26
- package/dist/index.js.map +1 -1
- package/package.json +13 -2
package/LICENSE.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Ajola Technologies Ltd
|
|
6
|
+
Licensed Work: Dyrected
|
|
7
|
+
Additional Use Grant: Commercial use is permitted as long as it is not used to provide a hosted or managed service that competes with Dyrected.
|
|
8
|
+
Change Date: 2030-05-11
|
|
9
|
+
Change License: Apache License 2.0
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Business Source License 1.1
|
|
14
|
+
|
|
15
|
+
License text copyright © 2024 MariaDB plc, All Rights Reserved.
|
|
16
|
+
“Business Source License” is a trademark of MariaDB plc.
|
|
17
|
+
|
|
18
|
+
### Terms
|
|
19
|
+
|
|
20
|
+
The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
|
|
21
|
+
|
|
22
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
|
|
23
|
+
|
|
24
|
+
If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
|
|
25
|
+
|
|
26
|
+
All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
|
|
27
|
+
|
|
28
|
+
You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
|
|
29
|
+
|
|
30
|
+
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
|
31
|
+
|
|
32
|
+
This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
|
|
33
|
+
|
|
34
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
35
|
+
|
|
36
|
+
MariaDB hereby grants you permission to use this License’s text to license your works, and to refer to it using the trademark “Business Source License”, as long as you comply with the Covenants of Licensor below.
|
|
37
|
+
|
|
38
|
+
### Covenants of Licensor
|
|
39
|
+
|
|
40
|
+
In consideration of the right to use this License’s text and the “Business Source License” name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
|
|
41
|
+
|
|
42
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where “compatible” means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
|
|
43
|
+
|
|
44
|
+
2. To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text “None”.
|
|
45
|
+
|
|
46
|
+
3. Not to modify this License in any other way.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
The Business Source License (this document, or the “License”) is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
1
|
# @dyrected/db-postgres
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official PostgreSQL adapter for Dyrected. It provides a robust, high-performance database layer with built-in support for multi-tenancy via Postgres schemas.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-Schema Isolation**: Automatically handles workspace-level data isolation using Postgres schemas.
|
|
8
|
+
- **Full PgBouncer Compatibility**: Uses schema-qualified table names for reliable connection pooling.
|
|
9
|
+
- **Dynamic Table Provisioning**: Automatically creates and modifies tables based on your collection definitions.
|
|
10
|
+
- **Type-Safe Queries**: Fully integrated with the Dyrected query engine.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @dyrected/db-postgres
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { postgresAdapter } from '@dyrected/db-postgres';
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
db: postgresAdapter({
|
|
25
|
+
url: process.env.DATABASE_URL,
|
|
26
|
+
// Optional schema configuration
|
|
27
|
+
schemaName: 'public'
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DatabaseAdapter, PaginatedResult } from '@dyrected/core';
|
|
2
|
+
import postgres from 'postgres';
|
|
2
3
|
export interface PostgresAdapterConfig {
|
|
3
4
|
url: string;
|
|
4
5
|
}
|
|
@@ -7,13 +8,14 @@ export declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
7
8
|
private sql;
|
|
8
9
|
constructor(config: PostgresAdapterConfig);
|
|
9
10
|
private initInternalTables;
|
|
10
|
-
private
|
|
11
|
+
private getTableIdentifier;
|
|
11
12
|
private ensureTable;
|
|
12
|
-
find(
|
|
13
|
+
find(args: {
|
|
13
14
|
collection: string;
|
|
14
15
|
where?: any;
|
|
15
16
|
limit?: number;
|
|
16
17
|
page?: number;
|
|
18
|
+
sort?: string;
|
|
17
19
|
}): Promise<PaginatedResult>;
|
|
18
20
|
findOne(params: {
|
|
19
21
|
collection: string;
|
|
@@ -39,5 +41,7 @@ export declare class PostgresAdapter implements DatabaseAdapter {
|
|
|
39
41
|
slug: string;
|
|
40
42
|
data: any;
|
|
41
43
|
}): Promise<any>;
|
|
44
|
+
execute(query: string, params?: any[]): Promise<postgres.RowList<(postgres.Row & Iterable<postgres.Row>)[]>>;
|
|
45
|
+
ping(): Promise<boolean>;
|
|
42
46
|
}
|
|
43
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAIhC,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,eAAgB,YAAW,eAAe;IACrD,OAAO,CAAC,EAAE,CAAM;IAChB,OAAO,CAAC,GAAG,CAAe;gBAEd,MAAM,EAAE,qBAAqB;YAM3B,kBAAkB;IAShC,OAAO,CAAC,kBAAkB;YASZ,WAAW;IAYnB,IAAI,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IA2CvH,OAAO,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;IAQlD,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE;IAWhD,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE;IAM5D,MAAM,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;IAKjD,SAAS,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;IAOlC,YAAY,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE;IAShD,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE;IAOrC,IAAI;CASX"}
|
package/dist/index.js
CHANGED
|
@@ -16,13 +16,18 @@ export class PostgresAdapter {
|
|
|
16
16
|
)
|
|
17
17
|
`;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
getTableIdentifier(slug) {
|
|
20
|
+
if (slug.includes('.')) {
|
|
21
|
+
// If it's already qualified (contains a dot), trust the caller has formatted it correctly
|
|
22
|
+
// e.g. "ws_123"."collection_posts"
|
|
23
|
+
return this.sql.unsafe(slug);
|
|
24
|
+
}
|
|
25
|
+
return this.sql(`collection_${slug}`);
|
|
21
26
|
}
|
|
22
27
|
async ensureTable(slug) {
|
|
23
|
-
const
|
|
28
|
+
const table = this.getTableIdentifier(slug);
|
|
24
29
|
await this.sql `
|
|
25
|
-
CREATE TABLE IF NOT EXISTS ${
|
|
30
|
+
CREATE TABLE IF NOT EXISTS ${table} (
|
|
26
31
|
id TEXT PRIMARY KEY,
|
|
27
32
|
data JSONB,
|
|
28
33
|
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
|
|
@@ -30,15 +35,14 @@ export class PostgresAdapter {
|
|
|
30
35
|
)
|
|
31
36
|
`;
|
|
32
37
|
}
|
|
33
|
-
async find(
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const page = params.page || 1;
|
|
38
|
+
async find(args) {
|
|
39
|
+
const table = this.getTableIdentifier(args.collection);
|
|
40
|
+
const limit = args.limit || 10;
|
|
41
|
+
const page = args.page || 1;
|
|
38
42
|
const offset = (page - 1) * limit;
|
|
39
43
|
let whereClause = this.sql ``;
|
|
40
|
-
if (
|
|
41
|
-
const conditions = Object.entries(
|
|
44
|
+
if (args.where) {
|
|
45
|
+
const conditions = Object.entries(args.where).map(([key, value]) => {
|
|
42
46
|
if (key === 'id')
|
|
43
47
|
return this.sql `id = ${value}`;
|
|
44
48
|
return this.sql `data->>${key} = ${value}`;
|
|
@@ -48,49 +52,52 @@ export class PostgresAdapter {
|
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
// Fetch total count
|
|
51
|
-
const countRes = await this.sql `SELECT count(*) as total FROM ${
|
|
55
|
+
const countRes = await this.sql `SELECT count(*) as total FROM ${table} ${whereClause}`;
|
|
52
56
|
const total = parseInt(countRes[0].total);
|
|
53
57
|
// Fetch data
|
|
58
|
+
let sort = args.sort || 'createdAt DESC';
|
|
59
|
+
sort = sort.replace('createdAt', 'created_at').replace('updatedAt', 'updated_at');
|
|
54
60
|
const rows = await this.sql `
|
|
55
|
-
SELECT * FROM ${
|
|
61
|
+
SELECT * FROM ${table}
|
|
56
62
|
${whereClause}
|
|
63
|
+
ORDER BY ${this.sql.unsafe(sort)}
|
|
57
64
|
LIMIT ${limit} OFFSET ${offset}
|
|
58
65
|
`;
|
|
66
|
+
const totalPages = Math.ceil(total / limit);
|
|
59
67
|
return {
|
|
60
68
|
docs: rows.map(r => ({ id: r.id, ...r.data })),
|
|
61
69
|
total,
|
|
62
70
|
limit,
|
|
63
|
-
page
|
|
71
|
+
page,
|
|
72
|
+
totalPages,
|
|
73
|
+
hasNextPage: page < totalPages,
|
|
74
|
+
hasPrevPage: page > 1
|
|
64
75
|
};
|
|
65
76
|
}
|
|
66
77
|
async findOne(params) {
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
const rows = await this.sql `SELECT * FROM ${this.sql(tableName)} WHERE id = ${params.id}`;
|
|
78
|
+
const table = this.getTableIdentifier(params.collection);
|
|
79
|
+
const rows = await this.sql `SELECT * FROM ${table} WHERE id = ${params.id}`;
|
|
70
80
|
const row = rows[0];
|
|
71
81
|
if (!row)
|
|
72
82
|
return null;
|
|
73
83
|
return { id: row.id, ...row.data };
|
|
74
84
|
}
|
|
75
85
|
async create(params) {
|
|
76
|
-
|
|
77
|
-
const tableName = this.getTableName(params.collection);
|
|
86
|
+
const table = this.getTableIdentifier(params.collection);
|
|
78
87
|
const id = params.data.id || Math.random().toString(36).substring(7);
|
|
79
88
|
const data = { ...params.data };
|
|
80
89
|
delete data.id;
|
|
81
|
-
await this.sql `INSERT INTO ${
|
|
90
|
+
await this.sql `INSERT INTO ${table} (id, data) VALUES (${id}, ${data})`;
|
|
82
91
|
return { id, ...data };
|
|
83
92
|
}
|
|
84
93
|
async update(params) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
await this.sql `UPDATE ${this.sql(tableName)} SET data = ${params.data}, updated_at = CURRENT_TIMESTAMP WHERE id = ${params.id}`;
|
|
94
|
+
const table = this.getTableIdentifier(params.collection);
|
|
95
|
+
await this.sql `UPDATE ${table} SET data = data || ${params.data}::jsonb, updated_at = CURRENT_TIMESTAMP WHERE id = ${params.id}`;
|
|
88
96
|
return { id: params.id, ...params.data };
|
|
89
97
|
}
|
|
90
98
|
async delete(params) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
await this.sql `DELETE FROM ${this.sql(tableName)} WHERE id = ${params.id}`;
|
|
99
|
+
const table = this.getTableIdentifier(params.collection);
|
|
100
|
+
await this.sql `DELETE FROM ${table} WHERE id = ${params.id}`;
|
|
94
101
|
}
|
|
95
102
|
async getGlobal(params) {
|
|
96
103
|
const rows = await this.sql `SELECT value FROM dyrected_internal WHERE key = ${`global_${params.slug}`}`;
|
|
@@ -107,5 +114,21 @@ export class PostgresAdapter {
|
|
|
107
114
|
`;
|
|
108
115
|
return params.data;
|
|
109
116
|
}
|
|
117
|
+
async execute(query, params) {
|
|
118
|
+
if (params && params.length > 0) {
|
|
119
|
+
return this.sql.unsafe(query, params);
|
|
120
|
+
}
|
|
121
|
+
return this.sql.unsafe(query);
|
|
122
|
+
}
|
|
123
|
+
async ping() {
|
|
124
|
+
try {
|
|
125
|
+
await this.sql `SELECT 1`;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error('[dyrected-db-postgres] Database connectivity check failed:', error);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
110
133
|
}
|
|
111
134
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAOlD,MAAM,OAAO,eAAe;IAClB,EAAE,CAAM;IACR,GAAG,CAAe;IAE1B,YAAY,MAA6B;QACvC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEO,KAAK,CAAC,kBAAkB;QAC9B,MAAM,IAAI,CA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QACF,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAa,EAAE,MAAc;QACzC,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAA,UAAU,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4DAA4D,EAAE,KAAK,CAAC,CAAC;YACnF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/db-postgres",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -10,11 +10,22 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"postgres": "^3.4.4",
|
|
12
12
|
"drizzle-orm": "^0.30.0",
|
|
13
|
-
"@dyrected/core": "
|
|
13
|
+
"@dyrected/core": "1.0.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "^5.4.5"
|
|
17
17
|
},
|
|
18
|
+
"license": "BSL-1.1",
|
|
19
|
+
"author": "Ajola Technologies Ltd",
|
|
20
|
+
"homepage": "https://dyrected.com",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/she-WritesCode/dyrected.git"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"description": "PostgreSQL adapter for Dyrected CMS",
|
|
18
29
|
"scripts": {
|
|
19
30
|
"build": "tsc",
|
|
20
31
|
"dev": "tsc --watch"
|