Skip to content

Commit

Permalink
postgresqlPackages.pgddl: init at 0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
joshainglis committed Feb 1, 2025
1 parent 65b3b59 commit 398000e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/servers/sql/postgresql/ext/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ in {
tsja = super.callPackage ./tsja.nix { };

wal2json = super.callPackage ./wal2json.nix { };

pgddl = super.callPackage ./pgddl.nix {};
} // lib.optionalAttrs config.allowAliases {
pg_embedding = throw "PostgreSQL extension `pg_embedding` has been removed since the project has been abandoned. Upstream's recommendation is to use pgvector instead (https://neon.tech/docs/extensions/pg_embedding#migrate-from-pg_embedding-to-pgvector)";
}
52 changes: 52 additions & 0 deletions pkgs/servers/sql/postgresql/ext/pgddl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
lib,
fetchFromGitHub,
postgresql,
buildPostgresqlExtension,
postgresqlTestExtension,
perl,
}:
buildPostgresqlExtension (finalAttrs: {
pname = "pgddl";
version = "0.29";

src = fetchFromGitHub {
owner = "lacanoid";
repo = "pgddl";
tag = finalAttrs.version;
hash = "sha256-W3G6TGtkj+zXXdGZZR0bmZhsLuFJvuGTlDoo8kL8sf0=";
};

strictDeps = true;

nativeBuildInputs = [
postgresql
perl
];

preBuild = ''
patchShebangs --build ./bin/ ./docs
'';

passthru.tests.extension = postgresqlTestExtension {
inherit (finalAttrs) finalPackage;
sql = ''
CREATE EXTENSION ddlx;
CREATE TABLE a(i int PRIMARY KEY, j int);
SELECT ddlx_create('a'::regclass);
SELECT ddlx_drop('a'::regclass);
SELECT ddlx_script('a'::regclass);
'';
};

meta = {
description = "DDL eXtractor functions for PostgreSQL";
homepage = "https://github.com/lacanoid/pgddl";
changelog = "https://github.com/lacanoid/pgddl/releases/tag/${finalAttrs.version}";
platforms = postgresql.meta.platforms;
maintainers = [ lib.maintainers.joshainglis ];
license = lib.licenses.postgresql;
};
})

0 comments on commit 398000e

Please sign in to comment.