Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# Latest version is tested via `coverage` above.
pgVersion: [14, 15, 16, 17]
name: PG ${{ matrix.pgVersion }}
pgVersion: [pg-14, pg-15, pg-16, pg-17, oriole-17]
name: ${{ matrix.pgVersion }}
runs-on: ubuntu-24.04
defaults:
run:
Expand All @@ -85,25 +84,25 @@ jobs:
uses: ./.github/actions/setup-nix
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
tools: tests.testSpec.bin tests.testObservability.bin tests.testIO.bin tests.testBigSchema.bin withTools.pg-${{ matrix.pgVersion }}.bin cabalTools.update.bin
tools: tests.testSpec.bin tests.testObservability.bin tests.testIO.bin tests.testBigSchema.bin withTools.${{ matrix.pgVersion }}.bin cabalTools.update.bin

- run: postgrest-cabal-update

- name: Run spec tests
if: always()
run: postgrest-with-pg-${{ matrix.pgVersion }} postgrest-test-spec
run: postgrest-with-${{ matrix.pgVersion }} postgrest-test-spec

- name: Run observability tests
if: always()
run: postgrest-with-pg-${{ matrix.pgVersion }} postgrest-test-observability
run: postgrest-with-${{ matrix.pgVersion }} postgrest-test-observability

- name: Run IO tests
if: always()
run: postgrest-with-pg-${{ matrix.pgVersion }} postgrest-test-io -vv
run: postgrest-with-${{ matrix.pgVersion }} postgrest-test-io -vv

- name: Run IO tests on a big schema
if: always()
run: postgrest-with-pg-${{ matrix.pgVersion }} postgrest-test-big-schema -vv
run: postgrest-with-${{ matrix.pgVersion }} postgrest-test-big-schema -vv


memory:
Expand Down
8 changes: 8 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ let
{ name = "pg-16"; postgresql = pkgs.postgresql_16.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{ name = "pg-15"; postgresql = pkgs.postgresql_15.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{ name = "pg-14"; postgresql = pkgs.postgresql_14.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{
name = "oriole-17";
postgresql = pkgs.orioledb.withPackages (p: [ p.postgis p.pg_safeupdate ]);
config = "
default_table_access_method = 'orioledb'
shared_preload_libraries = 'orioledb'
";
}
];

haskellPackages = pkgs.haskell.packages."${compiler}";
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "REST API for any Postgres database";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:wolfgangwalther/nixpkgs/orioledb-latest";
};

nixConfig = {
Expand Down
6 changes: 3 additions & 3 deletions nix/tools/withTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
}:
let
withTmpDb =
{ name, postgresql }:
{ name, postgresql, config ? "" }:
let
commandName = "postgrest-with-${name}";
postgresqlConf = writeText "postgresql.conf" "
postgresqlConf = writeText "postgresql.conf" ("
autovacuum = false
listen_addresses = ''
log_statement = all
";
" + config);
in
checkedShellScript
{
Expand Down
2 changes: 2 additions & 0 deletions test/io/fixtures/big_schema.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
\ir ../../orioledb.sql

/*
This is a 2018 version of the apflora schema https://github.com/barbalex/apf2/tree/master/sql/apflora - latest version likely has differing contents

Expand Down
1 change: 1 addition & 0 deletions test/io/fixtures/load.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

\set ON_ERROR_STOP on

\ir ../../orioledb.sql
\ir database.sql
\ir db_config.sql
\ir roles.sql
Expand Down
2 changes: 2 additions & 0 deletions test/load/fixtures.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
\ir ../orioledb.sql

CREATE ROLE postgrest_test_anonymous;
CREATE ROLE postgrest_test_author;
GRANT postgrest_test_anonymous TO :"PGUSER";
Expand Down
1 change: 1 addition & 0 deletions test/observability/fixtures/load.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

\set ON_ERROR_STOP on

\ir ../../orioledb.sql
\ir database.sql
\ir roles.sql
\ir schema.sql
Expand Down
6 changes: 6 additions & 0 deletions test/orioledb.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT EXISTS (SELECT * FROM pg_available_extensions WHERE name = 'orioledb') AS is_orioledb_available \gset

\if :is_orioledb_available
CREATE SCHEMA orioledb;
CREATE EXTENSION orioledb WITH SCHEMA orioledb;
\endif
2 changes: 1 addition & 1 deletion test/spec/Feature/Query/EmbedInnerJoinSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec =
}

it "only affects the source table rows if his direct embedding is an inner join" $ do
get "/tasks?select=id,projects(id,clients!inner(id))&projects.clients.id=eq.2" `shouldRespondWith`
get "/tasks?select=id,projects(id,clients!inner(id))&projects.clients.id=eq.2&order=id" `shouldRespondWith`
[json|[
{"id":1,"projects":null},
{"id":2,"projects":null},
Expand Down
1 change: 1 addition & 0 deletions test/spec/fixtures/load.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

\set ON_ERROR_STOP on

\ir ../../orioledb.sql
\ir database.sql
\ir roles.sql
\ir schema.sql
Expand Down
Loading