@event-driven-io/pongo 0.17.0-beta.4 → 0.17.0-beta.40
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/cli.cjs +311 -487
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +4 -4
- package/dist/cli.d.ts +4 -3
- package/dist/cli.js +279 -487
- package/dist/cli.js.map +1 -1
- package/dist/cloudflare.cjs +41 -0
- package/dist/cloudflare.cjs.map +1 -0
- package/dist/cloudflare.d.cts +12 -0
- package/dist/cloudflare.d.ts +12 -0
- package/dist/cloudflare.js +35 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/core-BHdOCUrr.js +1429 -0
- package/dist/core-BHdOCUrr.js.map +1 -0
- package/dist/core-C9SB3XMx.cjs +1717 -0
- package/dist/core-C9SB3XMx.cjs.map +1 -0
- package/dist/core-CH0SOCr3.js +361 -0
- package/dist/core-CH0SOCr3.js.map +1 -0
- package/dist/core-CkmE5dkK.cjs +373 -0
- package/dist/core-CkmE5dkK.cjs.map +1 -0
- package/dist/index-C3pnS1S_.d.cts +720 -0
- package/dist/index-CZOmOsQt.d.ts +10 -0
- package/dist/index-FXnldVnn.d.cts +10 -0
- package/dist/index-r7V4paf_.d.ts +720 -0
- package/dist/index.cjs +67 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -105
- package/dist/index.d.ts +16 -105
- package/dist/index.js +17 -73
- package/dist/index.js.map +1 -1
- package/dist/pg.cjs +319 -288
- package/dist/pg.cjs.map +1 -1
- package/dist/pg.d.cts +29 -25
- package/dist/pg.d.ts +29 -25
- package/dist/pg.js +309 -284
- package/dist/pg.js.map +1 -1
- package/dist/shim.cjs +291 -368
- package/dist/shim.cjs.map +1 -1
- package/dist/shim.d.cts +141 -137
- package/dist/shim.d.ts +141 -137
- package/dist/shim.js +285 -367
- package/dist/shim.js.map +1 -1
- package/dist/sqlite3.cjs +43 -62
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +12 -11
- package/dist/sqlite3.d.ts +12 -11
- package/dist/sqlite3.js +36 -61
- package/dist/sqlite3.js.map +1 -1
- package/package.json +42 -44
- package/dist/chunk-4BL6YWLW.cjs +0 -872
- package/dist/chunk-4BL6YWLW.cjs.map +0 -1
- package/dist/chunk-ECQ2CKZE.cjs +0 -330
- package/dist/chunk-ECQ2CKZE.cjs.map +0 -1
- package/dist/chunk-NCNRRYVE.js +0 -872
- package/dist/chunk-NCNRRYVE.js.map +0 -1
- package/dist/chunk-Y7LRKJLJ.js +0 -330
- package/dist/chunk-Y7LRKJLJ.js.map +0 -1
- package/dist/d1.cjs +0 -53
- package/dist/d1.cjs.map +0 -1
- package/dist/d1.d.cts +0 -11
- package/dist/d1.d.ts +0 -11
- package/dist/d1.js +0 -53
- package/dist/d1.js.map +0 -1
- package/dist/index-BJopB-em.d.cts +0 -7
- package/dist/index-G5DECNb_.d.ts +0 -7
- package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.cts +0 -426
- package/dist/pongoCollectionSchemaComponent-t_e9n2Wc.d.ts +0 -426
package/dist/pg.cjs
CHANGED
|
@@ -1,154 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
switch (operator) {
|
|
32
|
-
case "$eq": {
|
|
33
|
-
const nestedPath = _dumbo.JSONSerializer.serialize(
|
|
34
|
-
buildNestedObject(path, value)
|
|
35
|
-
);
|
|
36
|
-
const serializedValue = _dumbo.JSONSerializer.serialize(value);
|
|
37
|
-
return _dumbo.SQL`(data @> ${nestedPath}::jsonb OR jsonb_path_exists(data, '$.${_dumbo.SQL.plain(path)}[*] ? (@ == ${_dumbo.SQL.plain(serializedValue)})'))`;
|
|
38
|
-
}
|
|
39
|
-
case "$gt":
|
|
40
|
-
case "$gte":
|
|
41
|
-
case "$lt":
|
|
42
|
-
case "$lte":
|
|
43
|
-
case "$ne": {
|
|
44
|
-
const jsonPath = _dumbo.SQL.plain(path.split(".").join(","));
|
|
45
|
-
return _dumbo.SQL`data ->> '${jsonPath}' ${_dumbo.SQL.plain(_chunk4BL6YWLWcjs.OperatorMap[operator])} ${value}`;
|
|
46
|
-
}
|
|
47
|
-
case "$in": {
|
|
48
|
-
const jsonPath = `{${path.split(".").join(",")}}`;
|
|
49
|
-
return _dumbo.SQL`data #>> ${jsonPath} IN ${value}`;
|
|
50
|
-
}
|
|
51
|
-
case "$nin": {
|
|
52
|
-
const jsonPath = `{${path.split(".").join(",")}}`;
|
|
53
|
-
return _dumbo.SQL`data #>> ${jsonPath} NOT IN ${value}`;
|
|
54
|
-
}
|
|
55
|
-
case "$elemMatch": {
|
|
56
|
-
const subQuery = _chunk4BL6YWLWcjs.objectEntries.call(void 0, value).map(
|
|
57
|
-
([subKey, subValue]) => `@."${subKey}" == ${_dumbo.JSONSerializer.serialize(subValue)}`
|
|
58
|
-
).join(" && ");
|
|
59
|
-
return _dumbo.SQL`jsonb_path_exists(data, '$.${_dumbo.SQL.plain(path)}[*] ? (${_dumbo.SQL.plain(subQuery)})')`;
|
|
60
|
-
}
|
|
61
|
-
case "$all": {
|
|
62
|
-
const nestedPath = _dumbo.JSONSerializer.serialize(
|
|
63
|
-
buildNestedObject(path, value)
|
|
64
|
-
);
|
|
65
|
-
return _dumbo.SQL`data @> ${nestedPath}::jsonb`;
|
|
66
|
-
}
|
|
67
|
-
case "$size": {
|
|
68
|
-
const jsonPath = `{${path.split(".").join(",")}}`;
|
|
69
|
-
return _dumbo.SQL`jsonb_array_length(data #> ${jsonPath}) = ${value}`;
|
|
70
|
-
}
|
|
71
|
-
default:
|
|
72
|
-
throw new Error(`Unsupported operator: ${operator}`);
|
|
73
|
-
}
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_core = require('./core-C9SB3XMx.cjs');
|
|
3
|
+
const require_cli = require('./cli.cjs');
|
|
4
|
+
let _event_driven_io_dumbo = require("@event-driven-io/dumbo");
|
|
5
|
+
let _event_driven_io_dumbo_pg = require("@event-driven-io/dumbo/pg");
|
|
6
|
+
|
|
7
|
+
//#region src/storage/postgresql/core/sqlBuilder/filter/queryOperators.ts
|
|
8
|
+
const handleOperator = (path, operator, value, serializer) => {
|
|
9
|
+
if (path === "_id" || path === "_version") return handleMetadataOperator(path, operator, value);
|
|
10
|
+
switch (operator) {
|
|
11
|
+
case "$eq": {
|
|
12
|
+
const nestedPath = serializer.serialize(buildNestedObject(path, value));
|
|
13
|
+
const serializedValue = serializer.serialize(value);
|
|
14
|
+
return _event_driven_io_dumbo.SQL`(data @> ${nestedPath}::jsonb OR jsonb_path_exists(data, '$.${_event_driven_io_dumbo.SQL.plain(path)}[*] ? (@ == ${_event_driven_io_dumbo.SQL.plain(serializedValue)})'))`;
|
|
15
|
+
}
|
|
16
|
+
case "$gt":
|
|
17
|
+
case "$gte":
|
|
18
|
+
case "$lt":
|
|
19
|
+
case "$lte":
|
|
20
|
+
case "$ne": return _event_driven_io_dumbo.SQL`data ->> '${_event_driven_io_dumbo.SQL.plain(path.split(".").join(","))}' ${_event_driven_io_dumbo.SQL.plain(require_core.OperatorMap[operator])} ${value}`;
|
|
21
|
+
case "$in": return _event_driven_io_dumbo.SQL`data #>> ${`{${path.split(".").join(",")}}`} = ANY (${value})`;
|
|
22
|
+
case "$nin": return _event_driven_io_dumbo.SQL`data #>> ${`{${path.split(".").join(",")}}`} != ALL (${value})`;
|
|
23
|
+
case "$elemMatch": {
|
|
24
|
+
const subQuery = require_core.objectEntries(value).map(([subKey, subValue]) => `@."${subKey}" == ${serializer.serialize(subValue)}`).join(" && ");
|
|
25
|
+
return _event_driven_io_dumbo.SQL`jsonb_path_exists(data, '$.${_event_driven_io_dumbo.SQL.plain(path)}[*] ? (${_event_driven_io_dumbo.SQL.plain(subQuery)})')`;
|
|
26
|
+
}
|
|
27
|
+
case "$all": return _event_driven_io_dumbo.SQL`data @> ${serializer.serialize(buildNestedObject(path, value))}::jsonb`;
|
|
28
|
+
case "$size": return _event_driven_io_dumbo.SQL`jsonb_array_length(data #> ${`{${path.split(".").join(",")}}`}) = ${value}`;
|
|
29
|
+
default: throw new Error(`Unsupported operator: ${operator}`);
|
|
30
|
+
}
|
|
74
31
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
case "$nin":
|
|
88
|
-
return _dumbo.SQL`${_dumbo.SQL.plain(fieldName)} NOT IN ${value}`;
|
|
89
|
-
default:
|
|
90
|
-
throw new Error(`Unsupported operator: ${operator}`);
|
|
91
|
-
}
|
|
32
|
+
const handleMetadataOperator = (fieldName, operator, value) => {
|
|
33
|
+
switch (operator) {
|
|
34
|
+
case "$eq": return _event_driven_io_dumbo.SQL`${_event_driven_io_dumbo.SQL.plain(fieldName)} = ${value}`;
|
|
35
|
+
case "$gt":
|
|
36
|
+
case "$gte":
|
|
37
|
+
case "$lt":
|
|
38
|
+
case "$lte":
|
|
39
|
+
case "$ne": return _event_driven_io_dumbo.SQL`${_event_driven_io_dumbo.SQL.plain(fieldName)} ${_event_driven_io_dumbo.SQL.plain(require_core.OperatorMap[operator])} ${value}`;
|
|
40
|
+
case "$in": return _event_driven_io_dumbo.SQL`${_event_driven_io_dumbo.SQL.plain(fieldName)} = ANY (${value})`;
|
|
41
|
+
case "$nin": return _event_driven_io_dumbo.SQL`${_event_driven_io_dumbo.SQL.plain(fieldName)} != ALL (${value})`;
|
|
42
|
+
default: throw new Error(`Unsupported operator: ${operator}`);
|
|
43
|
+
}
|
|
92
44
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
45
|
+
const buildNestedObject = (path, value) => path.split(".").reverse().reduce((acc, key) => ({ [key]: acc }), value);
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/storage/postgresql/core/sqlBuilder/filter/index.ts
|
|
49
|
+
const AND = "AND";
|
|
50
|
+
const OR = "OR";
|
|
51
|
+
const unsupportedRootOperators = [
|
|
52
|
+
"$text",
|
|
53
|
+
"$where",
|
|
54
|
+
"$comment"
|
|
55
|
+
];
|
|
56
|
+
const constructFilterQuery = (filter, serializer) => {
|
|
57
|
+
ensureSupportedRootOperators(filter);
|
|
58
|
+
const parts = [];
|
|
59
|
+
const fieldFilterQuery = constructFieldFilterQuery(filter, serializer);
|
|
60
|
+
if (!_event_driven_io_dumbo.SQL.check.isEmpty(fieldFilterQuery)) parts.push(fieldFilterQuery);
|
|
61
|
+
const orFilterQuery = constructLogicalFilterQuery(filter.$or, OR, serializer);
|
|
62
|
+
if (!_event_driven_io_dumbo.SQL.check.isEmpty(orFilterQuery)) parts.push(orFilterQuery);
|
|
63
|
+
const andFilterQuery = constructLogicalFilterQuery(filter.$and, AND, serializer);
|
|
64
|
+
if (!_event_driven_io_dumbo.SQL.check.isEmpty(andFilterQuery)) parts.push(andFilterQuery);
|
|
65
|
+
const norFilterQuery = constructNorFilterQuery(filter.$nor, serializer);
|
|
66
|
+
if (!_event_driven_io_dumbo.SQL.check.isEmpty(norFilterQuery)) parts.push(norFilterQuery);
|
|
67
|
+
return _event_driven_io_dumbo.SQL.merge(parts, ` ${AND} `);
|
|
111
68
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
case "$inc":
|
|
124
|
-
return buildIncQuery(value, currentUpdateQuery);
|
|
125
|
-
case "$push":
|
|
126
|
-
return buildPushQuery(value, currentUpdateQuery);
|
|
127
|
-
default:
|
|
128
|
-
return currentUpdateQuery;
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
_dumbo.SQL`data`
|
|
132
|
-
);
|
|
133
|
-
var buildSetQuery = (set, currentUpdateQuery) => _dumbo.SQL`${currentUpdateQuery} || ${_dumbo.JSONSerializer.serialize(set)}::jsonb`;
|
|
134
|
-
var buildUnsetQuery = (unset, currentUpdateQuery) => _dumbo.SQL`${currentUpdateQuery} - ${Object.keys(unset).map((k) => `{${k}}`).join(", ")}`;
|
|
135
|
-
var buildIncQuery = (inc, currentUpdateQuery) => {
|
|
136
|
-
for (const [key, value] of Object.entries(inc)) {
|
|
137
|
-
currentUpdateQuery = typeof value === "bigint" ? _dumbo.SQL`jsonb_set(${currentUpdateQuery}, '{${_dumbo.SQL.plain(key)}}', to_jsonb((COALESCE((data->>'${_dumbo.SQL.plain(key)}')::BIGINT, 0) + ${value})::TEXT), true)` : _dumbo.SQL`jsonb_set(${currentUpdateQuery}, '{${_dumbo.SQL.plain(key)}}', to_jsonb(COALESCE((data->>'${_dumbo.SQL.plain(key)}')::NUMERIC, 0) + ${value}), true)`;
|
|
138
|
-
}
|
|
139
|
-
return currentUpdateQuery;
|
|
69
|
+
const constructFieldFilterQuery = (filter, serializer) => _event_driven_io_dumbo.SQL.merge(require_core.objectEntries(filter).flatMap(([key, value]) => isLogicalRootOperator(key) ? [] : [isRecord(value) ? constructComplexFilterQuery(key, value, serializer) : handleOperator(key, require_core.QueryOperators.$eq, value, serializer)]), ` ${AND} `);
|
|
70
|
+
const constructLogicalFilterQuery = (filters, joinOperator, serializer) => {
|
|
71
|
+
if (!filters?.length) return _event_driven_io_dumbo.SQL.EMPTY;
|
|
72
|
+
const subFilterQueries = filters.reduce((queries, filter) => {
|
|
73
|
+
const query = constructFilterQuery(filter, serializer);
|
|
74
|
+
if (!_event_driven_io_dumbo.SQL.check.isEmpty(query)) queries.push(query);
|
|
75
|
+
return queries;
|
|
76
|
+
}, []);
|
|
77
|
+
if (subFilterQueries.length === 0) return _event_driven_io_dumbo.SQL.EMPTY;
|
|
78
|
+
if (subFilterQueries.length === 1) return wrapFilterQuery(subFilterQueries[0]);
|
|
79
|
+
return _event_driven_io_dumbo.SQL`(${_event_driven_io_dumbo.SQL.merge(subFilterQueries.map(wrapFilterQuery), ` ${joinOperator} `)})`;
|
|
140
80
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
81
|
+
const constructNorFilterQuery = (filters, serializer) => {
|
|
82
|
+
if (!filters?.length) return _event_driven_io_dumbo.SQL.EMPTY;
|
|
83
|
+
const logicalFilterQuery = constructLogicalFilterQuery(filters, OR, serializer);
|
|
84
|
+
return _event_driven_io_dumbo.SQL.check.isEmpty(logicalFilterQuery) ? _event_driven_io_dumbo.SQL.EMPTY : _event_driven_io_dumbo.SQL`NOT ${logicalFilterQuery}`;
|
|
85
|
+
};
|
|
86
|
+
const constructComplexFilterQuery = (key, value, serializer) => {
|
|
87
|
+
const isEquality = !require_core.hasOperators(value);
|
|
88
|
+
return _event_driven_io_dumbo.SQL.merge(require_core.objectEntries(value).map(([nestedKey, val]) => isEquality ? handleOperator(`${key}.${nestedKey}`, require_core.QueryOperators.$eq, val, serializer) : handleOperator(key, nestedKey, val, serializer)), ` ${AND} `);
|
|
89
|
+
};
|
|
90
|
+
const wrapFilterQuery = (filterQuery) => _event_driven_io_dumbo.SQL`(${filterQuery})`;
|
|
91
|
+
const ensureSupportedRootOperators = (filter) => {
|
|
92
|
+
for (const operator of unsupportedRootOperators) if (operator in filter) throw new Error(`Unsupported root operator: ${operator}`);
|
|
93
|
+
};
|
|
94
|
+
const isLogicalRootOperator = (key) => key === "$and" || key === "$nor" || key === "$or";
|
|
95
|
+
const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/storage/postgresql/core/sqlBuilder/update/index.ts
|
|
99
|
+
const buildUpdateQuery = (update, serializer) => require_core.objectEntries(update).reduce((currentUpdateQuery, [op, value]) => {
|
|
100
|
+
switch (op) {
|
|
101
|
+
case "$set": return buildSetQuery(value, currentUpdateQuery, serializer);
|
|
102
|
+
case "$unset": return buildUnsetQuery(value, currentUpdateQuery);
|
|
103
|
+
case "$inc": return buildIncQuery(value, currentUpdateQuery);
|
|
104
|
+
case "$push": return buildPushQuery(value, currentUpdateQuery, serializer);
|
|
105
|
+
default: return currentUpdateQuery;
|
|
106
|
+
}
|
|
107
|
+
}, _event_driven_io_dumbo.SQL`data`);
|
|
108
|
+
const buildSetQuery = (set, currentUpdateQuery, serializer) => _event_driven_io_dumbo.SQL`${currentUpdateQuery} || ${serializer.serialize(set)}::jsonb`;
|
|
109
|
+
const buildUnsetQuery = (unset, currentUpdateQuery) => _event_driven_io_dumbo.SQL`${currentUpdateQuery} - ${Object.keys(unset).map((k) => `{${k}}`).join(", ")}`;
|
|
110
|
+
const buildIncQuery = (inc, currentUpdateQuery) => {
|
|
111
|
+
for (const [key, value] of Object.entries(inc)) currentUpdateQuery = typeof value === "bigint" ? _event_driven_io_dumbo.SQL`jsonb_set(${currentUpdateQuery}, '{${_event_driven_io_dumbo.SQL.plain(key)}}', to_jsonb((COALESCE((data->>'${_event_driven_io_dumbo.SQL.plain(key)}')::BIGINT, 0) + ${value})::TEXT), true)` : _event_driven_io_dumbo.SQL`jsonb_set(${currentUpdateQuery}, '{${_event_driven_io_dumbo.SQL.plain(key)}}', to_jsonb(COALESCE((data->>'${_event_driven_io_dumbo.SQL.plain(key)}')::NUMERIC, 0) + ${value}), true)`;
|
|
112
|
+
return currentUpdateQuery;
|
|
113
|
+
};
|
|
114
|
+
const buildPushQuery = (push, currentUpdateQuery, serializer) => {
|
|
115
|
+
for (const [key, value] of Object.entries(push)) {
|
|
116
|
+
const serializedValue = serializer.serialize([value]);
|
|
117
|
+
currentUpdateQuery = _event_driven_io_dumbo.SQL`jsonb_set(${currentUpdateQuery}, '{${_event_driven_io_dumbo.SQL.plain(key)}}', (coalesce(data->'${_event_driven_io_dumbo.SQL.plain(key)}', '[]'::jsonb) || ${serializedValue}::jsonb), true)`;
|
|
118
|
+
}
|
|
119
|
+
return currentUpdateQuery;
|
|
147
120
|
};
|
|
148
121
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/storage/postgresql/core/sqlBuilder/index.ts
|
|
124
|
+
const versionCheckClause = (collectionName, expectedVersion) => {
|
|
125
|
+
const col = _event_driven_io_dumbo.SQL.identifier(collectionName);
|
|
126
|
+
const predicate = require_core.expectedVersionPredicate(expectedVersion);
|
|
127
|
+
return predicate.operator === "none" ? _event_driven_io_dumbo.SQL.EMPTY : _event_driven_io_dumbo.SQL`AND ${col}._version = ${predicate.value}`;
|
|
128
|
+
};
|
|
129
|
+
const createCollection = (collectionName) => _event_driven_io_dumbo.SQL`
|
|
130
|
+
CREATE TABLE IF NOT EXISTS ${_event_driven_io_dumbo.SQL.identifier(collectionName)} (
|
|
152
131
|
_id TEXT PRIMARY KEY,
|
|
153
132
|
data JSONB NOT NULL,
|
|
154
133
|
metadata JSONB NOT NULL DEFAULT '{}',
|
|
@@ -158,52 +137,54 @@ var createCollection = (collectionName) => _dumbo.SQL`
|
|
|
158
137
|
_created TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
159
138
|
_updated TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
160
139
|
)`;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const id = document._id;
|
|
171
|
-
const version = _nullishCoalesce(document._version, () => ( 1n));
|
|
172
|
-
return _dumbo.SQL`
|
|
173
|
-
INSERT INTO ${_dumbo.SQL.identifier(collectionName)} (_id, data, _version)
|
|
140
|
+
const pongoCollectionPostgreSQLMigrations = (collectionName) => [(0, _event_driven_io_dumbo.sqlMigration)(`pongoCollection:${collectionName}:001:createtable`, [createCollection(collectionName)])];
|
|
141
|
+
const postgresSQLBuilder = (collectionName, serializer) => ({
|
|
142
|
+
createCollection: () => createCollection(collectionName),
|
|
143
|
+
insertOne: (document) => {
|
|
144
|
+
const serialized = serializer.serialize(document);
|
|
145
|
+
const id = document._id;
|
|
146
|
+
const version = document._version ?? 1n;
|
|
147
|
+
return _event_driven_io_dumbo.SQL`
|
|
148
|
+
INSERT INTO ${_event_driven_io_dumbo.SQL.identifier(collectionName)} (_id, data, _version)
|
|
174
149
|
VALUES (${id}, ${serialized}, ${version}) ON CONFLICT(_id) DO NOTHING;`;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
),
|
|
181
|
-
","
|
|
182
|
-
);
|
|
183
|
-
return _dumbo.SQL`
|
|
184
|
-
INSERT INTO ${_dumbo.SQL.identifier(collectionName)} (_id, data, _version) VALUES ${values}
|
|
150
|
+
},
|
|
151
|
+
insertMany: (documents) => {
|
|
152
|
+
const values = _event_driven_io_dumbo.SQL.merge(documents.map((doc) => _event_driven_io_dumbo.SQL`(${doc._id}, ${serializer.serialize(doc)}, ${doc._version ?? 1n})`), ",");
|
|
153
|
+
return _event_driven_io_dumbo.SQL`
|
|
154
|
+
INSERT INTO ${_event_driven_io_dumbo.SQL.identifier(collectionName)} (_id, data, _version) VALUES ${values}
|
|
185
155
|
ON CONFLICT(_id) DO NOTHING
|
|
186
156
|
RETURNING _id;`;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
157
|
+
},
|
|
158
|
+
insertOrReplace: (documents) => {
|
|
159
|
+
const col = _event_driven_io_dumbo.SQL.identifier(collectionName);
|
|
160
|
+
return _event_driven_io_dumbo.SQL`
|
|
161
|
+
INSERT INTO ${col} (_id, data, _version)
|
|
162
|
+
VALUES ${_event_driven_io_dumbo.SQL.merge(documents.map((d) => _event_driven_io_dumbo.SQL`(${d._id}::text, ${serializer.serialize(d)}::jsonb || jsonb_build_object('_id', ${d._id}::text) || jsonb_build_object('_version', '1'::text), 1::bigint)`), ",")}
|
|
163
|
+
ON CONFLICT(_id) DO UPDATE SET
|
|
164
|
+
data = EXCLUDED.data
|
|
165
|
+
|| jsonb_build_object('_id', ${col}._id)
|
|
166
|
+
|| jsonb_build_object('_version', (${col}._version + 1)::text),
|
|
167
|
+
_version = ${col}._version + 1
|
|
168
|
+
RETURNING _id, _version AS version;`;
|
|
169
|
+
},
|
|
170
|
+
updateOne: (filter, update, options) => {
|
|
171
|
+
const expectedVersionUpdate = versionCheckClause(collectionName, options?.expectedVersion);
|
|
172
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
173
|
+
const updateQuery = (0, _event_driven_io_dumbo.isSQL)(update) ? update : buildUpdateQuery(update, serializer);
|
|
174
|
+
return _event_driven_io_dumbo.SQL`
|
|
194
175
|
WITH existing AS (
|
|
195
176
|
SELECT _id, _version as current_version
|
|
196
|
-
FROM ${
|
|
177
|
+
FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)}
|
|
197
178
|
LIMIT 1
|
|
198
179
|
),
|
|
199
180
|
updated AS (
|
|
200
|
-
UPDATE ${
|
|
181
|
+
UPDATE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}
|
|
201
182
|
SET
|
|
202
|
-
data = ${updateQuery} || jsonb_build_object('_id', ${
|
|
183
|
+
data = ${updateQuery} || jsonb_build_object('_id', ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id) || jsonb_build_object('_version', (_version + 1)::text),
|
|
203
184
|
_version = _version + 1
|
|
204
185
|
FROM existing
|
|
205
|
-
WHERE ${
|
|
206
|
-
RETURNING ${
|
|
186
|
+
WHERE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id = existing._id ${expectedVersionUpdate}
|
|
187
|
+
RETURNING ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id, ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._version
|
|
207
188
|
)
|
|
208
189
|
SELECT
|
|
209
190
|
existing._id,
|
|
@@ -213,25 +194,24 @@ var postgresSQLBuilder = (collectionName) => ({
|
|
|
213
194
|
FROM existing
|
|
214
195
|
LEFT JOIN updated
|
|
215
196
|
ON existing._id = updated._id;`;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return _dumbo.SQL`
|
|
197
|
+
},
|
|
198
|
+
replaceOne: (filter, document, options) => {
|
|
199
|
+
const expectedVersionUpdate = versionCheckClause(collectionName, options?.expectedVersion);
|
|
200
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
201
|
+
return _event_driven_io_dumbo.SQL`
|
|
222
202
|
WITH existing AS (
|
|
223
203
|
SELECT _id, _version as current_version
|
|
224
|
-
FROM ${
|
|
204
|
+
FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)}
|
|
225
205
|
LIMIT 1
|
|
226
206
|
),
|
|
227
207
|
updated AS (
|
|
228
|
-
UPDATE ${
|
|
208
|
+
UPDATE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}
|
|
229
209
|
SET
|
|
230
|
-
data = ${
|
|
210
|
+
data = ${serializer.serialize(document)} || jsonb_build_object('_id', ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id) || jsonb_build_object('_version', (_version + 1)::text),
|
|
231
211
|
_version = _version + 1
|
|
232
212
|
FROM existing
|
|
233
|
-
WHERE ${
|
|
234
|
-
RETURNING ${
|
|
213
|
+
WHERE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id = existing._id ${expectedVersionUpdate}
|
|
214
|
+
RETURNING ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id, ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._version
|
|
235
215
|
)
|
|
236
216
|
SELECT
|
|
237
217
|
existing._id,
|
|
@@ -241,32 +221,31 @@ var postgresSQLBuilder = (collectionName) => ({
|
|
|
241
221
|
FROM existing
|
|
242
222
|
LEFT JOIN updated
|
|
243
223
|
ON existing._id = updated._id;`;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
UPDATE ${
|
|
224
|
+
},
|
|
225
|
+
updateMany: (filter, update) => {
|
|
226
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
227
|
+
const updateQuery = (0, _event_driven_io_dumbo.isSQL)(update) ? update : buildUpdateQuery(update, serializer);
|
|
228
|
+
return _event_driven_io_dumbo.SQL`
|
|
229
|
+
UPDATE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}
|
|
250
230
|
SET
|
|
251
231
|
data = ${updateQuery} || jsonb_build_object('_version', (_version + 1)::text),
|
|
252
232
|
_version = _version + 1
|
|
253
233
|
${where(filterQuery)};`;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return _dumbo.SQL`
|
|
234
|
+
},
|
|
235
|
+
deleteOne: (filter, options) => {
|
|
236
|
+
const expectedVersionUpdate = versionCheckClause(collectionName, options?.expectedVersion);
|
|
237
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
238
|
+
return _event_driven_io_dumbo.SQL`
|
|
260
239
|
WITH existing AS (
|
|
261
240
|
SELECT _id
|
|
262
|
-
FROM ${
|
|
241
|
+
FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)}
|
|
263
242
|
LIMIT 1
|
|
264
243
|
),
|
|
265
244
|
deleted AS (
|
|
266
|
-
DELETE FROM ${
|
|
245
|
+
DELETE FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)}
|
|
267
246
|
USING existing
|
|
268
|
-
WHERE ${
|
|
269
|
-
RETURNING ${
|
|
247
|
+
WHERE ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id = existing._id ${expectedVersionUpdate}
|
|
248
|
+
RETURNING ${_event_driven_io_dumbo.SQL.identifier(collectionName)}._id
|
|
270
249
|
)
|
|
271
250
|
SELECT
|
|
272
251
|
existing._id,
|
|
@@ -275,88 +254,140 @@ var postgresSQLBuilder = (collectionName) => ({
|
|
|
275
254
|
FROM existing
|
|
276
255
|
LEFT JOIN deleted
|
|
277
256
|
ON existing._id = deleted._id;`;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
257
|
+
},
|
|
258
|
+
deleteMany: (filter) => {
|
|
259
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
260
|
+
return _event_driven_io_dumbo.SQL`DELETE FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)}`;
|
|
261
|
+
},
|
|
262
|
+
replaceMany: (documents) => {
|
|
263
|
+
if (documents.some((d) => "_version" in d && d._version !== void 0)) return _event_driven_io_dumbo.SQL`
|
|
264
|
+
WITH replacements(_id, data, expected_version) AS (
|
|
265
|
+
VALUES ${_event_driven_io_dumbo.SQL.merge(documents.map((d) => {
|
|
266
|
+
const expectedVersion = d._version;
|
|
267
|
+
return expectedVersion !== void 0 ? _event_driven_io_dumbo.SQL`(${d._id}::text, ${serializer.serialize(d)}::jsonb, ${expectedVersion}::bigint)` : _event_driven_io_dumbo.SQL`(${d._id}::text, ${serializer.serialize(d)}::jsonb, NULL::bigint)`;
|
|
268
|
+
}), ",")}
|
|
269
|
+
)
|
|
270
|
+
UPDATE ${_event_driven_io_dumbo.SQL.identifier(collectionName)} t
|
|
271
|
+
SET
|
|
272
|
+
data = r.data
|
|
273
|
+
|| jsonb_build_object('_id', t._id)
|
|
274
|
+
|| jsonb_build_object('_version', (t._version + 1)::text),
|
|
275
|
+
_version = t._version + 1
|
|
276
|
+
FROM replacements r
|
|
277
|
+
WHERE t._id = r._id AND (r.expected_version IS NULL OR t._version = r.expected_version)
|
|
278
|
+
RETURNING t._id, t._version AS version;`;
|
|
279
|
+
return _event_driven_io_dumbo.SQL`
|
|
280
|
+
WITH replacements(_id, data) AS (
|
|
281
|
+
VALUES ${_event_driven_io_dumbo.SQL.merge(documents.map((d) => _event_driven_io_dumbo.SQL`(${d._id}::text, ${serializer.serialize(d)}::jsonb)`), ",")}
|
|
282
|
+
)
|
|
283
|
+
UPDATE ${_event_driven_io_dumbo.SQL.identifier(collectionName)} t
|
|
284
|
+
SET
|
|
285
|
+
data = r.data
|
|
286
|
+
|| jsonb_build_object('_id', t._id)
|
|
287
|
+
|| jsonb_build_object('_version', (t._version + 1)::text),
|
|
288
|
+
_version = t._version + 1
|
|
289
|
+
FROM replacements r
|
|
290
|
+
WHERE t._id = r._id
|
|
291
|
+
RETURNING t._id, t._version AS version;`;
|
|
292
|
+
},
|
|
293
|
+
deleteManyByIds: (ids) => {
|
|
294
|
+
if (ids.some((d) => d._version !== void 0)) return _event_driven_io_dumbo.SQL`
|
|
295
|
+
WITH targets(_id, expected_version) AS (
|
|
296
|
+
VALUES ${_event_driven_io_dumbo.SQL.merge(ids.map((d) => _event_driven_io_dumbo.SQL`(${d._id}::text, ${d._version ?? 0n}::bigint)`), ",")}
|
|
297
|
+
),
|
|
298
|
+
deleted AS (
|
|
299
|
+
DELETE FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} t
|
|
300
|
+
USING targets r
|
|
301
|
+
WHERE t._id = r._id AND t._version = r.expected_version
|
|
302
|
+
RETURNING t._id
|
|
303
|
+
)
|
|
304
|
+
SELECT r._id,
|
|
305
|
+
CASE WHEN d._id IS NOT NULL THEN 1 ELSE 0 END as deleted
|
|
306
|
+
FROM targets r
|
|
307
|
+
LEFT JOIN deleted d ON r._id = d._id;`;
|
|
308
|
+
return _event_driven_io_dumbo.SQL`
|
|
309
|
+
WITH targets(_id) AS (
|
|
310
|
+
VALUES ${_event_driven_io_dumbo.SQL.merge(ids.map((d) => _event_driven_io_dumbo.SQL`(${d._id}::text)`), ",")}
|
|
311
|
+
),
|
|
312
|
+
deleted AS (
|
|
313
|
+
DELETE FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} t
|
|
314
|
+
USING targets r
|
|
315
|
+
WHERE t._id = r._id
|
|
316
|
+
RETURNING t._id
|
|
317
|
+
)
|
|
318
|
+
SELECT r._id,
|
|
319
|
+
CASE WHEN d._id IS NOT NULL THEN 1 ELSE 0 END as deleted
|
|
320
|
+
FROM targets r
|
|
321
|
+
LEFT JOIN deleted d ON r._id = d._id;`;
|
|
322
|
+
},
|
|
323
|
+
findOne: (filter) => {
|
|
324
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
325
|
+
return _event_driven_io_dumbo.SQL`SELECT data, _id, _version FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)} LIMIT 1;`;
|
|
326
|
+
},
|
|
327
|
+
find: (filter, options) => {
|
|
328
|
+
const filterQuery = (0, _event_driven_io_dumbo.isSQL)(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
329
|
+
const query = [];
|
|
330
|
+
query.push(_event_driven_io_dumbo.SQL`SELECT data, _id, _version FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)}`);
|
|
331
|
+
query.push(where(filterQuery));
|
|
332
|
+
if (options?.sort && Object.keys(options.sort).length > 0) {
|
|
333
|
+
const clauses = Object.entries(options.sort).map(([field, dir]) => {
|
|
334
|
+
const isMetadata = field === "_id" || field === "_version";
|
|
335
|
+
const isNested = !isMetadata && field.includes(".");
|
|
336
|
+
const accessor = isMetadata ? _event_driven_io_dumbo.SQL`${_event_driven_io_dumbo.SQL.plain(field)}` : isNested ? _event_driven_io_dumbo.SQL`data #> '${_event_driven_io_dumbo.SQL.plain(`{${field.split(".").join(",")}}`)}'` : _event_driven_io_dumbo.SQL`data -> '${_event_driven_io_dumbo.SQL.plain(field)}'`;
|
|
337
|
+
return dir === 1 ? _event_driven_io_dumbo.SQL`${accessor} ASC NULLS FIRST` : _event_driven_io_dumbo.SQL`${accessor} DESC NULLS LAST`;
|
|
338
|
+
});
|
|
339
|
+
query.push(_event_driven_io_dumbo.SQL`ORDER BY ${_event_driven_io_dumbo.SQL.merge(clauses, ",")}`);
|
|
340
|
+
}
|
|
341
|
+
if (options?.limit) query.push(_event_driven_io_dumbo.SQL`LIMIT ${options.limit}`);
|
|
342
|
+
if (options?.skip) query.push(_event_driven_io_dumbo.SQL`OFFSET ${options.skip}`);
|
|
343
|
+
return _event_driven_io_dumbo.SQL.merge([...query, _event_driven_io_dumbo.SQL`;`]);
|
|
344
|
+
},
|
|
345
|
+
countDocuments: (filter) => {
|
|
346
|
+
const filterQuery = _event_driven_io_dumbo.SQL.check.isSQL(filter) ? filter : constructFilterQuery(filter, serializer);
|
|
347
|
+
return _event_driven_io_dumbo.SQL`SELECT COUNT(1) as count FROM ${_event_driven_io_dumbo.SQL.identifier(collectionName)} ${where(filterQuery)};`;
|
|
348
|
+
},
|
|
349
|
+
rename: (newName) => _event_driven_io_dumbo.SQL`ALTER TABLE ${_event_driven_io_dumbo.SQL.identifier(collectionName)} RENAME TO ${_event_driven_io_dumbo.SQL.identifier(newName)};`,
|
|
350
|
+
drop: (targetName = collectionName) => _event_driven_io_dumbo.SQL`DROP TABLE IF EXISTS ${_event_driven_io_dumbo.SQL.identifier(targetName)}`
|
|
306
351
|
});
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
sqlBuilder: postgresSQLBuilder(schema.name)
|
|
337
|
-
}),
|
|
338
|
-
definition: _nullishCoalesce(_optionalChain([options, 'access', _6 => _6.schema, 'optionalAccess', _7 => _7.definition]), () => ( _chunk4BL6YWLWcjs.pongoSchema.db(databaseName, {})))
|
|
339
|
-
}),
|
|
340
|
-
databaseName
|
|
341
|
-
});
|
|
342
|
-
},
|
|
343
|
-
getDatabaseNameOrDefault: (options) => {
|
|
344
|
-
return _nullishCoalesce(options.databaseName, () => ( _pg.getDatabaseNameOrDefault.call(void 0, options.connectionString)));
|
|
345
|
-
},
|
|
346
|
-
defaultConnectionString: "postgresql://localhost:5432/postgres"
|
|
352
|
+
const where = (filterQuery) => _event_driven_io_dumbo.SQL.check.isEmpty(filterQuery) ? _event_driven_io_dumbo.SQL.EMPTY : _event_driven_io_dumbo.SQL.merge([_event_driven_io_dumbo.SQL`WHERE `, filterQuery]);
|
|
353
|
+
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/storage/postgresql/pg/index.ts
|
|
356
|
+
const pgPongoDriver = {
|
|
357
|
+
driverType: _event_driven_io_dumbo_pg.PgDriverType,
|
|
358
|
+
databaseFactory: (options) => {
|
|
359
|
+
const databaseName = options.databaseName ?? _event_driven_io_dumbo_pg.postgreSQLMetadata.parseDatabaseName(options.connectionString) ?? _event_driven_io_dumbo_pg.postgreSQLMetadata.defaultDatabaseName;
|
|
360
|
+
return require_core.PongoDatabase({
|
|
361
|
+
...options,
|
|
362
|
+
pool: (0, _event_driven_io_dumbo.dumbo)({
|
|
363
|
+
connectionString: options.connectionString,
|
|
364
|
+
driver: _event_driven_io_dumbo_pg.pgDumboDriver,
|
|
365
|
+
...options.connectionOptions,
|
|
366
|
+
serialization: { serializer: options.serializer }
|
|
367
|
+
}),
|
|
368
|
+
schemaComponent: require_core.PongoDatabaseSchemaComponent({
|
|
369
|
+
driverType: _event_driven_io_dumbo_pg.PgDriverType,
|
|
370
|
+
collectionFactory: (schema) => require_core.PongoCollectionSchemaComponent({
|
|
371
|
+
driverType: _event_driven_io_dumbo_pg.PgDriverType,
|
|
372
|
+
definition: schema,
|
|
373
|
+
migrationsOrSchemaComponents: { migrations: pongoCollectionPostgreSQLMigrations(schema.name) },
|
|
374
|
+
sqlBuilder: postgresSQLBuilder(schema.name, options.serialization?.serializer ?? _event_driven_io_dumbo.JSONSerializer)
|
|
375
|
+
}),
|
|
376
|
+
definition: options.schema?.definition ?? require_core.pongoSchema.db(databaseName, {})
|
|
377
|
+
}),
|
|
378
|
+
databaseName
|
|
379
|
+
});
|
|
380
|
+
}
|
|
347
381
|
};
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
_pg.NodePostgresDriverType,
|
|
351
|
-
pgDatabaseDriver
|
|
352
|
-
);
|
|
382
|
+
const usePgPongoDriver = () => {
|
|
383
|
+
require_core.pongoDriverRegistry.register(_event_driven_io_dumbo_pg.PgDriverType, pgPongoDriver);
|
|
353
384
|
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
exports.
|
|
385
|
+
usePgPongoDriver();
|
|
386
|
+
|
|
387
|
+
//#endregion
|
|
388
|
+
exports.pgDriver = pgPongoDriver;
|
|
389
|
+
exports.pongoDriver = pgPongoDriver;
|
|
390
|
+
exports.pongoCollectionPostgreSQLMigrations = pongoCollectionPostgreSQLMigrations;
|
|
391
|
+
exports.postgresSQLBuilder = postgresSQLBuilder;
|
|
392
|
+
exports.usePgPongoDriver = usePgPongoDriver;
|
|
362
393
|
//# sourceMappingURL=pg.cjs.map
|