2025-01-30 20:49:27 +11:00
|
|
|
{
|
|
|
|
fetchFromGitHub,
|
2025-03-16 21:24:13 +01:00
|
|
|
lib,
|
|
|
|
perl,
|
2025-01-30 20:49:27 +11:00
|
|
|
postgresql,
|
2025-03-16 21:28:21 +01:00
|
|
|
postgresqlBuildExtension,
|
2025-01-30 20:49:27 +11:00
|
|
|
postgresqlTestExtension,
|
|
|
|
}:
|
2025-03-16 21:28:21 +01:00
|
|
|
postgresqlBuildExtension (finalAttrs: {
|
2025-01-30 20:49:27 +11:00
|
|
|
pname = "pgddl";
|
|
|
|
version = "0.29";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lacanoid";
|
|
|
|
repo = "pgddl";
|
|
|
|
tag = finalAttrs.version;
|
|
|
|
hash = "sha256-W3G6TGtkj+zXXdGZZR0bmZhsLuFJvuGTlDoo8kL8sf0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
})
|