Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__tests__
jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXTENSION = pgpm-base32
DATA = sql/pgpm-base32--0.14.0.sql
DATA = sql/pgpm-base32--0.15.3.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@pgpm/base32"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Futils%2Fbase32%2Fpackage.json"/></a>
<a href="https://www.npmjs.com/package/@pgpm/base32"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fbase32%2Fpackage.json"/></a>
</p>

RFC4648 Base32 encode/decode in plpgsql
Expand Down Expand Up @@ -251,10 +251,10 @@ https://www.youtube.com/watch?v=Va8FLD-iuTg

## Related Tooling

* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/packages/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgsql-parser](https://github.com/constructive-io/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
* [libpg-query-node](https://github.com/constructive-io/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
* [pg-proto-parser](https://github.com/constructive-io/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`base32.decode cases INQXI 1`] = `"Cat"`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`base32.encode case: 1 1`] = `""`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pgpm/base32",
"version": "0.15.2",
"version": "0.16.0",
"description": "Base32 encoding and decoding functions for PostgreSQL",
"author": "Dan Lynch <pyramation@gmail.com>",
"contributors": [
Expand All @@ -21,10 +21,10 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@pgpm/verify": "0.15.2"
"@pgpm/verify": "workspace:*"
},
"devDependencies": {
"pgpm": "^1.0.0"
"pgpm": "^1.3.0"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pgpm-base32 extension
comment = 'pgpm-base32 extension'
default_version = '0.14.0'
default_version = '0.15.3'
module_pathname = '$libdir/pgpm-base32'
requires = 'pgcrypto,plpgsql,pgpm-verify'
relocatable = false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__tests__
jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXTENSION = pgpm-types
DATA = sql/pgpm-types--0.14.0.sql
DATA = sql/pgpm-types--0.15.3.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@pgpm/types"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fdata-types%2Ftypes%2Fpackage.json"/></a>
<a href="https://www.npmjs.com/package/@pgpm/types"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Ftypes%2Fpackage.json"/></a>
</p>

Core PostgreSQL data types with SQL scripts.
Expand Down Expand Up @@ -217,10 +217,10 @@ The test suite validates:

## Related Tooling

* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/packages/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgsql-parser](https://github.com/constructive-io/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
* [libpg-query-node](https://github.com/constructive-io/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
* [pg-proto-parser](https://github.com/constructive-io/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pgpm/types",
"version": "0.15.2",
"version": "0.16.0",
"description": "Core PostgreSQL data types with deploy/verify/revert SQL scripts",
"author": "Dan Lynch <pyramation@gmail.com>",
"contributors": [
Expand All @@ -21,10 +21,10 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@pgpm/verify": "0.15.2"
"@pgpm/verify": "workspace:*"
},
"devDependencies": {
"pgpm": "^1.0.0"
"pgpm": "^1.3.0"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pgpm-types extension
comment = 'pgpm-types extension'
default_version = '0.14.0'
default_version = '0.15.3'
module_pathname = '$libdir/pgpm-types'
requires = 'plpgsql,citext,pgpm-verify'
relocatable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CREATE DOMAIN multiple_select AS jsonb
COMMENT ON DOMAIN multiple_select IS '@name pgpmInternalTypeMultipleSelect';

CREATE DOMAIN origin AS text
CHECK (value = SUBSTRING(value FROM '^(https?://[^/]*)'));
CHECK (value = pg_catalog."substring"(value, '^(https?://[^/]*)'));

COMMENT ON DOMAIN origin IS '@name pgpmInternalTypeOrigin';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__tests__
jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXTENSION = pgpm-uuid
DATA = sql/pgpm-uuid--0.14.0.sql
DATA = sql/pgpm-uuid--0.15.3.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@pgpm/uuid"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fdata-types%2Fuuid%2Fpackage.json"/></a>
<a href="https://www.npmjs.com/package/@pgpm/uuid"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fuuid%2Fpackage.json"/></a>
</p>

UUID utilities and extensions for PostgreSQL.
Expand Down Expand Up @@ -273,10 +273,10 @@ The test suite validates:

## Related Tooling

* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/packages/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgsql-parser](https://github.com/constructive-io/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
* [libpg-query-node](https://github.com/constructive-io/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
* [pg-proto-parser](https://github.com/constructive-io/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pgpm/uuid",
"version": "0.15.2",
"version": "0.16.0",
"description": "UUID utilities and extensions for PostgreSQL",
"author": "Dan Lynch <pyramation@gmail.com>",
"contributors": [
Expand All @@ -21,10 +21,10 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@pgpm/verify": "0.15.2"
"@pgpm/verify": "workspace:*"
},
"devDependencies": {
"pgpm": "^1.0.0"
"pgpm": "^1.3.0"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pgpm-uuid extension
comment = 'pgpm-uuid extension'
default_version = '0.14.0'
default_version = '0.15.3'
module_pathname = '$libdir/pgpm-uuid'
requires = 'pgcrypto,plpgsql,uuid-ossp,hstore,pgpm-verify'
relocatable = false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__tests__
jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EXTENSION = pgpm-verify
DATA = sql/pgpm-verify--0.14.0.sql
DATA = sql/pgpm-verify--0.15.3.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
</a>
<a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
<a href="https://www.npmjs.com/package/@pgpm/verify"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Futils%2Fverify%2Fpackage.json"/></a>
<a href="https://www.npmjs.com/package/@pgpm/verify"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fverify%2Fpackage.json"/></a>
</p>

Verification utilities for PostgreSQL modules
Expand Down Expand Up @@ -345,7 +345,7 @@ Every pgpm module depends on `@pgpm/verify`:
```json
{
"dependencies": {
"@pgpm/verify": "0.15.0"
"@pgpm/verify": "workspace:*"
}
}
```
Expand Down Expand Up @@ -438,10 +438,10 @@ None - this is the foundational package that all other packages depend on.

## Related Tooling

* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgpm](https://github.com/constructive-io/constructive/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/packages/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/packages/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/packages/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
* [pgsql-parser](https://github.com/constructive-io/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
* [libpg-query-node](https://github.com/constructive-io/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
* [pg-proto-parser](https://github.com/constructive-io/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,26 @@ CREATE FUNCTION verify_function (_name text, _user text DEFAULT NULL)
AS $$
DECLARE
check_user text;
func_oid oid;
BEGIN
IF (_user IS NOT NULL) THEN
check_user = _user;
ELSE
check_user = CURRENT_USER;
END IF;
IF position('(' IN _name) > 0 THEN
func_oid = to_regprocedure(_name);
IF func_oid IS NULL THEN
RAISE EXCEPTION 'Nonexistent function --> %', _name
USING HINT = 'Please check';
END IF;
IF has_function_privilege(check_user, func_oid, 'execute') THEN
RETURN TRUE;
ELSE
RAISE EXCEPTION 'Nonexistent function --> %', _name
USING HINT = 'Please check';
END IF;
END IF;
IF EXISTS (
SELECT
has_function_privilege(check_user, p.oid, 'execute')
Expand All @@ -34,4 +48,3 @@ $$
LANGUAGE 'plpgsql'
IMMUTABLE;
COMMIT;

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pgpm/verify",
"version": "0.15.2",
"version": "0.16.0",
"description": "Verification utilities for PGPM deploy/verify/revert workflow",
"author": "Dan Lynch <pyramation@gmail.com>",
"contributors": [
Expand All @@ -21,7 +21,7 @@
"test:watch": "jest --watch"
},
"devDependencies": {
"pgpm": "^1.0.0"
"pgpm": "^1.3.0"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pgpm-verify extension
comment = 'pgpm-verify extension'
default_version = '0.14.0'
default_version = '0.15.3'
module_pathname = '$libdir/pgpm-verify'
requires = 'plpgsql'
relocatable = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,26 @@ $EOFCODE$ LANGUAGE plpgsql IMMUTABLE;
CREATE FUNCTION verify_function(_name text, _user text DEFAULT NULL) RETURNS boolean AS $EOFCODE$
DECLARE
check_user text;
func_oid oid;
BEGIN
IF (_user IS NOT NULL) THEN
check_user = _user;
ELSE
check_user = CURRENT_USER;
END IF;
IF position('(' IN _name) > 0 THEN
func_oid = to_regprocedure(_name);
IF func_oid IS NULL THEN
RAISE EXCEPTION 'Nonexistent function --> %', _name
USING HINT = 'Please check';
END IF;
IF has_function_privilege(check_user, func_oid, 'execute') THEN
RETURN TRUE;
ELSE
RAISE EXCEPTION 'Nonexistent function --> %', _name
USING HINT = 'Please check';
END IF;
END IF;
IF EXISTS (
SELECT
has_function_privilege(check_user, p.oid, 'execute')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
EXTENSION = sample-unique-names
DATA = sql/sample-unique-names--0.0.1.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@constructive-io/unique-names",
"name": "@constructive-io/sample-unique-names",
"version": "0.0.1",
"author": "Constructive <developers@constructive.io>",
"description": "undefined",
Expand Down
Loading