@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 CHANGED
@@ -1,5 +1,5 @@
1
1
  EXTENSION = launchql-inflection
2
- DATA = sql/launchql-inflection--0.6.0.sql
2
+ DATA = sql/launchql-inflection--0.7.2.sql
3
3
 
4
4
  PG_CONFIG = pg_config
5
5
  PGXS := $(shell $(PG_CONFIG) --pgxs)
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,8 @@
1
+ -- Deploy extension/defaults to pg
2
+
3
+ BEGIN;
4
+
5
+ -- hstore, unaccent
6
+ GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public to public;
7
+
8
+ COMMIT;
@@ -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;
@@ -1,6 +1,6 @@
1
1
  # launchql-inflection extension
2
2
  comment = 'launchql-inflection extension'
3
- default_version = '0.6.0'
3
+ default_version = '0.7.2'
4
4
  module_pathname = '$libdir/launchql-inflection'
5
5
  requires = 'plpgsql,unaccent,uuid-ossp,launchql-verify'
6
6
  relocatable = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpm/inflection",
3
- "version": "0.7.2",
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.7.2"
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": "e7d646fafaaa1dfd1c15413c875a8844d7500707"
37
+ "gitHead": "7cb34c75176e820a490de0442814425303a3ab1f"
38
38
  }
@@ -0,0 +1,5 @@
1
+ -- Revert extension/defaults from pg
2
+
3
+ BEGIN;
4
+
5
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/inflection/procedures/lower from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP FUNCTION inflection.lower;
6
+
7
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/inflection/procedures/slugify_trigger from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP FUNCTION inflection.slugify_trigger;
6
+
7
+ COMMIT;
@@ -0,0 +1,7 @@
1
+ -- Revert schemas/inflection/procedures/upper from pg
2
+
3
+ BEGIN;
4
+
5
+ DROP FUNCTION inflection.upper;
6
+
7
+ COMMIT;
@@ -0,0 +1,5 @@
1
+ -- Verify extension/defaults on pg
2
+
3
+ BEGIN;
4
+
5
+ ROLLBACK;
@@ -0,0 +1,7 @@
1
+ -- Verify schemas/inflection/procedures/lower on pg
2
+
3
+ BEGIN;
4
+
5
+ SELECT verify_function ('inflection.lower');
6
+
7
+ ROLLBACK;
@@ -0,0 +1,7 @@
1
+ -- Verify schemas/inflection/procedures/slugify_trigger on pg
2
+
3
+ BEGIN;
4
+
5
+ SELECT verify_function ('inflection.slugify_trigger');
6
+
7
+ ROLLBACK;
@@ -0,0 +1,7 @@
1
+ -- Verify schemas/inflection/procedures/upper on pg
2
+
3
+ BEGIN;
4
+
5
+ SELECT verify_function ('inflection.upper');
6
+
7
+ ROLLBACK;