1{
2 fetchFromGitHub,
3 lib,
4 perl,
5 postgresql,
6 postgresqlBuildExtension,
7 postgresqlTestExtension,
8}:
9postgresqlBuildExtension (finalAttrs: {
10 pname = "pgddl";
11 version = "0.30";
12
13 src = fetchFromGitHub {
14 owner = "lacanoid";
15 repo = "pgddl";
16 tag = finalAttrs.version;
17 hash = "sha256-w08IgnobIhlwRGrz+feEnZbI1KrWrMRI4BvNVUZFSSg=";
18 };
19
20 nativeBuildInputs = [
21 perl
22 ];
23
24 preBuild = ''
25 patchShebangs --build ./bin/ ./docs
26 '';
27
28 passthru.tests.extension = postgresqlTestExtension {
29 inherit (finalAttrs) finalPackage;
30 sql = ''
31 CREATE EXTENSION ddlx;
32
33 CREATE TABLE a(i int PRIMARY KEY, j int);
34
35 SELECT ddlx_create('a'::regclass);
36 SELECT ddlx_drop('a'::regclass);
37 SELECT ddlx_script('a'::regclass);
38 '';
39 };
40
41 meta = {
42 description = "DDL eXtractor functions for PostgreSQL";
43 homepage = "https://github.com/lacanoid/pgddl";
44 changelog = "https://github.com/lacanoid/pgddl/releases/tag/${finalAttrs.version}";
45 platforms = postgresql.meta.platforms;
46 maintainers = [ lib.maintainers.joshainglis ];
47 license = lib.licenses.postgresql;
48 };
49})