@saltcorn/postgres 0.6.2-beta.5 → 0.6.3-beta.2
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/package.json +2 -2
- package/postgres.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/postgres",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3-beta.2",
|
|
4
4
|
"description": "Postgres structures for Saltcorn, open-source no-code platform",
|
|
5
5
|
"homepage": "https://saltcorn.com",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"main": "index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@saltcorn/db-common": "0.6.
|
|
15
|
+
"@saltcorn/db-common": "0.6.3-beta.2",
|
|
16
16
|
"pg": "^8.2.1",
|
|
17
17
|
"pg-copy-streams": "^5.1.1"
|
|
18
18
|
},
|
package/postgres.js
CHANGED
|
@@ -373,6 +373,12 @@ const copyFrom = async (fileStream, tableName, fieldNames, client) => {
|
|
|
373
373
|
return await promisify(pipeline)(fileStream, stream);
|
|
374
374
|
};
|
|
375
375
|
|
|
376
|
+
const slugify = (s) =>
|
|
377
|
+
s
|
|
378
|
+
.toLowerCase()
|
|
379
|
+
.replace(/\s+/g, "-")
|
|
380
|
+
.replace(/[^\w-]/g, "");
|
|
381
|
+
|
|
376
382
|
const postgresExports = {
|
|
377
383
|
pool,
|
|
378
384
|
/**
|
|
@@ -405,6 +411,7 @@ const postgresExports = {
|
|
|
405
411
|
reset_sequence,
|
|
406
412
|
getVersion,
|
|
407
413
|
copyFrom,
|
|
414
|
+
slugify,
|
|
408
415
|
};
|
|
409
416
|
|
|
410
417
|
module.exports = (getConnectObjectPara) => {
|