Skip to content

Commit 653f1bb

Browse files
committed
add pgmq SQL only extension
1 parent b661336 commit 653f1bb

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
./nix/ext/pgroonga.nix
9595
./nix/ext/index_advisor.nix
9696
./nix/ext/wal2json.nix
97+
./nix/ext/pgmq.nix
9798
./nix/ext/pg_repack.nix
9899
./nix/ext/pg-safeupdate.nix
99100
./nix/ext/plpgsql-check.nix

nix/docs/migration-tests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ compare, and you could do something like the following:
4343
OLD_GIT_VERSION=...
4444
NEW_GIT_VERSION=...
4545
46-
nix run github:supabase/nix-postgres#migration-test \
47-
$(nix build "github:supabase/nix-postgres/$OLD_GIT_VERSION#psql_14/bin") \
48-
$(nix build "github:supabase/nix-postgres/$NEW_GIT_VERSION#psql_14/bin") \
46+
nix run github:supabase/nix-postgres#migration-test wrappers \
47+
$(nix build "github:supabase/postgres/$OLD_GIT_VERSION#psql_14/bin") \
48+
$(nix build "github:supabase/postgres/$NEW_GIT_VERSION#psql_14/bin") \
4949
pg_upgrade
5050
```

nix/ext/pgmq.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{ lib, stdenv, fetchFromGitHub, postgresql }:
2+
3+
stdenv.mkDerivation rec {
4+
pname = "pgmq";
5+
version = "1.4.0";
6+
7+
buildInputs = [ postgresql ];
8+
9+
src = fetchFromGitHub {
10+
owner = "tembo-io";
11+
repo = pname;
12+
rev = "v${version}";
13+
hash = "sha256-k7iKp2CZY3M8POUqIOIbKxrofoOfn2FxfVW01KYojPA=";
14+
};
15+
16+
buildPhase = ''
17+
cd pgmq-extension
18+
'';
19+
20+
installPhase = ''
21+
mkdir -p $out/{lib,share/postgresql/extension}
22+
23+
mv sql/pgmq.sql $out/share/postgresql/extension/pgmq--${version}.sql
24+
cp sql/*.sql $out/share/postgresql/extension
25+
cp *.control $out/share/postgresql/extension
26+
'';
27+
28+
meta = with lib; {
29+
description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.";
30+
homepage = "https://github.com/tembo-io/pgmq";
31+
maintainers = with maintainers; [ olirice ];
32+
platforms = postgresql.meta.platforms;
33+
license = licenses.postgresql;
34+
};
35+
}

nix/tests/migrations/wrappers.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if version > 0.3.1
2+
3+
create fdw .... stripe
4+
5+
if version > 0.4.1
6+
create fdw ... wasm

0 commit comments

Comments
 (0)