@pgpm/inflection 0.8.0 → 0.10.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.7.2.sql
2
+ DATA = sql/launchql-inflection--0.9.0.sql
3
3
 
4
4
  PG_CONFIG = pg_config
5
5
  PGXS := $(shell $(PG_CONFIG) --pgxs)
package/README.md CHANGED
@@ -297,7 +297,7 @@ SELECT slug FROM blog_posts;
297
297
 
298
298
  ## Integration Examples
299
299
 
300
- ### With @pgpm/meta-db
300
+ ### With @pgpm/db-meta-schema
301
301
 
302
302
  Use inflection for schema introspection and code generation:
303
303
 
@@ -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.7.2'
3
+ default_version = '0.9.0'
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.8.0",
3
+ "version": "0.10.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.8.0"
24
+ "@pgpm/verify": "0.10.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": "76daa8923128fd8f93a8fd5303239ec998c0bf98"
37
+ "gitHead": "635229dda2c02beeeb2aabb45d3b963026f8700e"
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;