diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7c37f19b83..76b142dc5d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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: @@ -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: diff --git a/default.nix b/default.nix index 2161e2624c..3f71470fb5 100644 --- a/default.nix +++ b/default.nix @@ -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}"; diff --git a/flake.lock b/flake.lock index 3790b4d6a0..d3dfcc0fc1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1776949667, - "narHash": "sha256-GMSVw35Q+294GlrTUKlx087E31z7KurReQ1YHSKp5iw=", - "owner": "nixos", + "lastModified": 1779177828, + "narHash": "sha256-LCuIW0kiSTboZfrHi8j8XeW0eSSuemgZb3F2qh/8ls4=", + "owner": "wolfgangwalther", "repo": "nixpkgs", - "rev": "01fbdeef22b76df85ea168fbfe1bfd9e63681b30", + "rev": "902290b17a41239f0d0001f5e95670240de4104c", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", + "owner": "wolfgangwalther", + "ref": "orioledb-latest", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index cb5d488539..e401a2b90c 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index da7d72fe01..0d41949dcc 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -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 { diff --git a/test/io/fixtures/big_schema.sql b/test/io/fixtures/big_schema.sql index 559b434dff..bcc41de512 100644 --- a/test/io/fixtures/big_schema.sql +++ b/test/io/fixtures/big_schema.sql @@ -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 diff --git a/test/io/fixtures/load.sql b/test/io/fixtures/load.sql index 2764672366..0f81bd7ea6 100644 --- a/test/io/fixtures/load.sql +++ b/test/io/fixtures/load.sql @@ -2,6 +2,7 @@ \set ON_ERROR_STOP on +\ir ../../orioledb.sql \ir database.sql \ir db_config.sql \ir roles.sql diff --git a/test/load/fixtures.sql b/test/load/fixtures.sql index 75bd6a8bb2..736c23e8a8 100644 --- a/test/load/fixtures.sql +++ b/test/load/fixtures.sql @@ -1,3 +1,5 @@ +\ir ../orioledb.sql + CREATE ROLE postgrest_test_anonymous; CREATE ROLE postgrest_test_author; GRANT postgrest_test_anonymous TO :"PGUSER"; diff --git a/test/observability/fixtures/load.sql b/test/observability/fixtures/load.sql index 135404c832..8e5ca17708 100644 --- a/test/observability/fixtures/load.sql +++ b/test/observability/fixtures/load.sql @@ -2,6 +2,7 @@ \set ON_ERROR_STOP on +\ir ../../orioledb.sql \ir database.sql \ir roles.sql \ir schema.sql diff --git a/test/orioledb.sql b/test/orioledb.sql new file mode 100644 index 0000000000..5800830031 --- /dev/null +++ b/test/orioledb.sql @@ -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 diff --git a/test/spec/Feature/Query/EmbedInnerJoinSpec.hs b/test/spec/Feature/Query/EmbedInnerJoinSpec.hs index 580bf5c374..0b33860a97 100644 --- a/test/spec/Feature/Query/EmbedInnerJoinSpec.hs +++ b/test/spec/Feature/Query/EmbedInnerJoinSpec.hs @@ -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}, diff --git a/test/spec/fixtures/load.sql b/test/spec/fixtures/load.sql index c73f86b7b1..fed2fa1f3d 100644 --- a/test/spec/fixtures/load.sql +++ b/test/spec/fixtures/load.sql @@ -2,6 +2,7 @@ \set ON_ERROR_STOP on +\ir ../../orioledb.sql \ir database.sql \ir roles.sql \ir schema.sql