@pgpm/inflection 0.7.2 → 0.9.0
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/Makefile +1 -1
- package/README.md +3 -3
- package/deploy/extension/defaults.sql +8 -0
- package/deploy/schemas/inflection/procedures/lower.sql +13 -0
- package/deploy/schemas/inflection/procedures/slugify_trigger.sql +21 -0
- package/deploy/schemas/inflection/procedures/upper.sql +13 -0
- package/launchql-inflection.control +1 -1
- package/package.json +3 -3
- package/revert/extension/defaults.sql +5 -0
- package/revert/schemas/inflection/procedures/lower.sql +7 -0
- package/revert/schemas/inflection/procedures/slugify_trigger.sql +7 -0
- package/revert/schemas/inflection/procedures/upper.sql +7 -0
- package/verify/extension/defaults.sql +5 -0
- package/verify/schemas/inflection/procedures/lower.sql +7 -0
- package/verify/schemas/inflection/procedures/slugify_trigger.sql +7 -0
- package/verify/schemas/inflection/procedures/upper.sql +7 -0
- /package/sql/{launchql-inflection--0.6.0.sql → launchql-inflection--0.7.2.sql} +0 -0
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -67,13 +67,13 @@ pgpm deploy
|
|
|
67
67
|
```bash
|
|
68
68
|
# 1. Create a workspace
|
|
69
69
|
pgpm init --workspace
|
|
70
|
-
cd my-app
|
|
71
70
|
|
|
72
71
|
# 2. Create your first module
|
|
72
|
+
cd my-workspace
|
|
73
73
|
pgpm init
|
|
74
|
-
cd packages/your-module
|
|
75
74
|
|
|
76
|
-
# 3. Install a package
|
|
75
|
+
# 3. Install a package
|
|
76
|
+
cd packages/my-module
|
|
77
77
|
pgpm install @pgpm/inflection
|
|
78
78
|
|
|
79
79
|
# 4. Deploy everything
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Deploy schemas/inflection/procedures/lower to pg
|
|
2
|
+
|
|
3
|
+
-- requires: schemas/inflection/schema
|
|
4
|
+
|
|
5
|
+
BEGIN;
|
|
6
|
+
|
|
7
|
+
CREATE FUNCTION inflection.lower ( str text ) RETURNS text AS $EOFCODE$
|
|
8
|
+
BEGIN
|
|
9
|
+
return lower(str);
|
|
10
|
+
END;
|
|
11
|
+
$EOFCODE$ LANGUAGE plpgsql STABLE;
|
|
12
|
+
|
|
13
|
+
COMMIT;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Deploy schemas/inflection/procedures/slugify_trigger to pg
|
|
2
|
+
|
|
3
|
+
-- requires: schemas/inflection/schema
|
|
4
|
+
-- requires: schemas/inflection/procedures/slugify
|
|
5
|
+
|
|
6
|
+
BEGIN;
|
|
7
|
+
|
|
8
|
+
-- USAGE inflection.slugify_trigger ('field_name')
|
|
9
|
+
|
|
10
|
+
CREATE FUNCTION inflection.slugify_trigger()
|
|
11
|
+
RETURNS TRIGGER AS $$
|
|
12
|
+
DECLARE
|
|
13
|
+
value text := to_json(NEW) ->> TG_ARGV[0];
|
|
14
|
+
BEGIN
|
|
15
|
+
NEW := NEW #= (TG_ARGV[0] || '=>' || inflection.slugify(value))::hstore;
|
|
16
|
+
RETURN NEW;
|
|
17
|
+
END;
|
|
18
|
+
$$
|
|
19
|
+
LANGUAGE 'plpgsql' VOLATILE;
|
|
20
|
+
|
|
21
|
+
COMMIT;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Deploy schemas/inflection/procedures/upper to pg
|
|
2
|
+
|
|
3
|
+
-- requires: schemas/inflection/schema
|
|
4
|
+
|
|
5
|
+
BEGIN;
|
|
6
|
+
|
|
7
|
+
CREATE FUNCTION inflection.upper ( str text ) RETURNS text AS $EOFCODE$
|
|
8
|
+
BEGIN
|
|
9
|
+
return upper(str);
|
|
10
|
+
END;
|
|
11
|
+
$EOFCODE$ LANGUAGE plpgsql STABLE;
|
|
12
|
+
|
|
13
|
+
COMMIT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/inflection",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "String inflection utilities for PostgreSQL naming conventions",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test:watch": "jest --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pgpm/verify": "0.
|
|
24
|
+
"@pgpm/verify": "0.9.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"pgpm": "^0.2.0"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/launchql/pgpm-modules/issues"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "7cb34c75176e820a490de0442814425303a3ab1f"
|
|
38
38
|
}
|
|
File without changes
|