wabe-postgres 0.5.4 → 0.5.5
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/index.js +19 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4,15 +4,29 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
7
12
|
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
8
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
22
|
for (let key of __getOwnPropNames(mod))
|
|
11
23
|
if (!__hasOwnProp.call(to, key))
|
|
12
24
|
__defProp(to, key, {
|
|
13
|
-
get: (
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
14
26
|
enumerable: true
|
|
15
27
|
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
16
30
|
return to;
|
|
17
31
|
};
|
|
18
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
@@ -4899,7 +4913,7 @@ var getSQLColumnCreateTableFromType = (type) => {
|
|
|
4899
4913
|
case "Array":
|
|
4900
4914
|
return `JSONB${type.required ? " NOT NULL" : " DEFAULT NULL"}`;
|
|
4901
4915
|
case "Pointer":
|
|
4902
|
-
return `
|
|
4916
|
+
return `JSONB${type.required ? " NOT NULL" : " DEFAULT NULL"}`;
|
|
4903
4917
|
case "Relation":
|
|
4904
4918
|
return `JSONB${type.required ? " NOT NULL" : " DEFAULT NULL"}`;
|
|
4905
4919
|
default:
|
|
@@ -4931,7 +4945,7 @@ var buildPostgresWhereQueryAndValues = (where, startParamIndex = 1, parentKey) =
|
|
|
4931
4945
|
return { query: "", values: [], paramIndex: startParamIndex };
|
|
4932
4946
|
const acc = objectKeys.reduce((acc2, key) => {
|
|
4933
4947
|
const value = where[key];
|
|
4934
|
-
const keyToWrite = key === "id" ? "_id" : String(key);
|
|
4948
|
+
const keyToWrite = key === "id" && !parentKey ? "_id" : String(key);
|
|
4935
4949
|
const fullKey = parentKey ? `${parentKey}->>'${keyToWrite}'` : `"${keyToWrite}"`;
|
|
4936
4950
|
const simpleFullKey = parentKey ? `${parentKey}->'${keyToWrite}'` : `"${keyToWrite}"`;
|
|
4937
4951
|
if ("equalTo" in (value || {})) {
|
|
@@ -5088,6 +5102,8 @@ var computeValuesFromData = (data) => {
|
|
|
5088
5102
|
return Object.values(data).map((value) => {
|
|
5089
5103
|
if (Array.isArray(value))
|
|
5090
5104
|
return JSON.stringify(value);
|
|
5105
|
+
if (value && typeof value === "object" && !(value instanceof Date))
|
|
5106
|
+
return JSON.stringify(value);
|
|
5091
5107
|
return value;
|
|
5092
5108
|
});
|
|
5093
5109
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wabe-postgres",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "PostgreSQL adapter for Wabe (official)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"wabe"
|
|
11
11
|
],
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
|
-
"type": "module",
|
|
14
13
|
"files": [
|
|
15
14
|
"dist"
|
|
16
15
|
],
|
|
16
|
+
"type": "module",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"types": "dist/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/pg": "8.11.11",
|
|
32
32
|
"get-port": "7.1.0",
|
|
33
33
|
"uuid": "13.0.0",
|
|
34
|
-
"wabe": "0.6.
|
|
34
|
+
"wabe": "0.6.13",
|
|
35
35
|
"wabe-postgres-launcher": "0.5.0"
|
|
36
36
|
}
|
|
37
37
|
}
|