2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "pgcat";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "1.1.1";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "postgresml";
|
|
|
|
repo = "pgcat";
|
|
|
|
rev = "v${version}";
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-BERxdGgPk8POnhLsyy4lKV4LCoHsJTmv2OhAOz6CKKc=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
cargoHash = "sha256-GwcqR8pEvz42NEmcuXpcoPdChzRBYsDEnllX62T8ulQ=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# requires network access
|
|
|
|
"--skip=dns_cache::CachedResolver::lookup_ip"
|
|
|
|
"--skip=dns_cache::CachedResolver::new"
|
|
|
|
"--skip=dns_cache::CachedResolver"
|
|
|
|
"--skip=dns_cache::tests::has_changed"
|
|
|
|
"--skip=dns_cache::tests::incorrect_address"
|
|
|
|
"--skip=dns_cache::tests::lookup_ip"
|
|
|
|
"--skip=dns_cache::tests::new"
|
|
|
|
"--skip=dns_cache::tests::thread"
|
|
|
|
"--skip=dns_cache::tests::unknown_host"
|
|
|
|
];
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/pgcat --version | grep "pgcat ${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/postgresml/pgcat";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "PostgreSQL pooler with sharding, load balancing and failover support";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = with licenses; [mit];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [cathalmullan];
|
2023-08-10 07:59:29 +00:00
|
|
|
mainProgram = "pgcat";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|