latticesql 1.6.8 → 1.6.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.
- package/dist/postgres-worker.cjs +16 -0
- package/package.json +1 -1
package/dist/postgres-worker.cjs
CHANGED
|
@@ -23,6 +23,22 @@ function ensureClient() {
|
|
|
23
23
|
extErr instanceof Error ? extErr.message : extErr
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
+
try {
|
|
27
|
+
await client.query(
|
|
28
|
+
`CREATE OR REPLACE FUNCTION json_extract(doc text, path text)
|
|
29
|
+
RETURNS text
|
|
30
|
+
LANGUAGE sql
|
|
31
|
+
IMMUTABLE
|
|
32
|
+
AS $fn$
|
|
33
|
+
SELECT doc::jsonb #>> string_to_array(regexp_replace(path, '^\\$\\.?', ''), '.')
|
|
34
|
+
$fn$;`
|
|
35
|
+
);
|
|
36
|
+
} catch (jeErr) {
|
|
37
|
+
console.warn(
|
|
38
|
+
"[PostgresAdapter] could not register json_extract polyfill:",
|
|
39
|
+
jeErr instanceof Error ? jeErr.message : jeErr
|
|
40
|
+
);
|
|
41
|
+
}
|
|
26
42
|
return { ok: true };
|
|
27
43
|
}
|
|
28
44
|
case "close": {
|
package/package.json
CHANGED