Files
nixpkgs/pkgs/servers/sql/postgresql/ext/pg_squeeze.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

52 lines
1.5 KiB
Nix

{
fetchFromGitHub,
lib,
nix-update-script,
postgresql,
postgresqlBuildExtension,
postgresqlTestExtension,
}:
postgresqlBuildExtension (finalAttrs: {
pname = "pg_squeeze";
version = "1.9.1";
src = fetchFromGitHub {
owner = "cybertec-postgresql";
repo = "pg_squeeze";
tag = "REL${lib.replaceString "." "_" finalAttrs.version}";
hash = "sha256-KbCS3kg2MoxKHl+35UOFCSF4kPPsIMeO7AfwfHZYZVg=";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex=^REL(\\d+)_(\\d+)_(\\d+)$" ];
};
passthru.tests.extension = postgresqlTestExtension {
inherit (finalAttrs) finalPackage;
postgresqlExtraSettings = ''
wal_level = logical
shared_preload_libraries = 'pg_squeeze'
'';
sql = ''
CREATE EXTENSION pg_squeeze;
SELECT squeeze.start_worker();
CREATE TABLE a(i int PRIMARY KEY, j int);
INSERT INTO a(i, j) SELECT x, x FROM generate_series(1, 20) AS g(x);
INSERT INTO squeeze.tables (tabschema, tabname, schedule)
VALUES ('public', 'a', ('{30}', '{22}', NULL, NULL, '{3, 5}'));
SELECT squeeze.squeeze_table('public', 'a', NULL, NULL, NULL);
'';
};
meta = {
description = "PostgreSQL extension for automatic bloat cleanup";
homepage = "https://github.com/cybertec-postgresql/pg_squeeze";
changelog = "https://github.com/cybertec-postgresql/pg_squeeze/blob/${finalAttrs.src.rev}/NEWS";
license = lib.licenses.mit;
maintainers = [ ];
platforms = postgresql.meta.platforms;
};
})