From a7c5b02fd2ab4c51a27f61b4f71ac41434f54a26 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 16 Jun 2025 10:22:45 -0400 Subject: [PATCH 001/134] feat: add an action that handles git checkouts for all workflows (#1644) --- .github/actions/shared-checkout/action.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/actions/shared-checkout/action.yml diff --git a/.github/actions/shared-checkout/action.yml b/.github/actions/shared-checkout/action.yml new file mode 100644 index 000000000..59a236db8 --- /dev/null +++ b/.github/actions/shared-checkout/action.yml @@ -0,0 +1,12 @@ +name: Checkout +description: Checkout repository for pull requests and branches +runs: + using: "composite" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} + fetch-depth: 0 + fetch-tags: true From 2bdd0f95f5fa5673849349e4ff761be1c56c2afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 17 Jun 2025 14:35:39 +0200 Subject: [PATCH 002/134] feat: allow checkout of fork repository on workflow approval (#1643) * feat: allow checkout of fork repository on workflow approval Based on #1635 * Do not use secrets if they are not available In the forks, secrets are not available. --- .github/workflows/ami-release-nix-single.yml | 2 +- .github/workflows/ami-release-nix.yml | 6 ++--- .github/workflows/check-shellscripts.yml | 3 ++- .github/workflows/ci.yml | 2 +- .../workflows/dockerhub-release-matrix.yml | 14 ++++++---- .github/workflows/manual-docker-release.yml | 14 ++++++---- .github/workflows/mirror-postgrest.yml | 3 ++- .github/workflows/nix-build.yml | 12 +++------ .github/workflows/publish-migrations-prod.yml | 4 +-- .../workflows/publish-migrations-staging.yml | 3 +-- ...ublish-nix-pgupgrade-bin-flake-version.yml | 10 +++---- .../publish-nix-pgupgrade-scripts.yml | 8 +++--- .github/workflows/qemu-image-build.yml | 4 +-- .github/workflows/test.yml | 7 ++--- .github/workflows/testinfra-ami-build.yml | 4 +-- docker/nix/build_nix.sh | 27 +++++++++++-------- 16 files changed, 67 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 86a1d40fc..863135ef3 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD with: ref: ${{ github.event.inputs.branch }} diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 004a597d7..ee78de99c 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -22,8 +22,8 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL versions @@ -48,7 +48,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main diff --git a/.github/workflows/check-shellscripts.yml b/.github/workflows/check-shellscripts.yml index ab0f59b87..aabf17413 100644 --- a/.github/workflows/check-shellscripts.yml +++ b/.github/workflows/check-shellscripts.yml @@ -14,7 +14,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Run ShellCheck uses: ludeeus/action-shellcheck@master env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93a2afdc5..f10f5f58e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Load postgres_release values id: load_postgres_release diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index ed7075d1d..1ac5b2ccc 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: DeterminateSystems/nix-installer-action@main - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Generate build matrix id: set-matrix run: | @@ -53,7 +53,8 @@ jobs: outputs: build_args: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV @@ -77,7 +78,8 @@ jobs: runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - run: docker context create builders - uses: docker/setup-buildx-action@v3 @@ -132,7 +134,8 @@ jobs: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v2 @@ -175,7 +178,8 @@ jobs: needs: [prepare, merge_manifest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Debug Input from Prepare diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml index 8948324db..e702014dc 100644 --- a/.github/workflows/manual-docker-release.yml +++ b/.github/workflows/manual-docker-release.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: DeterminateSystems/nix-installer-action@main - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Generate build matrix id: set-matrix run: | @@ -50,7 +50,8 @@ jobs: outputs: build_args: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.version }}" >> $GITHUB_ENV @@ -74,7 +75,8 @@ jobs: runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} timeout-minutes: 180 steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - run: docker context create builders - uses: docker/setup-buildx-action@v3 @@ -141,7 +143,8 @@ jobs: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v2 @@ -184,7 +187,8 @@ jobs: needs: [prepare, merge_manifest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main - name: Debug Input from Prepare diff --git a/.github/workflows/mirror-postgrest.yml b/.github/workflows/mirror-postgrest.yml index 1658730f7..0195ab695 100644 --- a/.github/workflows/mirror-postgrest.yml +++ b/.github/workflows/mirror-postgrest.yml @@ -17,7 +17,8 @@ jobs: outputs: postgrest_release: ${{ steps.args.outputs.result }} steps: - - uses: actions/checkout@v4 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - id: args uses: mikefarah/yq@master with: diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index c1811fd00..b6458a807 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -27,15 +27,11 @@ jobs: runs-on: ${{ matrix.runner }} timeout-minutes: 180 steps: - - - name: Check out code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.ref || github.ref }} - fetch-depth: 0 - fetch-tags: true + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: aws-creds uses: aws-actions/configure-aws-credentials@v4 + if: ${{ github.secret_source == 'Actions' }} with: role-to-assume: ${{ secrets.DEV_AWS_ROLE }} aws-region: "us-east-1" @@ -48,7 +44,7 @@ jobs: env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - name: Log in to Docker Hub - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' + if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' && github.secret_source == 'Actions' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/publish-migrations-prod.yml b/.github/workflows/publish-migrations-prod.yml index d7e813667..e3d7365cb 100644 --- a/.github/workflows/publish-migrations-prod.yml +++ b/.github/workflows/publish-migrations-prod.yml @@ -21,8 +21,8 @@ jobs: env: GITHUB_REF: ${{ github.ref }} - - name: Checkout Repo - uses: actions/checkout@v2 + - name: Checkout repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Merging migration files run: cat $(ls -1) > ../migration-output.sql diff --git a/.github/workflows/publish-migrations-staging.yml b/.github/workflows/publish-migrations-staging.yml index 72b28e927..9cef8be4b 100644 --- a/.github/workflows/publish-migrations-staging.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -16,8 +16,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v2 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Merging migration files run: cat $(ls -1) > ../migration-output.sql working-directory: ${{ github.workspace }}/migrations/db/migrations diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index bec85166e..847e6d47c 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -17,8 +17,8 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL versions @@ -36,8 +36,8 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Grab release version @@ -88,7 +88,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Grab release version id: process_release_version diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index ece3e5966..19e255fca 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -24,7 +24,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -43,7 +43,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -94,8 +94,8 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 - + uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - uses: DeterminateSystems/nix-installer-action@main - name: Grab release version diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 708c7faf2..8abee1461 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -23,7 +23,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a218ef882..ac285af26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Clear Nix cache run: | @@ -49,7 +49,8 @@ jobs: POSTGRES_PORT: 5478 POSTGRES_PASSWORD: password steps: - - uses: actions/checkout@v4 + - name: Checkout Repo + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - name: Clear Nix cache run: | sudo rm -rf /home/runner/.cache/nix @@ -86,4 +87,4 @@ jobs: echo "Detected changes in schema.sql:" git diff migrations/schema-${{ env.PGMAJOR }}.sql exit 1 - fi \ No newline at end of file + fi diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 2b07e716f..752bc3938 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -15,7 +15,7 @@ jobs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - uses: DeterminateSystems/nix-installer-action@main @@ -52,7 +52,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: supabase/postgres/.github/actions/shared-checkout@HEAD - id: args uses: mikefarah/yq@master diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh index efaafbe89..8e7d9cfa8 100644 --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -18,11 +18,13 @@ nix build .#wal-g-2 -o wal-g-2 -L nix build .#wal-g-3 -o wal-g-3 -L # Copy to S3 -nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-2 -nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-3 -nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 -nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 -nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_17 +if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-2 + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-3 + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_17 +fi if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_15_debug -o ./postgresql_15_debug @@ -31,10 +33,13 @@ if [ "$SYSTEM" = "aarch64-linux" ]; then nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src nix build .#postgresql_17_debug -o ./postgresql_17_debug nix build .#postgresql_17_src -o ./postgresql_17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src + + if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug + nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src + fi fi From 521a9746cb3afd1b93efb3acd520be903e16308f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 18 Jun 2025 03:53:44 +0200 Subject: [PATCH 003/134] Use nix-fast-build to build all checks (#1642) * Use nix-fast-build to build all checks CI build the required nix packages defined in flake checks. We use the `nix-fast-build` tool to speed up the evaluation and build process. We now use the same GitHub action to install nix. We upload the build results to the cache using a post build hook. * Run nix-fast-build from the GH Actions workflow No need to run an extra shell script to run nix-fast-build. * Upgrade the runners * Fix issue with simultaneous pg build on darwin Make sure each build use different port per version. Make sure they use different pgsodium directories. --- .github/workflows/nix-build.yml | 65 +++++++++++++++++---------------- docker/nix/build_nix.sh | 38 +------------------ flake.nix | 43 +++++++++++----------- 3 files changed, 56 insertions(+), 90 deletions(-) mode change 100644 => 100755 docker/nix/build_nix.sh diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index b6458a807..e95d65a43 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -18,11 +18,11 @@ jobs: fail-fast: false matrix: include: - - runner: larger-runner-4cpu + - runner: large-linux-x86 arch: amd64 - - runner: arm-runner + - runner: large-linux-arm arch: arm64 - - runner: macos-latest + - runner: macos-latest-xlarge arch: arm64 runs-on: ${{ matrix.runner }} timeout-minutes: 180 @@ -43,37 +43,38 @@ jobs: python -c "import os; file = open('nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()" env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - - name: Log in to Docker Hub - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' && github.secret_source == 'Actions' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build psql bundle with nix - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' - run: docker build -t base_nix -f docker/nix/Dockerfile . - - name: Run build psql bundle - if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13' - run: | - docker run -e AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }} \ - -e AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }} \ - -e AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }} \ - base_nix bash -c "./workspace/docker/nix/build_nix.sh" - - name: Build psql bundle on macos - if: matrix.runner == 'macos-latest' || matrix.runner == 'macos-13' + - name: Setup cache script + if: ${{ github.secret_source == 'Actions' }} run: | - curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ - --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ - --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh - cp ./docker/nix/build_nix.sh ./build_nix.sh - sed -i '' '1s|^#!/bin/env bash|#!/usr/bin/env bash|' ./build_nix.sh - chmod +x ./build_nix.sh - ./build_nix.sh + mkdir -p /etc/nix + cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null + #!/usr/bin/env bash + set -eouf + export IFS=' ' + echo /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=nix-secret-key' \$OUT_PATHS + EOF + chmod +x /etc/nix/upload-to-cache.sh + - name: Install nix + uses: DeterminateSystems/nix-installer-action@main + if: ${{ github.secret_source == 'Actions' }} + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + post-build-hook = /etc/nix/upload-to-cache.sh + - name: Install nix + uses: DeterminateSystems/nix-installer-action@main + if: ${{ github.secret_source == 'None' }} + with: + extra-conf: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Build psql bundle + run: > + nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" + -- --skip-cached --no-nom + --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} - - name: build psql bundle on ${{ matrix.arch }} - diff --git a/docker/nix/build_nix.sh b/docker/nix/build_nix.sh old mode 100644 new mode 100755 index 8e7d9cfa8..118fdf61d --- a/docker/nix/build_nix.sh +++ b/docker/nix/build_nix.sh @@ -6,40 +6,4 @@ if [ -d "/workspace" ]; then cd /workspace fi -SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') - -nix build .#checks.$SYSTEM.psql_15 -L --no-link -nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link -nix build .#checks.$SYSTEM.psql_17 -L --no-link -nix build .#psql_15/bin -o psql_15 -L -nix build .#psql_orioledb-17/bin -o psql_orioledb_17 -L -nix build .#psql_17/bin -o psql_17 -L -nix build .#wal-g-2 -o wal-g-2 -L -nix build .#wal-g-3 -o wal-g-3 -L - -# Copy to S3 -if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-2 - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./wal-g-3 - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15 - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17 - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_17 -fi - -if [ "$SYSTEM" = "aarch64-linux" ]; then - nix build .#postgresql_15_debug -o ./postgresql_15_debug - nix build .#postgresql_15_src -o ./postgresql_15_src - nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug - nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src - nix build .#postgresql_17_debug -o ./postgresql_17_debug - nix build .#postgresql_17_src -o ./postgresql_17_src - - if [[ -n "${AWS_ACCESS_KEY_ID-}" && -n "${AWS_SECRET_ACCESS_KEY-}" ]]; then - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_debug-debug - nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_17_src - fi -fi +nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" -- --skip-cached --no-nom --flake ".#checks" diff --git a/flake.nix b/flake.nix index f22415789..a7f48d58c 100644 --- a/flake.nix +++ b/flake.nix @@ -1125,11 +1125,7 @@ TMPDIR_BASE=$(mktemp -d) - if [[ "$(uname)" == "Darwin" ]]; then - KEY_DIR="/private/tmp/pgsodium" - else - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - fi + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" KEY_FILE="$KEY_DIR/pgsodium.key" if ! mkdir -p "$KEY_DIR" 2>/dev/null; then @@ -1165,6 +1161,7 @@ name = "start-postgres-server-test"; extraSubstitutions = { PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey"; + PGSQL_DEFAULT_PORT = pgPort; }; }; @@ -1217,6 +1214,12 @@ # Filter SQL test files filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; + pgPort = if (majorVersion == "17") then + "5535" + else if (majorVersion == "15") then + "5536" + else "5537"; + # Convert filtered tests to a sorted list of basenames (without extension) testList = pkgs.lib.mapAttrsToList (name: _: @@ -1251,7 +1254,7 @@ substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "port = ${pgsqlDefaultPort}" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = ${pgPort}" >> "$PGTAP_CLUSTER"/postgresql.conf echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf echo "Checking shared_preload_libraries setting:" grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf @@ -1272,10 +1275,10 @@ # PostgreSQL startup if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgsqlDefaultPort} -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgPort} -d 5" start 2>&1 else mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgsqlDefaultPort} -d 5" start 2>&1 + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgPort} -d 5" start 2>&1 fi || { echo "pg_ctl failed to start PostgreSQL" echo "Contents of postgresql.log:" @@ -1283,7 +1286,7 @@ exit 1 } for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort}; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort}; then echo "PostgreSQL is ready" break fi @@ -1297,8 +1300,8 @@ exit 1 fi done - createdb -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing - if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + createdb -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing + if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then echo "Error executing SQL file. PostgreSQL log content:" cat "$PGTAP_CLUSTER"/postgresql.log pg_ctl -D "$PGTAP_CLUSTER" stop @@ -1306,7 +1309,7 @@ fi SORTED_DIR=$(mktemp -d) for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do - psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true + psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true done rm -rf "$SORTED_DIR" pg_ctl -D "$PGTAP_CLUSTER" stop @@ -1317,16 +1320,11 @@ # which is start by the start-postgres-server-bin script # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations - # Ensure pgsodium key directory exists with proper permissions - if [[ "$(uname)" == "Darwin" ]]; then - mkdir -p /private/tmp/pgsodium - chmod 1777 /private/tmp/pgsodium - fi unset GRN_PLUGINS_DIR ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgsqlDefaultPort} -U supabase_admin -q; then + if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort} -U supabase_admin -q; then echo "PostgreSQL is ready" break fi @@ -1337,7 +1335,7 @@ fi done - if ! psql -p ${pgsqlDefaultPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xaf ${./nix/tests/prime.sql}; then + if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then echo "Error executing SQL file" exit 1 fi @@ -1349,7 +1347,7 @@ --inputdir=${./nix/tests} \ --outputdir=$out/regression_output \ --host=${pgsqlDefaultHost} \ - --port=${pgsqlDefaultPort} \ + --port=${pgPort} \ --user=supabase_admin \ ${builtins.concatStringsSep " " sortedTestList}; then echo "pg_regress tests failed" @@ -1358,7 +1356,7 @@ fi echo "Running migrations tests" - pg_prove -p ${pgsqlDefaultPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql + pg_prove -p ${pgPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql # Copy logs to output for logfile in $(find /tmp -name postgresql.log -type f); do @@ -1382,6 +1380,9 @@ psql_15 = makeCheckHarness basePackages.psql_15.bin; psql_17 = makeCheckHarness basePackages.psql_17.bin; psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; + inherit (basePackages) wal-g-2 wal-g-3; + } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { + inherit (basePackages) postgresql_15_debug postgresql_15_src postgresql_orioledb-17_debug postgresql_orioledb-17_src postgresql_17_debug postgresql_17_src; }; # Apps is a list of names of things that can be executed with 'nix run'; From 4b77682885802d019a669fe66f404d7628e571f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 18 Jun 2025 08:58:33 +0200 Subject: [PATCH 004/134] ci: fix nix cache configuration --- .github/workflows/nix-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index e95d65a43..f641b7306 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -46,14 +46,14 @@ jobs: - name: Setup cache script if: ${{ github.secret_source == 'Actions' }} run: | - mkdir -p /etc/nix + sudo mkdir -p /etc/nix cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null #!/usr/bin/env bash set -eouf export IFS=' ' echo /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=nix-secret-key' \$OUT_PATHS EOF - chmod +x /etc/nix/upload-to-cache.sh + sudo chmod +x /etc/nix/upload-to-cache.sh - name: Install nix uses: DeterminateSystems/nix-installer-action@main if: ${{ github.secret_source == 'Actions' }} From e9e60ba5ced9a5262e81083900ee8b9aaa975078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 19 Jun 2025 12:17:06 +0200 Subject: [PATCH 005/134] ci: Use larger runner for other workflows and wait for the nix workflow to succeed (#1652) * ci: use larger runner for the test and testinfra-ami-build workflows * ci: wait for the nix workflow to succeed before running the test and testinfra-ami-build workflow * ci: use larger runner for other workflows * chore: be less verbose when building postgresql dev setup * ci: build and cache more packages in the Nix CI workflow * ci: run nix copy * ci: do not run nix as root --- .github/workflows/ami-release-nix-single.yml | 4 +-- .github/workflows/ami-release-nix.yml | 12 +++---- .../workflows/dockerhub-release-matrix.yml | 12 +++---- .github/workflows/manual-docker-release.yml | 12 +++---- .github/workflows/nix-build.yml | 16 ++++++--- .github/workflows/publish-migrations-prod.yml | 2 +- .../workflows/publish-migrations-staging.yml | 2 +- ...ublish-nix-pgupgrade-bin-flake-version.yml | 8 ++--- .../publish-nix-pgupgrade-scripts.yml | 6 ++-- .github/workflows/qemu-image-build.yml | 6 ++-- .github/workflows/test.yml | 25 ++++++-------- .github/workflows/testinfra-ami-build.yml | 33 +++++-------------- flake.nix | 4 +-- 13 files changed, 62 insertions(+), 80 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 863135ef3..0534a98d0 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -19,7 +19,7 @@ permissions: jobs: build: - runs-on: arm-runner + runs-on: large-linux-arm timeout-minutes: 150 steps: @@ -40,7 +40,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | - PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ env.POSTGRES_MAJOR_VERSION }}'"]' ansible/vars.yml) + PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ env.POSTGRES_MAJOR_VERSION }}'"]' ansible/vars.yml) PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index ee78de99c..449903484 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -17,7 +17,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -38,11 +38,7 @@ jobs: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: arm-runner - arch: arm64 - ubuntu_release: focal - ubuntu_version: 20.04 - mcpu: neoverse-n1 + - runner: large-linux-arm runs-on: ${{ matrix.runner }} timeout-minutes: 150 @@ -55,7 +51,7 @@ jobs: - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} run: | - SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + SUFFIX=$(nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z "$SUFFIX" ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 @@ -66,7 +62,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | - PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index 1ac5b2ccc..263b0112a 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -16,7 +16,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} steps: @@ -49,7 +49,7 @@ jobs: needs: prepare strategy: matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }} - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: build_args: ${{ steps.args.outputs.result }} steps: @@ -75,7 +75,7 @@ jobs: matrix: postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} arch: [amd64, arm64] - runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} + runs-on: ${{ matrix.arch == 'amd64' && 'large-linux-x86' || 'large-linux-arm' }} timeout-minutes: 180 steps: - name: Checkout Repo @@ -93,7 +93,7 @@ jobs: id: image run: | if [[ "${{ matrix.arch }}" == "arm64" ]]; then - pg_version=$(sudo nix run nixpkgs#nushell -- -c ' + pg_version=$(nix run nixpkgs#nushell -- -c ' let version = "${{ matrix.postgres.version }}" let release_key = if ($version | str contains "orioledb") { $"postgresorioledb-17" @@ -132,7 +132,7 @@ jobs: strategy: matrix: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} - runs-on: ubuntu-latest + runs-on: large-linux-x86 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD @@ -176,7 +176,7 @@ jobs: ${{ steps.get_version.outputs.pg_version }}_arm64 combine_results: needs: [prepare, merge_manifest] - runs-on: ubuntu-latest + runs-on: large-linux-x86 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml index e702014dc..3f86643ff 100644 --- a/.github/workflows/manual-docker-release.yml +++ b/.github/workflows/manual-docker-release.yml @@ -13,7 +13,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} steps: @@ -46,7 +46,7 @@ jobs: needs: prepare strategy: matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }} - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: build_args: ${{ steps.args.outputs.result }} steps: @@ -72,7 +72,7 @@ jobs: matrix: postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} arch: [amd64, arm64] - runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'arm-runner' }} + runs-on: ${{ matrix.arch == 'amd64' && 'large-linux-x86' || 'large-linux-arm' }} timeout-minutes: 180 steps: - name: Checkout Repo @@ -90,7 +90,7 @@ jobs: id: image run: | if [[ "${{ matrix.arch }}" == "arm64" ]]; then - pg_version=$(sudo nix run nixpkgs#nushell -- -c ' + pg_version=$(nix run nixpkgs#nushell -- -c ' let version = "${{ matrix.postgres.version }}" let release_key = if ($version | str contains "orioledb") { $"postgresorioledb-17" @@ -141,7 +141,7 @@ jobs: strategy: matrix: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} - runs-on: ubuntu-latest + runs-on: large-linux-x86 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD @@ -185,7 +185,7 @@ jobs: ${{ steps.get_version.outputs.pg_version }}_arm64 combine_results: needs: [prepare, merge_manifest] - runs-on: ubuntu-latest + runs-on: large-linux-x86 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index f641b7306..82aab37f7 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -10,8 +10,8 @@ on: permissions: contents: read - id-token: write - + id-token: write + jobs: build-run-image: strategy: @@ -37,21 +37,27 @@ jobs: aws-region: "us-east-1" output-credentials: true role-duration-seconds: 7200 + - name: Setup AWS credentials for Nix + if: ${{ github.secret_source == 'Actions' }} + run: | + sudo -H aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID + sudo -H aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY + sudo -H aws configure set aws_session_token $AWS_SESSION_TOKEN - name: write secret key # use python so we don't interpolate the secret into the workflow logs, in case of bugs run: | - python -c "import os; file = open('nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()" + sudo mkdir -p /etc/nix + sudo -E python -c "import os; file = open('/etc/nix/nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()" env: NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }} - name: Setup cache script if: ${{ github.secret_source == 'Actions' }} run: | - sudo mkdir -p /etc/nix cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null #!/usr/bin/env bash set -eouf export IFS=' ' - echo /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=nix-secret-key' \$OUT_PATHS + /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=/etc/nix/nix-secret-key' $OUT_PATHS EOF sudo chmod +x /etc/nix/upload-to-cache.sh - name: Install nix diff --git a/.github/workflows/publish-migrations-prod.yml b/.github/workflows/publish-migrations-prod.yml index e3d7365cb..ffb633683 100644 --- a/.github/workflows/publish-migrations-prod.yml +++ b/.github/workflows/publish-migrations-prod.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: [self-hosted, linux] + runs-on: large-linux-arm timeout-minutes: 15 permissions: id-token: write diff --git a/.github/workflows/publish-migrations-staging.yml b/.github/workflows/publish-migrations-staging.yml index 9cef8be4b..7acb46d22 100644 --- a/.github/workflows/publish-migrations-staging.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: [self-hosted, linux] + runs-on: large-linux-arm timeout-minutes: 15 permissions: id-token: write diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index 847e6d47c..f816415b3 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -12,7 +12,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -29,7 +29,7 @@ jobs: publish-staging: needs: prepare - runs-on: ubuntu-latest + runs-on: large-linux-x86 strategy: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} @@ -79,7 +79,7 @@ jobs: SLACK_FOOTER: '' publish-prod: - runs-on: ubuntu-latest + runs-on: large-linux-x86 if: github.ref_name == 'develop' || contains( github.ref, 'release' ) needs: prepare strategy: @@ -93,7 +93,7 @@ jobs: - name: Grab release version id: process_release_version run: | - VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) VERSION=$(echo $VERSION | tr -d '"') # Remove any surrounding quotes echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index 19e255fca..c58e90d83 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -19,7 +19,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -36,7 +36,7 @@ jobs: publish-staging: needs: prepare - runs-on: ubuntu-latest + runs-on: large-linux-x86 strategy: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} @@ -84,7 +84,7 @@ jobs: SLACK_FOOTER: '' publish-prod: needs: prepare - runs-on: ubuntu-latest + runs-on: large-linux-x86 if: github.ref_name == 'develop' || contains( github.ref, 'release' ) strategy: diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 8abee1461..35b7a583a 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -18,7 +18,7 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -38,7 +38,7 @@ jobs: strategy: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} - runs-on: arm-native-runner + runs-on: large-linux-arm timeout-minutes: 150 permissions: contents: write @@ -54,7 +54,7 @@ jobs: - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} run: | - SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + SUFFIX=$(nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z $SUFFIX ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac285af26..b907c85d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,10 @@ name: Test Database on: - push: - branches: - - develop - pull_request: + # Trigger this workflow when the "Nix CI" workflow completes + workflow_run: + workflows: ["Nix CI"] + types: + - completed workflow_dispatch: permissions: @@ -12,17 +13,13 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - - name: Clear Nix cache - run: | - sudo rm -rf /home/runner/.cache/nix - - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | @@ -34,14 +31,15 @@ jobs: VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c "split(\"\n\")[:-1]") echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} needs: prepare strategy: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: ubuntu-22.04 + - runner: large-linux-x86 arch: amd64 - - runner: ubuntu-22.04 + - runner: large-linux-arm arch: arm64 runs-on: ${{ matrix.runner }} timeout-minutes: 180 @@ -51,9 +49,6 @@ jobs: steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - name: Clear Nix cache - run: | - sudo rm -rf /home/runner/.cache/nix - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 752bc3938..2e1edda45 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -1,7 +1,11 @@ name: Testinfra Integration Tests Nix on: - pull_request: + # Trigger this workflow when the "Nix CI" workflow completes + workflow_run: + workflows: ["Nix CI"] + types: + - completed workflow_dispatch: permissions: @@ -10,20 +14,15 @@ permissions: jobs: prepare: - runs-on: ubuntu-latest + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} + runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - - uses: DeterminateSystems/nix-installer-action@main - - name: Clean Nix store before build - run: | - sudo nix-collect-garbage -d || true - sudo nix-store --optimize || true - df -h / # Display available space + - uses: DeterminateSystems/nix-installer-action@main - name: Set PostgreSQL versions id: set-versions @@ -32,6 +31,7 @@ jobs: echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT test-ami-nix: + if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} needs: prepare strategy: fail-fast: false @@ -71,7 +71,6 @@ jobs: - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV - - name: Generate common-nix.vars.pkr.hcl run: | @@ -87,26 +86,12 @@ jobs: GIT_SHA=${{github.sha}} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - - name: Clean up after AMI stage 1 - if: always() # Run even if previous steps fail - run: | - sudo nix-collect-garbage -d # Delete old generations of all profiles - sudo rm -rf /tmp/* # Clean temporary files - df -h / # Display available space - - name: Build AMI stage 2 run: | packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl - - name: Clean up after AMI stage 2 - if: always() # Run even if previous steps fail - run: | - sudo nix-collect-garbage -d # Delete old generations of all profiles - sudo rm -rf /tmp/* # Clean temporary files - df -h / # Display available space - - name: Run tests timeout-minutes: 10 env: diff --git a/flake.nix b/flake.nix index a7f48d58c..335ccdf42 100644 --- a/flake.nix +++ b/flake.nix @@ -356,7 +356,6 @@ { inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; } '' - set -x mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts # Copy config files with error handling @@ -1380,7 +1379,7 @@ psql_15 = makeCheckHarness basePackages.psql_15.bin; psql_17 = makeCheckHarness basePackages.psql_17.bin; psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; - inherit (basePackages) wal-g-2 wal-g-3; + inherit (basePackages) wal-g-2 wal-g-3 dbmate-tool pg_regress; } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { inherit (basePackages) postgresql_15_debug postgresql_15_src postgresql_orioledb-17_debug postgresql_orioledb-17_src postgresql_17_debug postgresql_17_src; }; @@ -1456,6 +1455,7 @@ dbmate nushell pythonEnv + nix-fast-build ]; shellHook = '' export HISTFILE=.history From 4a073c2f272b816b64513c4ed879364a21544c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 19 Jun 2025 16:08:18 +0200 Subject: [PATCH 006/134] ci: fix CI regressions (#1655) * ci: revert change to qemu image build workflow The workflow requires KVM on ARM. This is not available on the large GitHub Actions runners. We revert the change to the workflow. * ci: fix missing step to login to AWS after switching runner Since the runner was switched to a Github-hosted runner, we need to add a step to log in to AWS. --- .github/workflows/ami-release-nix-single.yml | 7 +++++++ .github/workflows/ami-release-nix.yml | 8 +++++++- .github/workflows/qemu-image-build.yml | 6 +++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 0534a98d0..d99939f1d 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -27,6 +27,13 @@ jobs: uses: supabase/postgres/.github/actions/shared-checkout@HEAD with: ref: ${{ github.event.inputs.branch }} + - name: aws-creds + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + aws-region: "us-east-1" + output-credentials: true + role-duration-seconds: 7200 - name: Get current branch SHA id: get_sha diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 449903484..bf2df0c96 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -45,7 +45,13 @@ jobs: steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - + - name: aws-creds + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + aws-region: "us-east-1" + output-credentials: true + role-duration-seconds: 7200 - uses: DeterminateSystems/nix-installer-action@main - name: Run checks if triggered manually diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 35b7a583a..8abee1461 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -18,7 +18,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: ubuntu-latest outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -38,7 +38,7 @@ jobs: strategy: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} - runs-on: large-linux-arm + runs-on: arm-native-runner timeout-minutes: 150 permissions: contents: write @@ -54,7 +54,7 @@ jobs: - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} run: | - SUFFIX=$(nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z $SUFFIX ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 From 2b07c9c86dfed6e092ade291f035ee87dfeccc17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 19 Jun 2025 19:44:29 +0200 Subject: [PATCH 007/134] ci: fix workflow dependencies (#1659) We want to run test.yaml and testinfra-ami-build.yaml after nix-build.yaml. We start using reusable workflow instead of relying on workflow_run which doesn't work well with pull requests. --- .github/workflows/nix-build.yml | 14 +++++++++++++- .github/workflows/test.yml | 8 +------- .github/workflows/testinfra-ami-build.yml | 8 +------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 82aab37f7..d562ab6ca 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -9,8 +9,10 @@ on: workflow_dispatch: permissions: - contents: read id-token: write + # required by testinfra-ami-build dependent workflows + contents: write + packages: write jobs: build-run-image: @@ -84,3 +86,13 @@ jobs: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} + + run-testinfra: + needs: build-run-image + if: ${{ success() }} + uses: ./.github/workflows/testinfra-ami-build.yml + + run-tests: + needs: build-run-image + if: ${{ success() }} + uses: ./.github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b907c85d7..6be368784 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,11 +1,7 @@ name: Test Database on: - # Trigger this workflow when the "Nix CI" workflow completes - workflow_run: - workflows: ["Nix CI"] - types: - - completed workflow_dispatch: + workflow_call: permissions: contents: read @@ -13,7 +9,6 @@ permissions: jobs: prepare: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} @@ -31,7 +26,6 @@ jobs: VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c "split(\"\n\")[:-1]") echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} needs: prepare strategy: matrix: diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 2e1edda45..8544f1b85 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -1,12 +1,8 @@ name: Testinfra Integration Tests Nix on: - # Trigger this workflow when the "Nix CI" workflow completes - workflow_run: - workflows: ["Nix CI"] - types: - - completed workflow_dispatch: + workflow_call: permissions: contents: read @@ -14,7 +10,6 @@ permissions: jobs: prepare: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: large-linux-x86 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} @@ -31,7 +26,6 @@ jobs: echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT test-ami-nix: - if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} needs: prepare strategy: fail-fast: false From 7d78f1453b3b729a0addb5ddf2d5dd3ff05a3904 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Fri, 20 Jun 2025 17:52:02 +0200 Subject: [PATCH 008/134] chore: fix and add a check for the nix devshell (#1656) * chore: fix nix devshell (`nix develop`) * chore: add a `nix flake check` for the devShell --- flake.lock | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 5 ++- 2 files changed, 88 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index d593fa3dc..bea404a1f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nix-fast-build", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -55,10 +76,30 @@ "type": "github" } }, + "nix-fast-build": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_2", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1749427739, + "narHash": "sha256-Nm0oMqFNRnJsiZYeNChmefmjeVCOzngikpSQhgs7iXI=", + "owner": "Mic92", + "repo": "nix-fast-build", + "rev": "b1dae483ab7d4139a6297e02b6de9e5d30e43d48", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-fast-build", + "type": "github" + } + }, "nix2container": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1708764364, @@ -91,6 +132,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1749411262, + "narHash": "sha256-gRBkeW9l5lb/90lv1waQFNT+18OhITs11HENarh6vNo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0fc422d6c394191338c9d6a05786c63fc52a0f29", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable-small", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1697269602, "narHash": "sha256-dSzV7Ud+JH4DPVD9od53EgDrxUVQOcSj4KGjggCDVJI=", @@ -105,7 +162,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1712666087, "narHash": "sha256-WwjUkWsjlU8iUImbivlYxNyMB1L5YVqE8QotQdL9jWc=", @@ -121,7 +178,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -141,14 +198,15 @@ "inputs": { "flake-utils": "flake-utils", "nix-editor": "nix-editor", + "nix-fast-build": "nix-fast-build", "nix2container": "nix2container", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1746758179, @@ -194,6 +252,27 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nix-fast-build", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749194973, + "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index 335ccdf42..18cd9ba13 100644 --- a/flake.nix +++ b/flake.nix @@ -7,9 +7,10 @@ nix2container.url = "github:nlewo/nix2container"; nix-editor.url = "github:snowfallorg/nix-editor"; rust-overlay.url = "github:oxalica/rust-overlay"; + nix-fast-build.url = "github:Mic92/nix-fast-build"; }; - outputs = { self, nixpkgs, flake-utils, nix-editor, rust-overlay, nix2container, ... }: + outputs = { self, nixpkgs, flake-utils, nix-editor, rust-overlay, nix2container, ... }@inputs: let gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; @@ -1380,6 +1381,7 @@ psql_17 = makeCheckHarness basePackages.psql_17.bin; psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; inherit (basePackages) wal-g-2 wal-g-3 dbmate-tool pg_regress; + devShell = devShells.default; } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { inherit (basePackages) postgresql_15_debug postgresql_15_src postgresql_orioledb-17_debug postgresql_orioledb-17_src postgresql_17_debug postgresql_17_src; }; @@ -1429,6 +1431,7 @@ export HISTFILE=.history ''; }; + nix-fast-build = inputs.nix-fast-build.packages.${system}.default; in { default = pkgs.mkShell { From 51ddf76b2cfc72ed302e2fa99b79ae3a9c8c59f9 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 23 Jun 2025 17:22:16 -0400 Subject: [PATCH 009/134] fix: pin version of libpq to 17.x (#1649) * fix: pin version of libpq to the major version installed * fix: the variable is postgresql_major_version * fix: using the correct var * fix: default to postgres 15 major version * fix: default to 15 * fix: supposedly main contains all releases for libpq5 * fix: syntax * fix: different syntax * fix: rely on ppa * fix: ppa removal * fix: change to trigger workflow * fix: adding a test to see postgres version * fix: testing for failure related to libpq5 version issue * test: include read-only test for postgrest * test: reduce log access time * test: make sure to fail if version wrong * chore: bump vars --- ansible/tasks/setup-postgrest.yml | 29 ++-- ansible/vars.yml | 6 +- testinfra/test_ami_nix.py | 230 ++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+), 15 deletions(-) diff --git a/ansible/tasks/setup-postgrest.yml b/ansible/tasks/setup-postgrest.yml index a98d1990f..b6e0f951c 100644 --- a/ansible/tasks/setup-postgrest.yml +++ b/ansible/tasks/setup-postgrest.yml @@ -6,22 +6,28 @@ url: https://www.postgresql.org/media/keys/ACCC4CF8.asc state: present -- name: PostgREST - add Postgres PPA +- name: PostgREST - add Postgres PPA main apt_repository: - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}" + repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" state: present + filename: postgresql-pgdg -- name: PostgREST - update apt cache +- name: PostgREST - install system dependencies apt: - update_cache: yes - -# libpq is a C library that enables user programs to communicate with -# the PostgreSQL database server. -- name: PostgREST - system dependencies - apt: - pkg: + package: - libpq5 - libnuma-dev + update_cache: yes + state: present + +- name: PostgREST - verify libpq5 version + shell: dpkg -l libpq5 | grep '^ii' | awk '{print $3}' + register: libpq5_version + changed_when: false + +- name: Show installed libpq5 version + debug: + msg: "Installed libpq5 version: {{ libpq5_version.stdout }}" - name: PostgREST - remove Postgres PPA gpg key apt_key: @@ -30,7 +36,7 @@ - name: PostgREST - remove Postgres PPA apt_repository: - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg {{ postgresql_major }}" + repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" state: absent - name: postgis - ensure dependencies do not get autoremoved @@ -88,7 +94,6 @@ #! /usr/bin/env bash set -euo pipefail set -x - cd "$(dirname "$0")" cat $@ > merged.conf dest: /etc/postgrest/merge.sh diff --git a/ansible/vars.yml b/ansible/vars.yml index 2838d6f92..f23aaf2ab 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.093-orioledb" - postgres17: "17.4.1.043" - postgres15: "15.8.1.100" + postgresorioledb-17: "17.0.1.094-orioledb" + postgres17: "17.4.1.044" + postgres15: "15.8.1.101" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 1975818d6..864ab2861 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -507,3 +507,233 @@ def test_postgrest_ending_empty_key_query_parameter_is_removed(host): }, ) assert res.ok + + +def test_postgresql_version(host): + """Print the PostgreSQL version being tested and ensure it's >= 14.""" + result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c 'SELECT version();'") + if result['succeeded']: + print(f"\nPostgreSQL Version:\n{result['stdout']}") + # Extract version number from the output + version_line = result['stdout'].strip().split('\n')[2] # Skip header and get the actual version + # Extract major version number (e.g., "15.8" -> 15) + import re + version_match = re.search(r'PostgreSQL (\d+)\.', version_line) + if version_match: + major_version = int(version_match.group(1)) + print(f"PostgreSQL major version: {major_version}") + assert major_version >= 14, f"PostgreSQL version {major_version} is less than 14" + else: + assert False, "Could not parse PostgreSQL version number" + else: + print(f"\nFailed to get PostgreSQL version: {result['stderr']}") + assert False, "Failed to get PostgreSQL version" + + # Also get the version from the command line + result = run_ssh_command(host['ssh'], "sudo -u postgres psql --version") + if result['succeeded']: + print(f"PostgreSQL Client Version: {result['stdout'].strip()}") + else: + print(f"Failed to get PostgreSQL client version: {result['stderr']}") + + print("✓ PostgreSQL version is >= 14") + + +def test_libpq5_version(host): + """Print the libpq5 version installed and ensure it's >= 14.""" + # Try different package managers to find libpq5 + result = run_ssh_command(host['ssh'], "dpkg -l | grep libpq5 || true") + if result['succeeded'] and result['stdout'].strip(): + print(f"\nlibpq5 package info:\n{result['stdout']}") + # Extract version from dpkg output (format: ii libpq5:arm64 17.5-1.pgdg20.04+1) + import re + version_match = re.search(r'libpq5[^ ]* +(\d+)\.', result['stdout']) + if version_match: + major_version = int(version_match.group(1)) + print(f"libpq5 major version: {major_version}") + assert major_version >= 14, f"libpq5 version {major_version} is less than 14" + else: + print("Could not parse libpq5 version from dpkg output") + else: + print("\nlibpq5 not found via dpkg") + + # Also try to find libpq.so files + result = run_ssh_command(host['ssh'], "find /usr -name '*libpq*' -type f 2>/dev/null | head -10") + if result['succeeded'] and result['stdout'].strip(): + print(f"\nlibpq files found:\n{result['stdout']}") + else: + print("\nNo libpq files found") + + # Check if we can get version from a libpq file + result = run_ssh_command(host['ssh'], "ldd /usr/bin/psql | grep libpq || true") + if result['succeeded'] and result['stdout'].strip(): + print(f"\npsql libpq dependency:\n{result['stdout']}") + else: + print("\nCould not find libpq dependency for psql") + + # Try to get version from libpq directly + result = run_ssh_command(host['ssh'], "psql --version 2>&1 | head -1") + if result['succeeded'] and result['stdout'].strip(): + print(f"\npsql version output: {result['stdout'].strip()}") + # The psql version should match the libpq version + import re + version_match = re.search(r'psql \(PostgreSQL\) (\d+)\.', result['stdout']) + if version_match: + major_version = int(version_match.group(1)) + print(f"psql/libpq major version: {major_version}") + assert major_version >= 14, f"psql/libpq version {major_version} is less than 14" + else: + print("Could not parse psql version") + + print("✓ libpq5 version is >= 14") + + +def test_postgrest_read_only_session_attrs(host): + """Test PostgREST with target_session_attrs=read-only and check for session errors.""" + # First, check if PostgreSQL is configured for read-only mode + result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW default_transaction_read_only;\"") + if result['succeeded']: + default_read_only = result['stdout'].strip() + print(f"PostgreSQL default_transaction_read_only: {default_read_only}") + else: + print("Could not check PostgreSQL read-only setting") + default_read_only = "unknown" + + # Check if PostgreSQL is in recovery mode (standby) + result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SELECT pg_is_in_recovery();\"") + if result['succeeded']: + in_recovery = result['stdout'].strip() + print(f"PostgreSQL pg_is_in_recovery: {in_recovery}") + else: + print("Could not check PostgreSQL recovery status") + in_recovery = "unknown" + + # Find PostgreSQL configuration file + result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW config_file;\"") + if result['succeeded']: + config_file = result['stdout'].strip().split('\n')[2].strip() # Skip header and get the actual path + print(f"PostgreSQL config file: {config_file}") + else: + print("Could not find PostgreSQL config file") + config_file = "/etc/postgresql/15/main/postgresql.conf" # Default fallback + + # Backup PostgreSQL config + result = run_ssh_command(host['ssh'], f"sudo cp {config_file} {config_file}.backup") + assert result['succeeded'], "Failed to backup PostgreSQL config" + + # Add read-only setting to PostgreSQL config + result = run_ssh_command(host['ssh'], f"echo 'default_transaction_read_only = on' | sudo tee -a {config_file}") + assert result['succeeded'], "Failed to add read-only setting to PostgreSQL config" + + # Restart PostgreSQL to apply the new configuration + result = run_ssh_command(host['ssh'], "sudo systemctl restart postgresql") + assert result['succeeded'], "Failed to restart PostgreSQL" + + # Wait for PostgreSQL to start up + sleep(5) + + # Verify the change took effect + result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW default_transaction_read_only;\"") + if result['succeeded']: + new_default_read_only = result['stdout'].strip() + print(f"PostgreSQL default_transaction_read_only after change: {new_default_read_only}") + else: + print("Could not verify PostgreSQL read-only setting change") + + # First, backup the current PostgREST config + result = run_ssh_command(host['ssh'], "sudo cp /etc/postgrest/base.conf /etc/postgrest/base.conf.backup") + assert result['succeeded'], "Failed to backup PostgREST config" + + try: + # Read the current config to get the db-uri + result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'") + assert result['succeeded'], "Failed to read current db-uri" + + current_db_uri = result['stdout'].strip() + print(f"Current db-uri: {current_db_uri}") + + # Extract just the URI part (remove the db-uri = " prefix and trailing quote) + uri_start = current_db_uri.find('"') + 1 + uri_end = current_db_uri.rfind('"') + base_uri = current_db_uri[uri_start:uri_end] + + # Modify the URI to add target_session_attrs=read-only + if '?' in base_uri: + # URI already has parameters, add target_session_attrs + modified_uri = base_uri + "&target_session_attrs=read-only" + else: + # URI has no parameters, add target_session_attrs + modified_uri = base_uri + "?target_session_attrs=read-only" + + print(f"Modified URI: {modified_uri}") + + # Use awk to replace the db-uri line more reliably + result = run_ssh_command(host['ssh'], f"sudo awk '{{if ($1 == \"db-uri\") print \"db-uri = \\\"{modified_uri}\\\"\"; else print $0}}' /etc/postgrest/base.conf > /tmp/new_base.conf && sudo mv /tmp/new_base.conf /etc/postgrest/base.conf") + assert result['succeeded'], "Failed to update db-uri in config" + + # Verify the change was made correctly + result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'") + print(f"Updated db-uri line: {result['stdout'].strip()}") + + # Also show the full config to debug + result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf") + print(f"Full config after change:\n{result['stdout']}") + + # Restart PostgREST to apply the new configuration + result = run_ssh_command(host['ssh'], "sudo systemctl restart postgrest") + assert result['succeeded'], "Failed to restart PostgREST" + + # Wait a moment for PostgREST to start up + sleep(5) + + # Check if PostgREST is running + result = run_ssh_command(host['ssh'], "sudo systemctl is-active postgrest") + if not (result['succeeded'] and result['stdout'].strip() == 'active'): + # If PostgREST failed to start, check the logs to see why + log_result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' --no-pager") + print(f"PostgREST failed to start. Recent logs:\n{log_result['stdout']}") + assert False, "PostgREST failed to start after config change" + + # Make a test request to trigger any potential session errors + try: + response = requests.get( + f"http://{host['ip']}/rest/v1/", + headers={"apikey": anon_key, "authorization": f"Bearer {anon_key}"}, + timeout=10 + ) + print(f"Test request status: {response.status_code}") + except Exception as e: + print(f"Test request failed: {str(e)}") + + # Check PostgREST logs for "session is not read-only" errors + result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' | grep -i 'session is not read-only' || true") + + if result['stdout'].strip(): + print(f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}") + assert False, "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode" + else: + print("\nNo 'session is not read-only' errors found in PostgREST logs") + + finally: + # Restore the original configuration + result = run_ssh_command(host['ssh'], "sudo cp /etc/postgrest/base.conf.backup /etc/postgrest/base.conf") + if result['succeeded']: + result = run_ssh_command(host['ssh'], "sudo systemctl restart postgrest") + if result['succeeded']: + print("Restored original PostgREST configuration") + else: + print("Warning: Failed to restart PostgREST after restoring config") + else: + print("Warning: Failed to restore original PostgREST configuration") + + # Restore PostgreSQL to original configuration + result = run_ssh_command(host['ssh'], f"sudo cp {config_file}.backup {config_file}") + if result['succeeded']: + result = run_ssh_command(host['ssh'], "sudo systemctl restart postgresql") + if result['succeeded']: + print("Restored PostgreSQL to original configuration") + else: + print("Warning: Failed to restart PostgreSQL after restoring config") + else: + print("Warning: Failed to restore PostgreSQL configuration") + From f5a13429d4a299c81ac26855ebbf00ae51475552 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 24 Jun 2025 11:30:49 +0800 Subject: [PATCH 010/134] ci: no longer build Oriole QEMU artifact Said artifact is no longer being used. If needed in the future, it can be trivially reintroduced, but in the meantime there's no reason to expend resources on them. --- .github/workflows/qemu-image-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 8abee1461..97bc92a1c 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -30,7 +30,7 @@ jobs: - name: Set PostgreSQL versions - only builds pg17 atm id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1,2]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: From 4f454709dc4f93046d6baaee12591246036260a8 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 24 Jun 2025 11:18:59 +0800 Subject: [PATCH 011/134] chore: disable auth config reloading within qemu artifact The QEMU artifact is not running with a filesystem that supports the inotify API, resulting in spurious error messages, and broken config reloading. --- ansible/files/gotrue.service.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible/files/gotrue.service.j2 b/ansible/files/gotrue.service.j2 index 272e5b871..2478e99e6 100644 --- a/ansible/files/gotrue.service.j2 +++ b/ansible/files/gotrue.service.j2 @@ -4,7 +4,12 @@ Description=Gotrue [Service] Type=simple WorkingDirectory=/opt/gotrue +{% if qemu_mode is defined and qemu_mode %} +ExecStart=/opt/gotrue/gotrue +{% else %} ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d +{% endif %} + User=gotrue Restart=always RestartSec=3 From f5ba2a5c02d97b7ed679f11c6d9be6eda072ada4 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Sun, 4 May 2025 11:25:49 +0800 Subject: [PATCH 012/134] chore: strip out unnecessary dependencies from QEMU builds Also upgrades to Alpine 3.22. --- .github/workflows/qemu-image-build.yml | 1 + Dockerfile-kubernetes | 11 +++++++---- ansible/vars.yml | 6 +++--- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 +- scripts/90-cleanup-qemu.sh | 5 ++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 97bc92a1c..ffd12683c 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -10,6 +10,7 @@ on: - 'qemu-arm64-nix.pkr.hcl' - 'common-nix.vars.pkr.hcl' - 'ansible/vars.yml' + - 'scripts/*' workflow_dispatch: permissions: diff --git a/Dockerfile-kubernetes b/Dockerfile-kubernetes index a1a39e498..2a5e1ca1e 100644 --- a/Dockerfile-kubernetes +++ b/Dockerfile-kubernetes @@ -1,9 +1,12 @@ -FROM alpine:3.21 +FROM alpine:3.22 ADD ./output-cloudimg/packer-cloudimg /disk/focal.qcow2 -RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client nftables cloud-utils-localds aavmf virtiofsd -# dev stuff -# RUN apk add --no-cache iproute2 +RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client aavmf virtiofsd \ + && truncate -s 64M /root/varstore.img \ + && truncate -s 64M /root/efi.img \ + && dd if=/usr/share/AAVMF/QEMU_EFI.fd of=/root/efi.img conv=notrunc \ + && qemu-img create -f qcow2 /tmp/disk.qcow2 -b /disk/focal.qcow2 -F qcow2 \ + && apk del --no-cache aavmf qemu-img CMD exec /bin/sh -c "trap : TERM INT; sleep 9999999999d & wait" diff --git a/ansible/vars.yml b/ansible/vars.yml index f23aaf2ab..2d6465832 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.094-orioledb" - postgres17: "17.4.1.044" - postgres15: "15.8.1.101" + postgresorioledb-17: "17.0.1.095-orioledb" + postgres17: "17.4.1.45" + postgres15: "15.8.1.102" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index ad5c2744c..b52b85789 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -155,6 +155,6 @@ execute_stage2_playbook # we do not want to ship an initialized DB as this is performed as needed mkdir -p /db/template mv /data/pgdata /db/template +cloud-init clean --logs clean_legacy_things clean_system -cloud-init clean --logs diff --git a/scripts/90-cleanup-qemu.sh b/scripts/90-cleanup-qemu.sh index d6c6ade05..50d8d956f 100644 --- a/scripts/90-cleanup-qemu.sh +++ b/scripts/90-cleanup-qemu.sh @@ -43,7 +43,10 @@ elif [ -n "$(command -v apt-get)" ]; then add-apt-repository --yes --remove ppa:ansible/ansible source /etc/os-release - apt-get -y remove --purge linux-headers-5.11.0-1021-aws + + apt-mark manual libevent-2.1-7 # required for pgbouncer + apt-get -y remove --purge ansible-core apport appstream bash-completion bcache-tools bind9-dnsutils bind9-host bind9-libs bolt btrfs-progs byobu command-not-found console-setup distro-info eject fonts-ubuntu-console friendly-recovery ftp fwupd gawk gdisk keyboard-configuration libvolume-key1 libicu66 libssl-dev lvm2 lxd-agent-loader man-db mdadm modemmanager mtd-utils nano netcat-openbsd nfs-common ntfs-3g parted pastebinit screen strace thin-provisioning-tools tmux usb-modeswitch vim vim-runtime wget whiptail xfsprogs + apt remove -y --purge libc6-dev linux-libc-dev libevent-dev libpcre3-dev libsystemd-dev apt-get -y update apt-get -y upgrade From e321760fb40e1af3266a64768432a1d5c695aa26 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Wed, 25 Jun 2025 08:33:19 +0100 Subject: [PATCH 013/134] feat: Install gandalf, salt-wrapper for infra (#1657) * feat: Install gandalf, salt-wrapper for infra * chore: version bumps * bumping oriole build also * fix: create the Gandalf group * fix: implicitly create the gandalf group * fix: correct gandalf archive path * fix: unpack gandalf build correctly * fix: reorganise order for gandalf installs * fix: point to the correct path * chore: bump vars due to conflicts * fix: pin version of libpq to 17.x (#1649) * fix: pin version of libpq to the major version installed * fix: the variable is postgresql_major_version * fix: using the correct var * fix: default to postgres 15 major version * fix: default to 15 * fix: supposedly main contains all releases for libpq5 * fix: syntax * fix: different syntax * fix: rely on ppa * fix: ppa removal * fix: change to trigger workflow * fix: adding a test to see postgres version * fix: testing for failure related to libpq5 version issue * test: include read-only test for postgrest * test: reduce log access time * test: make sure to fail if version wrong * chore: bump vars * ci: no longer build Oriole QEMU artifact Said artifact is no longer being used. If needed in the future, it can be trivially reintroduced, but in the meantime there's no reason to expend resources on them. * chore: disable auth config reloading within qemu artifact The QEMU artifact is not running with a filesystem that supports the inotify API, resulting in spurious error messages, and broken config reloading. * chore: strip out unnecessary dependencies from QEMU builds Also upgrades to Alpine 3.22. * chore: version bumps * tests: update user and group test adding gandalf * chore: add gandalf user to user list --------- Co-authored-by: Crispy1975 <12525875+Crispy1975@users.noreply.github.com> Co-authored-by: samrose Co-authored-by: Div Arora --- .../files/gandalf_config/gandalf.sudoers.conf | 2 + .../files/gandalf_config/gandalf_salt.service | 19 ++++ .../files/gandalf_config/gandalf_salt.timer | 13 +++ ansible/files/permission_check.py | 10 +++ ansible/manifest-playbook.yml | 18 ++++ ansible/tasks/internal/gandalf.yml | 87 +++++++++++++++++++ ansible/tasks/setup-supabase-internal.yml | 5 ++ ansible/vars.yml | 8 +- 8 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 ansible/files/gandalf_config/gandalf.sudoers.conf create mode 100644 ansible/files/gandalf_config/gandalf_salt.service create mode 100644 ansible/files/gandalf_config/gandalf_salt.timer create mode 100644 ansible/tasks/internal/gandalf.yml diff --git a/ansible/files/gandalf_config/gandalf.sudoers.conf b/ansible/files/gandalf_config/gandalf.sudoers.conf new file mode 100644 index 000000000..bf2517490 --- /dev/null +++ b/ansible/files/gandalf_config/gandalf.sudoers.conf @@ -0,0 +1,2 @@ +%gandalf ALL= NOPASSWD: /usr/bin/salt-call +%gandalf ALL= NOPASSWD: /usr/bin/gpg --homedir /etc/salt/gpgkeys --import, /usr/bin/gpg --homedir /etc/salt/gpgkeys --list-secret-keys * diff --git a/ansible/files/gandalf_config/gandalf_salt.service b/ansible/files/gandalf_config/gandalf_salt.service new file mode 100644 index 000000000..c70db7ed8 --- /dev/null +++ b/ansible/files/gandalf_config/gandalf_salt.service @@ -0,0 +1,19 @@ +[Unit] +Description=Configuration management via gandalf salt +After=network.target + +[Service] +Type=oneshot +ExecStart=/opt/gandalf/gandalf --config /opt/gandalf/config.yaml salt --apply --store-result +User=gandalf +Group=gandalf +StandardOutput=journal +StandardError=journal +StateDirectory=gandalf +CacheDirectory=gandalf + +# Security hardening +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/ansible/files/gandalf_config/gandalf_salt.timer b/ansible/files/gandalf_config/gandalf_salt.timer new file mode 100644 index 000000000..6862ca402 --- /dev/null +++ b/ansible/files/gandalf_config/gandalf_salt.timer @@ -0,0 +1,13 @@ +[Unit] +Description=Run Supabase gandalf salt on a schedule +Requires=gandalf_salt.service + +[Timer] +OnCalendar=*:0/10 +# Random delay up to 30 seconds splay +RandomizedDelaySec=30 +AccuracySec=1s +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index a753f69ec..b34a56bb4 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -94,11 +94,17 @@ "systemd-coredump": [ {"groupname": "systemd-coredump", "username": "systemd-coredump"} ], + "gandalf": [ + {"groupname": "gandalf", "username": "gandalf"}, + {"groupname": "admin", "username": "gandalf"}, + {"groupname": "salt", "username": "gandalf"}, + ], } # postgresql.service is expected to mount /etc as read-only expected_mount = "/etc ro" + # This program depends on osquery being installed on the system # Function to run osquery def run_osquery(query): @@ -154,6 +160,7 @@ def check_nixbld_users(): print("All nixbld users are in the 'nixbld' group.") + def check_postgresql_mount(): # processes table has the nix .postgres-wrapped path as the # binary path, rather than /usr/lib/postgresql/bin/postgres which @@ -182,6 +189,7 @@ def check_postgresql_mount(): print("postgresql.service mounts /etc as read-only.") + def main(): parser = argparse.ArgumentParser( prog="Supabase Postgres Artifact Permissions Checker", @@ -234,6 +242,7 @@ def main(): "postgrest", "tcpdump", "systemd-coredump", + "gandalf", ] if not qemu_artifact: usernames.append("ec2-instance-connect") @@ -251,5 +260,6 @@ def main(): # Check if postgresql.service is using a read-only mount for /etc check_postgresql_mount() + if __name__ == "__main__": main() diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 5c1c65053..583e3596c 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -61,6 +61,22 @@ shell: | cd /tmp && tar -cJf admin-mgr-{{ adminmgr_release }}-arm64.tar.xz admin-mgr + - name: Download gandalf archive + get_url: + url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf_%7B%7B%20gandalf_release%20%7D%7D_linux_arm64.tar.gz" + dest: "/tmp/gandalf.tar.gz" + timeout: 90 + + - name: gandalf - unpack archive in /tmp + unarchive: + remote_src: yes + src: /tmp/gandalf.tar.gz + dest: /tmp + + - name: gandalf - pack archive + shell: | + cd /tmp && tar -cJf gandalf-{{ gandalf_release }}-arm64.tar.xz gandalf + - name: upload archives shell: | aws s3 cp /tmp/{{ item.file }} s3://{{ internal_artifacts_bucket }}/upgrades/{{ item.service }}/{{ item.file }} @@ -73,3 +89,5 @@ file: supabase-admin-api-{{ adminapi_release }}-arm64.tar.xz - service: admin-mgr file: admin-mgr-{{ adminmgr_release }}-arm64.tar.xz + - service: gandalf + file: gandalf-{{ gandalf_release }}-arm64.tar.xz diff --git a/ansible/tasks/internal/gandalf.yml b/ansible/tasks/internal/gandalf.yml new file mode 100644 index 000000000..2c0d03fba --- /dev/null +++ b/ansible/tasks/internal/gandalf.yml @@ -0,0 +1,87 @@ +- name: gandalf - system group + group: + name: gandalf + system: yes + +- name: gandalf - system user + user: + name: gandalf + group: gandalf + groups: admin,salt + append: yes + system: yes + shell: /bin/sh + +- name: gandalf - config dir + file: + path: /opt/gandalf + owner: gandalf + state: directory + +- name: gandalf - gpg dir + file: + path: /etc/salt/gpgkeys + owner: root + group: salt + state: directory + +- name: give gandalf user permissions + copy: + src: files/gandalf_config/gandalf.sudoers.conf + dest: /etc/sudoers.d/gandalf + mode: "0644" + +- name: Setting arch (x86) + set_fact: + arch: "x86" + when: platform == "amd64" + +- name: Setting arch (arm) + set_fact: + arch: "arm64" + when: platform == "arm64" + +- name: Download gandalf archive + get_url: + url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf-%7B%7B%20gandalf_release%20%7D%7D-linux-%7B%7B%20arch%20%7D%7D.tar.gz" + dest: "/tmp/gandalf.tar.gz" + timeout: 90 + +- name: gandalf - unpack archive in /opt + unarchive: + remote_src: yes + src: /tmp/gandalf.tar.gz + dest: /opt/gandalf/ + owner: gandalf + extra_opts: + - --strip-components=1 + +- name: gandalf - create symlink + ansible.builtin.file: + path: /opt/gandalf/gandalf + src: "/opt/gandalf/gandalf-linux-{{ arch }}" + state: link + owner: gandalf + mode: "0755" + force: yes + +- name: gandalf - create salt systemd timer file + copy: + src: files/gandalf_config/gandalf_salt.timer + dest: /etc/systemd/system/gandalf_salt.timer + +- name: gandalf - create salt service file + copy: + src: files/gandalf_config/gandalf_salt.service + dest: /etc/systemd/system/gandalf_salt.service + +- name: gandalf - reload systemd + systemd: + daemon_reload: yes + +# Initially ensure gandalf is installed but not started +- name: gandalf - DISABLE service + systemd: + name: gandalf_salt + enabled: no + state: stopped diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index 7aa931763..5a37dbaa0 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -115,5 +115,10 @@ tags: - aws-only +- name: Install gandalf + import_tasks: internal/gandalf.yml + tags: + - aws-only + - name: Envoy - use lds.supabase.yaml for /etc/envoy/lds.yaml command: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml diff --git a/ansible/vars.yml b/ansible/vars.yml index 2d6465832..939c892d1 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.095-orioledb" - postgres17: "17.4.1.45" - postgres15: "15.8.1.102" + postgresorioledb-17: "17.0.1.096-orioledb" + postgres17: "17.4.1.046" + postgres15: "15.8.1.103" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -57,3 +57,5 @@ adminmgr_release: 0.25.1 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" + +gandalf_release: 1.4.30 From 00cb0aa88617b2606a971d1d73d28fda89f41ffc Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 26 Jun 2025 01:01:21 +0800 Subject: [PATCH 014/134] fix: gandalf path name Should use `-` instead of `_` --- ansible/manifest-playbook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 583e3596c..a7d004ee0 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -63,7 +63,7 @@ - name: Download gandalf archive get_url: - url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf_%7B%7B%20gandalf_release%20%7D%7D_linux_arm64.tar.gz" + url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf-%7B%7B%20gandalf_release%20%7D%7D-linux-arm64.tar.gz" dest: "/tmp/gandalf.tar.gz" timeout: 90 From 58024c1f1ccc9925f59930e3f96e84c2a7b400fc Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 25 Jun 2025 18:21:33 -0400 Subject: [PATCH 015/134] Sam/revert wandelf (#1673) * Revert "fix: gandalf path name" This reverts commit 00cb0aa88617b2606a971d1d73d28fda89f41ffc. * Revert "feat: Install gandalf, salt-wrapper for infra (#1657)" This reverts commit e321760fb40e1af3266a64768432a1d5c695aa26. * chore: bump versions --- .../files/gandalf_config/gandalf.sudoers.conf | 2 - .../files/gandalf_config/gandalf_salt.service | 19 ---- .../files/gandalf_config/gandalf_salt.timer | 13 --- ansible/files/permission_check.py | 10 --- ansible/manifest-playbook.yml | 18 ---- ansible/tasks/internal/gandalf.yml | 87 ------------------- ansible/tasks/setup-supabase-internal.yml | 5 -- ansible/vars.yml | 8 +- 8 files changed, 3 insertions(+), 159 deletions(-) delete mode 100644 ansible/files/gandalf_config/gandalf.sudoers.conf delete mode 100644 ansible/files/gandalf_config/gandalf_salt.service delete mode 100644 ansible/files/gandalf_config/gandalf_salt.timer delete mode 100644 ansible/tasks/internal/gandalf.yml diff --git a/ansible/files/gandalf_config/gandalf.sudoers.conf b/ansible/files/gandalf_config/gandalf.sudoers.conf deleted file mode 100644 index bf2517490..000000000 --- a/ansible/files/gandalf_config/gandalf.sudoers.conf +++ /dev/null @@ -1,2 +0,0 @@ -%gandalf ALL= NOPASSWD: /usr/bin/salt-call -%gandalf ALL= NOPASSWD: /usr/bin/gpg --homedir /etc/salt/gpgkeys --import, /usr/bin/gpg --homedir /etc/salt/gpgkeys --list-secret-keys * diff --git a/ansible/files/gandalf_config/gandalf_salt.service b/ansible/files/gandalf_config/gandalf_salt.service deleted file mode 100644 index c70db7ed8..000000000 --- a/ansible/files/gandalf_config/gandalf_salt.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Configuration management via gandalf salt -After=network.target - -[Service] -Type=oneshot -ExecStart=/opt/gandalf/gandalf --config /opt/gandalf/config.yaml salt --apply --store-result -User=gandalf -Group=gandalf -StandardOutput=journal -StandardError=journal -StateDirectory=gandalf -CacheDirectory=gandalf - -# Security hardening -PrivateTmp=true - -[Install] -WantedBy=multi-user.target diff --git a/ansible/files/gandalf_config/gandalf_salt.timer b/ansible/files/gandalf_config/gandalf_salt.timer deleted file mode 100644 index 6862ca402..000000000 --- a/ansible/files/gandalf_config/gandalf_salt.timer +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Run Supabase gandalf salt on a schedule -Requires=gandalf_salt.service - -[Timer] -OnCalendar=*:0/10 -# Random delay up to 30 seconds splay -RandomizedDelaySec=30 -AccuracySec=1s -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index b34a56bb4..a753f69ec 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -94,17 +94,11 @@ "systemd-coredump": [ {"groupname": "systemd-coredump", "username": "systemd-coredump"} ], - "gandalf": [ - {"groupname": "gandalf", "username": "gandalf"}, - {"groupname": "admin", "username": "gandalf"}, - {"groupname": "salt", "username": "gandalf"}, - ], } # postgresql.service is expected to mount /etc as read-only expected_mount = "/etc ro" - # This program depends on osquery being installed on the system # Function to run osquery def run_osquery(query): @@ -160,7 +154,6 @@ def check_nixbld_users(): print("All nixbld users are in the 'nixbld' group.") - def check_postgresql_mount(): # processes table has the nix .postgres-wrapped path as the # binary path, rather than /usr/lib/postgresql/bin/postgres which @@ -189,7 +182,6 @@ def check_postgresql_mount(): print("postgresql.service mounts /etc as read-only.") - def main(): parser = argparse.ArgumentParser( prog="Supabase Postgres Artifact Permissions Checker", @@ -242,7 +234,6 @@ def main(): "postgrest", "tcpdump", "systemd-coredump", - "gandalf", ] if not qemu_artifact: usernames.append("ec2-instance-connect") @@ -260,6 +251,5 @@ def main(): # Check if postgresql.service is using a read-only mount for /etc check_postgresql_mount() - if __name__ == "__main__": main() diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index a7d004ee0..5c1c65053 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -61,22 +61,6 @@ shell: | cd /tmp && tar -cJf admin-mgr-{{ adminmgr_release }}-arm64.tar.xz admin-mgr - - name: Download gandalf archive - get_url: - url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf-%7B%7B%20gandalf_release%20%7D%7D-linux-arm64.tar.gz" - dest: "/tmp/gandalf.tar.gz" - timeout: 90 - - - name: gandalf - unpack archive in /tmp - unarchive: - remote_src: yes - src: /tmp/gandalf.tar.gz - dest: /tmp - - - name: gandalf - pack archive - shell: | - cd /tmp && tar -cJf gandalf-{{ gandalf_release }}-arm64.tar.xz gandalf - - name: upload archives shell: | aws s3 cp /tmp/{{ item.file }} s3://{{ internal_artifacts_bucket }}/upgrades/{{ item.service }}/{{ item.file }} @@ -89,5 +73,3 @@ file: supabase-admin-api-{{ adminapi_release }}-arm64.tar.xz - service: admin-mgr file: admin-mgr-{{ adminmgr_release }}-arm64.tar.xz - - service: gandalf - file: gandalf-{{ gandalf_release }}-arm64.tar.xz diff --git a/ansible/tasks/internal/gandalf.yml b/ansible/tasks/internal/gandalf.yml deleted file mode 100644 index 2c0d03fba..000000000 --- a/ansible/tasks/internal/gandalf.yml +++ /dev/null @@ -1,87 +0,0 @@ -- name: gandalf - system group - group: - name: gandalf - system: yes - -- name: gandalf - system user - user: - name: gandalf - group: gandalf - groups: admin,salt - append: yes - system: yes - shell: /bin/sh - -- name: gandalf - config dir - file: - path: /opt/gandalf - owner: gandalf - state: directory - -- name: gandalf - gpg dir - file: - path: /etc/salt/gpgkeys - owner: root - group: salt - state: directory - -- name: give gandalf user permissions - copy: - src: files/gandalf_config/gandalf.sudoers.conf - dest: /etc/sudoers.d/gandalf - mode: "0644" - -- name: Setting arch (x86) - set_fact: - arch: "x86" - when: platform == "amd64" - -- name: Setting arch (arm) - set_fact: - arch: "arm64" - when: platform == "arm64" - -- name: Download gandalf archive - get_url: - url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/gandalf/v%7B%7B%20gandalf_release%20%7D%7D/gandalf-%7B%7B%20gandalf_release%20%7D%7D-linux-%7B%7B%20arch%20%7D%7D.tar.gz" - dest: "/tmp/gandalf.tar.gz" - timeout: 90 - -- name: gandalf - unpack archive in /opt - unarchive: - remote_src: yes - src: /tmp/gandalf.tar.gz - dest: /opt/gandalf/ - owner: gandalf - extra_opts: - - --strip-components=1 - -- name: gandalf - create symlink - ansible.builtin.file: - path: /opt/gandalf/gandalf - src: "/opt/gandalf/gandalf-linux-{{ arch }}" - state: link - owner: gandalf - mode: "0755" - force: yes - -- name: gandalf - create salt systemd timer file - copy: - src: files/gandalf_config/gandalf_salt.timer - dest: /etc/systemd/system/gandalf_salt.timer - -- name: gandalf - create salt service file - copy: - src: files/gandalf_config/gandalf_salt.service - dest: /etc/systemd/system/gandalf_salt.service - -- name: gandalf - reload systemd - systemd: - daemon_reload: yes - -# Initially ensure gandalf is installed but not started -- name: gandalf - DISABLE service - systemd: - name: gandalf_salt - enabled: no - state: stopped diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index 5a37dbaa0..7aa931763 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -115,10 +115,5 @@ tags: - aws-only -- name: Install gandalf - import_tasks: internal/gandalf.yml - tags: - - aws-only - - name: Envoy - use lds.supabase.yaml for /etc/envoy/lds.yaml command: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml diff --git a/ansible/vars.yml b/ansible/vars.yml index 939c892d1..446bf6be7 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.096-orioledb" - postgres17: "17.4.1.046" - postgres15: "15.8.1.103" + postgresorioledb-17: "17.0.1.097-orioledb" + postgres17: "17.4.1.47" + postgres15: "15.8.1.104" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -57,5 +57,3 @@ adminmgr_release: 0.25.1 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" - -gandalf_release: 1.4.30 From 0271bfe9d773e36c8bece342c72d0eaba064f563 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Thu, 26 Jun 2025 17:16:32 +0800 Subject: [PATCH 016/134] fix: allow postgres to grant storage privs to other roles (#1666) * fix: allow postgres to grant storage privs to other roles Temporary fix until STORAGE-211 is completed * chore: bump AMI versions * chore: bump AMI versions --- ansible/vars.yml | 6 ++-- ...e_tables_to_postgres_with_grant_option.sql | 6 ++++ nix/tests/expected/storage.out | 28 +++++++++---------- 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 migrations/db/migrations/20250623125453_tmp_grant_storage_tables_to_postgres_with_grant_option.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 446bf6be7..7a7147353 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.097-orioledb" - postgres17: "17.4.1.47" - postgres15: "15.8.1.104" + postgresorioledb-17: "17.0.1.098-orioledb" + postgres17: "17.4.1.048" + postgres15: "15.8.1.105" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250623125453_tmp_grant_storage_tables_to_postgres_with_grant_option.sql b/migrations/db/migrations/20250623125453_tmp_grant_storage_tables_to_postgres_with_grant_option.sql new file mode 100644 index 000000000..465aee226 --- /dev/null +++ b/migrations/db/migrations/20250623125453_tmp_grant_storage_tables_to_postgres_with_grant_option.sql @@ -0,0 +1,6 @@ +-- migrate:up +-- TODO: remove this migration once STORAGE-211 is completed +-- DRI: bobbie +grant all on storage.buckets, storage.objects to postgres with grant option; + +-- migrate:down diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index 353604ec8..fc1882923 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -81,13 +81,13 @@ order by storage | buckets | authenticated | TRIGGER | f storage | buckets | authenticated | TRUNCATE | f storage | buckets | authenticated | UPDATE | f - storage | buckets | postgres | DELETE | f - storage | buckets | postgres | INSERT | f - storage | buckets | postgres | REFERENCES | f - storage | buckets | postgres | SELECT | f - storage | buckets | postgres | TRIGGER | f - storage | buckets | postgres | TRUNCATE | f - storage | buckets | postgres | UPDATE | f + storage | buckets | postgres | DELETE | t + storage | buckets | postgres | INSERT | t + storage | buckets | postgres | REFERENCES | t + storage | buckets | postgres | SELECT | t + storage | buckets | postgres | TRIGGER | t + storage | buckets | postgres | TRUNCATE | t + storage | buckets | postgres | UPDATE | t storage | buckets | service_role | DELETE | f storage | buckets | service_role | INSERT | f storage | buckets | service_role | REFERENCES | f @@ -123,13 +123,13 @@ order by storage | objects | authenticated | TRIGGER | f storage | objects | authenticated | TRUNCATE | f storage | objects | authenticated | UPDATE | f - storage | objects | postgres | DELETE | f - storage | objects | postgres | INSERT | f - storage | objects | postgres | REFERENCES | f - storage | objects | postgres | SELECT | f - storage | objects | postgres | TRIGGER | f - storage | objects | postgres | TRUNCATE | f - storage | objects | postgres | UPDATE | f + storage | objects | postgres | DELETE | t + storage | objects | postgres | INSERT | t + storage | objects | postgres | REFERENCES | t + storage | objects | postgres | SELECT | t + storage | objects | postgres | TRIGGER | t + storage | objects | postgres | TRUNCATE | t + storage | objects | postgres | UPDATE | t storage | objects | service_role | DELETE | f storage | objects | service_role | INSERT | f storage | objects | service_role | REFERENCES | f From c57842fd08328761ca3877800eccd638fce0fc2d Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 26 Jun 2025 15:32:35 -0400 Subject: [PATCH 017/134] test: tests on various docs pages for supabase docs (#1675) * test: tests on various docs pages for supabase docs * tests: more docs tests * tests: the rest of the postgres supabase docs tests` --- nix/tests/expected/docs-array-test.out | 19 + nix/tests/expected/docs-cascades-deletes.out | 373 +++++++++++++++++++ nix/tests/expected/docs-connections.out | 26 ++ nix/tests/expected/docs-enums.out | 185 +++++++++ nix/tests/expected/docs-full-text-search.out | 296 +++++++++++++++ nix/tests/expected/docs-functions.out | 230 ++++++++++++ nix/tests/expected/docs-indexes.out | 22 ++ nix/tests/expected/docs-json.out | 52 +++ nix/tests/expected/docs-partitioning.out | 110 ++++++ nix/tests/expected/docs-tables-and-data.out | 286 ++++++++++++++ nix/tests/expected/docs-triggers.out | 217 +++++++++++ nix/tests/expected/docs-webhooks.out | 266 +++++++++++++ nix/tests/sql/docs-array-test.sql | 14 + nix/tests/sql/docs-cascades-deletes.sql | 262 +++++++++++++ nix/tests/sql/docs-connections.sql | 12 + nix/tests/sql/docs-enums.sql | 154 ++++++++ nix/tests/sql/docs-full-text-search.sql | 197 ++++++++++ nix/tests/sql/docs-functions.sql | 225 +++++++++++ nix/tests/sql/docs-indexes.sql | 26 ++ nix/tests/sql/docs-json.sql | 47 +++ nix/tests/sql/docs-partitioning.sql | 89 +++++ nix/tests/sql/docs-tables-and-data.sql | 249 +++++++++++++ nix/tests/sql/docs-triggers.sql | 226 +++++++++++ nix/tests/sql/docs-webhooks.sql | 262 +++++++++++++ 24 files changed, 3845 insertions(+) create mode 100644 nix/tests/expected/docs-array-test.out create mode 100644 nix/tests/expected/docs-cascades-deletes.out create mode 100644 nix/tests/expected/docs-connections.out create mode 100644 nix/tests/expected/docs-enums.out create mode 100644 nix/tests/expected/docs-full-text-search.out create mode 100644 nix/tests/expected/docs-functions.out create mode 100644 nix/tests/expected/docs-indexes.out create mode 100644 nix/tests/expected/docs-json.out create mode 100644 nix/tests/expected/docs-partitioning.out create mode 100644 nix/tests/expected/docs-tables-and-data.out create mode 100644 nix/tests/expected/docs-triggers.out create mode 100644 nix/tests/expected/docs-webhooks.out create mode 100644 nix/tests/sql/docs-array-test.sql create mode 100644 nix/tests/sql/docs-cascades-deletes.sql create mode 100644 nix/tests/sql/docs-connections.sql create mode 100644 nix/tests/sql/docs-enums.sql create mode 100644 nix/tests/sql/docs-full-text-search.sql create mode 100644 nix/tests/sql/docs-functions.sql create mode 100644 nix/tests/sql/docs-indexes.sql create mode 100644 nix/tests/sql/docs-json.sql create mode 100644 nix/tests/sql/docs-partitioning.sql create mode 100644 nix/tests/sql/docs-tables-and-data.sql create mode 100644 nix/tests/sql/docs-triggers.sql create mode 100644 nix/tests/sql/docs-webhooks.sql diff --git a/nix/tests/expected/docs-array-test.out b/nix/tests/expected/docs-array-test.out new file mode 100644 index 000000000..5b27d9ba5 --- /dev/null +++ b/nix/tests/expected/docs-array-test.out @@ -0,0 +1,19 @@ +-- testing sql found in https://supabase.com/docs/guides/database/arrays +create table arraytest ( + id integer not null, + textarray text array +); +INSERT INTO arraytest (id, textarray) VALUES (1, ARRAY['Harry', 'Larry', 'Moe']);; +select * from arraytest; + id | textarray +----+------------------- + 1 | {Harry,Larry,Moe} +(1 row) + +SELECT textarray[1], array_length(textarray, 1) FROM arraytest; + textarray | array_length +-----------+-------------- + Harry | 3 +(1 row) + +drop table arraytest cascade; diff --git a/nix/tests/expected/docs-cascades-deletes.out b/nix/tests/expected/docs-cascades-deletes.out new file mode 100644 index 000000000..1f5d5f777 --- /dev/null +++ b/nix/tests/expected/docs-cascades-deletes.out @@ -0,0 +1,373 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgres/cascades-deletes +-- all of the errors produced by this file are expected +create table grandparent ( + id serial primary key, + name text +); +create table parent ( + id serial primary key, + name text, + parent_id integer references grandparent (id) + on delete cascade +); +create table child ( + id serial primary key, + name text, + father integer references parent (id) + on delete restrict +); +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); +insert into child + (id, name, father) +values + (1, 'William', 1); +select count(*) from grandparent; + count +------- + 1 +(1 row) + +select count(*) from parent; + count +------- + 2 +(1 row) + +select count(*) from child; + count +------- + 1 +(1 row) + +delete from grandparent; +ERROR: update or delete on table "parent" violates foreign key constraint "child_father_fkey" on table "child" +DETAIL: Key (id)=(1) is still referenced from table "child". +select count(*) from grandparent; + count +------- + 1 +(1 row) + +select count(*) from parent; + count +------- + 2 +(1 row) + +select count(*) from child; + count +------- + 1 +(1 row) + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); +ERROR: duplicate key value violates unique constraint "grandparent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(2) already exists. +insert into child + (id, name, father) +values + (1, 'William', 1); +ERROR: duplicate key value violates unique constraint "child_pkey" +DETAIL: Key (id)=(1) already exists. +alter table child +drop constraint child_father_fkey; +alter table child +add constraint child_father_fkey foreign key (father) references parent (id) + on delete no action; +delete from grandparent; +ERROR: update or delete on table "parent" violates foreign key constraint "child_father_fkey" on table "child" +DETAIL: Key (id)=(1) is still referenced from table "child". +select count(*) from grandparent; + count +------- + 1 +(1 row) + +select count(*) from parent; + count +------- + 2 +(1 row) + +select count(*) from child; + count +------- + 1 +(1 row) + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); +ERROR: duplicate key value violates unique constraint "grandparent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(2) already exists. +insert into child + (id, name, father) +values + (1, 'William', 1); +ERROR: duplicate key value violates unique constraint "child_pkey" +DETAIL: Key (id)=(1) already exists. +alter table child +drop constraint child_father_fkey; +alter table child +add constraint child_father_fkey foreign key (father) references parent (id) + on delete no action initially deferred; +delete from grandparent; +ERROR: update or delete on table "parent" violates foreign key constraint "child_father_fkey" on table "child" +DETAIL: Key (id)=(1) is still referenced from table "child". +select count(*) from grandparent; + count +------- + 1 +(1 row) + +select count(*) from parent; + count +------- + 2 +(1 row) + +select count(*) from child; + count +------- + 1 +(1 row) + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); +ERROR: duplicate key value violates unique constraint "grandparent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(1) already exists. +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); +ERROR: duplicate key value violates unique constraint "parent_pkey" +DETAIL: Key (id)=(2) already exists. +insert into child + (id, name, father) +values + (1, 'William', 1); +ERROR: duplicate key value violates unique constraint "child_pkey" +DETAIL: Key (id)=(1) already exists. +alter table child +add column mother integer references parent (id) + on delete cascade; +update child +set mother = 2 +where id = 1; +delete from grandparent; +select count(*) from grandparent; + count +------- + 0 +(1 row) + +select count(*) from parent; + count +------- + 0 +(1 row) + +select count(*) from child; + count +------- + 0 +(1 row) + +create table test_cascade ( + id serial primary key, + name text +); +create table test_cascade_child ( + id serial primary key, + parent_id integer references test_cascade (id) on delete cascade, + name text +); +insert into test_cascade (name) values ('Parent'); +insert into test_cascade_child (parent_id, name) values (1, 'Child'); +delete from test_cascade; +select count(*) from test_cascade; + count +------- + 0 +(1 row) + +select count(*) from test_cascade_child; + count +------- + 0 +(1 row) + +create table test_restrict ( + id serial primary key, + name text +); +create table test_restrict_child ( + id serial primary key, + parent_id integer references test_restrict (id) on delete restrict, + name text +); +insert into test_restrict (name) values ('Parent'); +insert into test_restrict_child (parent_id, name) values (1, 'Child'); +delete from test_restrict; +ERROR: update or delete on table "test_restrict" violates foreign key constraint "test_restrict_child_parent_id_fkey" on table "test_restrict_child" +DETAIL: Key (id)=(1) is still referenced from table "test_restrict_child". +select count(*) from test_restrict; + count +------- + 1 +(1 row) + +select count(*) from test_restrict_child; + count +------- + 1 +(1 row) + +create table test_set_null ( + id serial primary key, + name text +); +create table test_set_null_child ( + id serial primary key, + parent_id integer references test_set_null (id) on delete set null, + name text +); +insert into test_set_null (name) values ('Parent'); +insert into test_set_null_child (parent_id, name) values (1, 'Child'); +delete from test_set_null; +select count(*) from test_set_null; + count +------- + 0 +(1 row) + +select count(*) from test_set_null_child; + count +------- + 1 +(1 row) + +select parent_id from test_set_null_child; + parent_id +----------- + +(1 row) + +create table test_set_default ( + id serial primary key, + name text +); +create table test_set_default_child ( + id serial primary key, + parent_id integer default 999 references test_set_default (id) on delete set default, + name text +); +insert into test_set_default (name) values ('Parent'); +insert into test_set_default_child (parent_id, name) values (1, 'Child'); +delete from test_set_default; +ERROR: insert or update on table "test_set_default_child" violates foreign key constraint "test_set_default_child_parent_id_fkey" +DETAIL: Key (parent_id)=(999) is not present in table "test_set_default". +select count(*) from test_set_default; + count +------- + 1 +(1 row) + +select count(*) from test_set_default_child; + count +------- + 1 +(1 row) + +select parent_id from test_set_default_child; + parent_id +----------- + 1 +(1 row) + +create table test_no_action ( + id serial primary key, + name text +); +create table test_no_action_child ( + id serial primary key, + parent_id integer references test_no_action (id) on delete no action, + name text +); +insert into test_no_action (name) values ('Parent'); +insert into test_no_action_child (parent_id, name) values (1, 'Child'); +delete from test_no_action; +ERROR: update or delete on table "test_no_action" violates foreign key constraint "test_no_action_child_parent_id_fkey" on table "test_no_action_child" +DETAIL: Key (id)=(1) is still referenced from table "test_no_action_child". +select count(*) from test_no_action; + count +------- + 1 +(1 row) + +select count(*) from test_no_action_child; + count +------- + 1 +(1 row) + +drop table if exists test_cascade_child; +drop table if exists test_cascade; +drop table if exists test_restrict_child; +drop table if exists test_restrict; +drop table if exists test_set_null_child; +drop table if exists test_set_null; +drop table if exists test_set_default_child; +drop table if exists test_set_default; +drop table if exists test_no_action_child; +drop table if exists test_no_action; +drop table if exists child; +drop table if exists parent; +drop table if exists grandparent; diff --git a/nix/tests/expected/docs-connections.out b/nix/tests/expected/docs-connections.out new file mode 100644 index 000000000..d4e6d1106 --- /dev/null +++ b/nix/tests/expected/docs-connections.out @@ -0,0 +1,26 @@ +-- testing sql found in https://supabase.com/docs/guides/database/connection-management +-- we can't test every sql statement in this doc because their results won't be deterministic +select + ssl, + datname as database, + usename as connected_role, + application_name, + query, + state +from pg_stat_ssl +join pg_stat_activity +on pg_stat_ssl.pid = pg_stat_activity.pid; + ssl | database | connected_role | application_name | query | state +-----+----------+----------------+-----------------------------+--------------------------------------------+-------- + f | postgres | supabase_admin | pg_regress/docs-connections | select +| active + | | | | ssl, +| + | | | | datname as database, +| + | | | | usename as connected_role, +| + | | | | application_name, +| + | | | | query, +| + | | | | state +| + | | | | from pg_stat_ssl +| + | | | | join pg_stat_activity +| + | | | | on pg_stat_ssl.pid = pg_stat_activity.pid; | +(1 row) + diff --git a/nix/tests/expected/docs-enums.out b/nix/tests/expected/docs-enums.out new file mode 100644 index 000000000..da2d06d42 --- /dev/null +++ b/nix/tests/expected/docs-enums.out @@ -0,0 +1,185 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgresenums +create type mood as enum ( + 'happy', + 'sad', + 'excited', + 'calm' +); +create table person ( + id serial primary key, + name text, + current_mood mood +); +insert into person + (name, current_mood) +values + ('Alice', 'happy'); +insert into person + (name, current_mood) +values + ('Bob', 'sad'); +insert into person + (name, current_mood) +values + ('Charlie', 'excited'); +select * +from person +where current_mood = 'sad'; + id | name | current_mood +----+------+-------------- + 2 | Bob | sad +(1 row) + +select * +from person +where current_mood = 'happy'; + id | name | current_mood +----+-------+-------------- + 1 | Alice | happy +(1 row) + +update person +set current_mood = 'excited' +where name = 'Alice'; +select * +from person +where name = 'Alice'; + id | name | current_mood +----+-------+-------------- + 1 | Alice | excited +(1 row) + +alter type mood add value 'content'; +insert into person + (name, current_mood) +values + ('David', 'content'); +select enum_range(null::mood); + enum_range +---------------------------------- + {happy,sad,excited,calm,content} +(1 row) + +select * +from person +where current_mood = 'content'; + id | name | current_mood +----+-------+-------------- + 4 | David | content +(1 row) + +create type status as enum ( + 'active', + 'inactive', + 'pending' +); +create table orders ( + id serial primary key, + order_number text, + status status +); +insert into orders + (order_number, status) +values + ('ORD-001', 'active'), + ('ORD-002', 'pending'), + ('ORD-003', 'inactive'); +select * +from orders +where status = 'active'; + id | order_number | status +----+--------------+-------- + 1 | ORD-001 | active +(1 row) + +update orders +set status = 'inactive' +where order_number = 'ORD-002'; +select * +from orders +where order_number = 'ORD-002'; + id | order_number | status +----+--------------+---------- + 2 | ORD-002 | inactive +(1 row) + +alter type status add value 'cancelled'; +insert into orders + (order_number, status) +values + ('ORD-004', 'cancelled'); +select enum_range(null::status); + enum_range +------------------------------------- + {active,inactive,pending,cancelled} +(1 row) + +select * +from orders +where status = 'cancelled'; + id | order_number | status +----+--------------+----------- + 4 | ORD-004 | cancelled +(1 row) + +create type priority as enum ( + 'low', + 'medium', + 'high', + 'critical' +); +create table tasks ( + id serial primary key, + title text, + priority priority +); +insert into tasks + (title, priority) +values + ('Fix bug', 'high'), + ('Update docs', 'low'), + ('Security audit', 'critical'); +select * +from tasks +where priority = 'critical'; + id | title | priority +----+----------------+---------- + 3 | Security audit | critical +(1 row) + +update tasks +set priority = 'medium' +where title = 'Update docs'; +select * +from tasks +where title = 'Update docs'; + id | title | priority +----+-------------+---------- + 2 | Update docs | medium +(1 row) + +alter type priority add value 'urgent'; +insert into tasks + (title, priority) +values + ('Server maintenance', 'urgent'); +select enum_range(null::priority); + enum_range +----------------------------------- + {low,medium,high,critical,urgent} +(1 row) + +select * +from tasks +where priority = 'urgent'; + id | title | priority +----+--------------------+---------- + 4 | Server maintenance | urgent +(1 row) + +drop table tasks; +drop table orders; +drop table person; +drop type priority; +drop type status; +drop type mood; diff --git a/nix/tests/expected/docs-full-text-search.out b/nix/tests/expected/docs-full-text-search.out new file mode 100644 index 000000000..476c1ca02 --- /dev/null +++ b/nix/tests/expected/docs-full-text-search.out @@ -0,0 +1,296 @@ +-- testing sql found in https://supabase.com/docs/guides/database/full-text-search +create table books ( + id serial primary key, + title text, + author text, + description text +); +insert into books + (title, author, description) +values + ( + 'The Poky Little Puppy', + 'Janette Sebring Lowrey', + 'Puppy is slower than other, bigger animals.' + ), + ('The Tale of Peter Rabbit', 'Beatrix Potter', 'Rabbit eats some vegetables.'), + ('Tootle', 'Gertrude Crampton', 'Little toy train has big dreams.'), + ( + 'Green Eggs and Ham', + 'Dr. Seuss', + 'Sam has changing food preferences and eats unusually colored food.' + ), + ( + 'Harry Potter and the Goblet of Fire', + 'J.K. Rowling', + 'Fourth year of school starts, big drama ensues.' + ); +select to_tsvector('green eggs and ham'); + to_tsvector +--------------------------- + 'egg':2 'green':1 'ham':4 +(1 row) + +select to_tsvector('english', 'green eggs and ham'); + to_tsvector +--------------------------- + 'egg':2 'green':1 'ham':4 +(1 row) + +select * +from books +where title = 'Harry'; + id | title | author | description +----+-------+--------+------------- +(0 rows) + +select * +from books +where to_tsvector(title) @@ to_tsquery('Harry'); + id | title | author | description +----+-------------------------------------+--------------+------------------------------------------------- + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. +(1 row) + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('big'); + id | title | author | description +----+-------------------------------------+-------------------+------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. +(2 rows) + +select + * +from + books +where + to_tsvector(description || ' ' || title) + @@ to_tsquery('little'); + id | title | author | description +----+-----------------------+------------------------+--------------------------------------------- + 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. +(2 rows) + +create function title_description(books) returns text as $$ + select $1.title || ' ' || $1.description; +$$ language sql immutable; +select + * +from + books +where + to_tsvector(title_description(books.*)) + @@ to_tsquery('little'); + id | title | author | description +----+-----------------------+------------------------+--------------------------------------------- + 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. +(2 rows) + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('little & big'); + id | title | author | description +----+--------+-------------------+---------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. +(1 row) + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('little | big'); + id | title | author | description +----+-------------------------------------+-------------------+------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. +(2 rows) + +select title from books where to_tsvector(title) @@ to_tsquery('Lit:*'); + title +----------------------- + The Poky Little Puppy +(1 row) + +create or replace function search_books_by_title_prefix(prefix text) +returns setof books AS $$ +begin + return query + select * from books where to_tsvector('english', title) @@ to_tsquery(prefix || ':*'); +end; +$$ language plpgsql; +select * from search_books_by_title_prefix('Lit'); + id | title | author | description +----+-----------------------+------------------------+--------------------------------------------- + 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. +(1 row) + +select * from search_books_by_title_prefix('Little+Puppy'); + id | title | author | description +----+-----------------------+------------------------+--------------------------------------------- + 1 | The Poky Little Puppy | Janette Sebring Lowrey | Puppy is slower than other, bigger animals. +(1 row) + +alter table + books +add column + fts tsvector generated always as (to_tsvector('english', description || ' ' || title)) stored; +create index books_fts on books using gin (fts); +select id, fts +from books; + id | fts +----+----------------------------------------------------------------------------------------------------------------- + 1 | 'anim':7 'bigger':6 'littl':10 'poki':9 'puppi':1,11 'slower':3 + 2 | 'eat':2 'peter':8 'rabbit':1,9 'tale':6 'veget':4 + 3 | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 + 4 | 'chang':3 'color':9 'eat':7 'egg':12 'food':4,10 'green':11 'ham':14 'prefer':5 'sam':1 'unusu':8 + 5 | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 +(5 rows) + +select + * +from + books +where + fts @@ to_tsquery('little & big'); + id | title | author | description | fts +----+--------+-------------------+----------------------------------+--------------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 +(1 row) + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('big <-> dreams'); + id | title | author | description | fts +----+--------+-------------------+----------------------------------+--------------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 +(1 row) + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('year <2> school'); + id | title | author | description | fts +----+-------------------------------------+--------------+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------- + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 +(1 row) + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('big & !little'); + id | title | author | description | fts +----+-------------------------------------+--------------+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------- + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 +(1 row) + +select + * +from + books +where + to_tsvector(title) @@ to_tsquery('harry & potter'); + id | title | author | description | fts +----+-------------------------------------+--------------+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------- + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 +(1 row) + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('food & !egg'); + id | title | author | description | fts +----+--------------------+-----------+--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------- + 4 | Green Eggs and Ham | Dr. Seuss | Sam has changing food preferences and eats unusually colored food. | 'chang':3 'color':9 'eat':7 'egg':12 'food':4,10 'green':11 'ham':14 'prefer':5 'sam':1 'unusu':8 +(1 row) + +select + * +from + books +where + to_tsvector(title || ' ' || description) @@ to_tsquery('train & toy'); + id | title | author | description | fts +----+--------+-------------------+----------------------------------+--------------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 +(1 row) + +select + * +from + books +where + fts @@ to_tsquery('puppy & slow'); + id | title | author | description | fts +----+-------+--------+-------------+----- +(0 rows) + +select + * +from + books +where + fts @@ to_tsquery('rabbit | peter'); + id | title | author | description | fts +----+--------------------------+----------------+------------------------------+--------------------------------------------------- + 2 | The Tale of Peter Rabbit | Beatrix Potter | Rabbit eats some vegetables. | 'eat':2 'peter':8 'rabbit':1,9 'tale':6 'veget':4 +(1 row) + +select + * +from + books +where + fts @@ to_tsquery('harry <-> potter'); + id | title | author | description | fts +----+-------------------------------------+--------------+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------- + 5 | Harry Potter and the Goblet of Fire | J.K. Rowling | Fourth year of school starts, big drama ensues. | 'big':6 'drama':7 'ensu':8 'fire':15 'fourth':1 'goblet':13 'harri':9 'potter':10 'school':4 'start':5 'year':2 +(1 row) + +select + * +from + books +where + fts @@ to_tsquery('fourth <3> year'); + id | title | author | description | fts +----+-------+--------+-------------+----- +(0 rows) + +select + * +from + books +where + fts @@ to_tsquery('big & !drama'); + id | title | author | description | fts +----+--------+-------------------+----------------------------------+--------------------------------------------------------- + 3 | Tootle | Gertrude Crampton | Little toy train has big dreams. | 'big':5 'dream':6 'littl':1 'tootl':7 'toy':2 'train':3 +(1 row) + +drop function search_books_by_title_prefix(text); +drop function title_description(books); +drop table books; + diff --git a/nix/tests/expected/docs-functions.out b/nix/tests/expected/docs-functions.out new file mode 100644 index 000000000..1a2c6085c --- /dev/null +++ b/nix/tests/expected/docs-functions.out @@ -0,0 +1,230 @@ +-- testing sql found in https://supabase.com/docs/guides/database/functions +create or replace function hello_world() +returns text +language sql +as $$ + select 'hello world'; +$$; +select hello_world(); + hello_world +------------- + hello world +(1 row) + +create table planets ( + id serial primary key, + name text +); +insert into planets + (id, name) +values + (1, 'Tattoine'), + (2, 'Alderaan'), + (3, 'Kashyyyk'); +create table people ( + id serial primary key, + name text, + planet_id bigint references planets +); +insert into people + (id, name, planet_id) +values + (1, 'Anakin Skywalker', 1), + (2, 'Luke Skywalker', 1), + (3, 'Princess Leia', 2), + (4, 'Chewbacca', 3); +create or replace function get_planets() +returns setof planets +language sql +as $$ + select * from planets; +$$; +select * +from get_planets() +where id = 1; + id | name +----+---------- + 1 | Tattoine +(1 row) + +create or replace function add_planet(name text) +returns bigint +language plpgsql +as $$ +declare + new_row bigint; +begin + insert into planets(name) + values (add_planet.name) + returning id into new_row; + + return new_row; +end; +$$; +select * from add_planet('Jakku'); +ERROR: duplicate key value violates unique constraint "planets_pkey" +DETAIL: Key (id)=(1) already exists. +CONTEXT: SQL statement "insert into planets(name) + values (add_planet.name) + returning id" +PL/pgSQL function add_planet(text) line 5 at SQL statement +create function hello_world_definer() +returns text +language plpgsql +security definer set search_path = '' +as $$ +begin + select 'hello world'; +end; +$$; +select hello_world_definer(); +ERROR: query has no destination for result data +HINT: If you want to discard the results of a SELECT, use PERFORM instead. +CONTEXT: PL/pgSQL function public.hello_world_definer() line 3 at SQL statement +revoke execute on function public.hello_world from public; +revoke execute on function public.hello_world from anon; +grant execute on function public.hello_world to authenticated; +revoke execute on all functions in schema public from public; +revoke execute on all functions in schema public from anon, authenticated; +alter default privileges in schema public revoke execute on functions from public; +alter default privileges in schema public revoke execute on functions from anon, authenticated; +grant execute on function public.hello_world to authenticated; +create function logging_example( + log_message text, + warning_message text, + error_message text +) +returns void +language plpgsql +as $$ +begin + raise log 'logging message: %', log_message; + raise warning 'logging warning: %', warning_message; + raise exception 'logging error: %', error_message; +end; +$$; +select logging_example('LOGGED MESSAGE', 'WARNING MESSAGE', 'ERROR MESSAGE'); +WARNING: logging warning: WARNING MESSAGE +ERROR: logging error: ERROR MESSAGE +CONTEXT: PL/pgSQL function logging_example(text,text,text) line 5 at RAISE +create or replace function error_if_null(some_val text) +returns text +language plpgsql +as $$ +begin + if some_val is null then + raise exception 'some_val should not be NULL'; + end if; + return some_val; +end; +$$; +select error_if_null('not null'); + error_if_null +--------------- + not null +(1 row) + +create table attendance_table ( + id uuid primary key, + student text +); +insert into attendance_table (id, student) values ('123e4567-e89b-12d3-a456-426614174000', 'Harry Potter'); +create function assert_example(name text) +returns uuid +language plpgsql +as $$ +declare + student_id uuid; +begin + select + id into student_id + from attendance_table + where student = name; + + assert student_id is not null, 'assert_example() ERROR: student not found'; + + return student_id; +end; +$$; +select assert_example('Harry Potter'); + assert_example +-------------------------------------- + 123e4567-e89b-12d3-a456-426614174000 +(1 row) + +create function error_example() +returns void +language plpgsql +as $$ +begin + select * from table_that_does_not_exist; + + exception + when others then + raise exception 'An error occurred in function : %', sqlerrm; +end; +$$; +select error_example(); +ERROR: An error occurred in function : relation "table_that_does_not_exist" does not exist +CONTEXT: PL/pgSQL function error_example() line 7 at RAISE +create table some_table ( + col_1 int, + col_2 text +); +insert into some_table (col_1, col_2) values (42, 'test value'); +create or replace function advanced_example(num int default 10) +returns text +language plpgsql +as $$ +declare + var1 int := 20; + var2 text; +begin + raise log 'logging start of function call: (%)', (select now()); + + select + col_1 into var1 + from some_table + limit 1; + raise log 'logging a variable (%)', var1; + + raise log 'logging a query with a single return value(%)', (select col_1 from some_table limit 1); + + raise log 'logging an entire row as JSON (%)', (select to_jsonb(some_table.*) from some_table limit 1); + + insert into some_table (col_2) + values ('new val') + returning col_2 into var2; + + raise log 'logging a value from an INSERT (%)', var2; + + return var1 || ',' || var2; +exception + when others then + raise exception 'An error occurred in function : %', sqlerrm; +end; +$$; +select advanced_example(); + advanced_example +------------------ + 42,new val +(1 row) + +drop function advanced_example(int); +drop function error_example(); +drop function assert_example(text); +drop function error_if_null(text); +drop function logging_example(text, text, text); +drop function hello_world_definer(); +drop function add_planet(text); +drop function get_planets(); +drop function hello_world(); +drop table people; +drop table planets; +drop table attendance_table; +drop table some_table; +grant execute on all functions in schema public to public; +grant execute on all functions in schema public to anon, authenticated; +alter default privileges in schema public grant execute on functions to public; +alter default privileges in schema public grant execute on functions to anon, authenticated; + diff --git a/nix/tests/expected/docs-indexes.out b/nix/tests/expected/docs-indexes.out new file mode 100644 index 000000000..fbdaeab79 --- /dev/null +++ b/nix/tests/expected/docs-indexes.out @@ -0,0 +1,22 @@ +-- testing sql found in https://supabase.com/docs/guides/database/indexes +create table persons ( + id bigint generated by default as identity primary key, + age int, + height int, + weight int, + name text, + deceased boolean +); +insert into persons (age, height, weight, name, deceased) values (32, 180, 70, 'John Doe', false); +select name from persons where age = 32; + name +---------- + John Doe +(1 row) + +create index idx_persons_age on persons (age); +create index idx_living_persons_age on persons (age) where deceased is false; +create index idx_persons_age_desc on persons (age desc nulls last); +reindex index concurrently idx_persons_age; +reindex table concurrently persons; +drop table persons cascade; diff --git a/nix/tests/expected/docs-json.out b/nix/tests/expected/docs-json.out new file mode 100644 index 000000000..c77a86b74 --- /dev/null +++ b/nix/tests/expected/docs-json.out @@ -0,0 +1,52 @@ +-- testing sql found in https://supabase.com/docs/guides/database/json +create table books ( + id serial primary key, + title text, + author text, + metadata jsonb +); +insert into books + (title, author, metadata) +values + ( + 'The Poky Little Puppy', + 'Janette Sebring Lowrey', + '{"description":"Puppy is slower than other, bigger animals.","price":5.95,"ages":[3,6]}' + ), + ( + 'The Tale of Peter Rabbit', + 'Beatrix Potter', + '{"description":"Rabbit eats some vegetables.","price":4.49,"ages":[2,5]}' + ), + ( + 'Tootle', + 'Gertrude Crampton', + '{"description":"Little toy train has big dreams.","price":3.99,"ages":[2,5]}' + ), + ( + 'Green Eggs and Ham', + 'Dr. Seuss', + '{"description":"Sam has changing food preferences and eats unusually colored food.","price":7.49,"ages":[4,8]}' + ), + ( + 'Harry Potter and the Goblet of Fire', + 'J.K. Rowling', + '{"description":"Fourth year of school starts, big drama ensues.","price":24.95,"ages":[10,99]}' + ); +select + title, + metadata ->> 'description' as description, -- returned as text + metadata -> 'price' as price, + metadata -> 'ages' -> 0 as low_age, + metadata -> 'ages' -> 1 as high_age +from books; + title | description | price | low_age | high_age +-------------------------------------+--------------------------------------------------------------------+-------+---------+---------- + The Poky Little Puppy | Puppy is slower than other, bigger animals. | 5.95 | 3 | 6 + The Tale of Peter Rabbit | Rabbit eats some vegetables. | 4.49 | 2 | 5 + Tootle | Little toy train has big dreams. | 3.99 | 2 | 5 + Green Eggs and Ham | Sam has changing food preferences and eats unusually colored food. | 7.49 | 4 | 8 + Harry Potter and the Goblet of Fire | Fourth year of school starts, big drama ensues. | 24.95 | 10 | 99 +(5 rows) + +drop table books cascade; diff --git a/nix/tests/expected/docs-partitioning.out b/nix/tests/expected/docs-partitioning.out new file mode 100644 index 000000000..9ab265c17 --- /dev/null +++ b/nix/tests/expected/docs-partitioning.out @@ -0,0 +1,110 @@ +-- testing sql found in https://supabase.com/docs/guides/database/partitioning +create table sales ( + id bigint generated by default as identity, + order_date date not null, + customer_id bigint, + amount bigint, + primary key (order_date, id) +) +partition by range (order_date); +create table sales_2000_01 + partition of sales + for values from ('2000-01-01') to ('2000-02-01'); +create table sales_2000_02 + partition of sales + for values from ('2000-02-01') to ('2000-03-01'); +insert into sales (order_date, customer_id, amount) values + ('2000-01-15', 1, 100), + ('2000-01-20', 2, 200), + ('2000-02-10', 3, 150), + ('2000-02-25', 4, 300); +select * from sales where order_date >= '2000-01-01' and order_date < '2000-03-01'; + id | order_date | customer_id | amount +----+------------+-------------+-------- + 1 | 01-15-2000 | 1 | 100 + 2 | 01-20-2000 | 2 | 200 + 3 | 02-10-2000 | 3 | 150 + 4 | 02-25-2000 | 4 | 300 +(4 rows) + +select * from sales_2000_02; + id | order_date | customer_id | amount +----+------------+-------------+-------- + 3 | 02-10-2000 | 3 | 150 + 4 | 02-25-2000 | 4 | 300 +(2 rows) + +drop table sales cascade; +create table customers ( + id bigint generated by default as identity, + name text, + country text, + primary key (country, id) +) +partition by list(country); +create table customers_americas + partition of customers + for values in ('US', 'CANADA'); +create table customers_asia + partition of customers + for values in ('INDIA', 'CHINA', 'JAPAN'); +insert into customers (name, country) values + ('John Doe', 'US'), + ('Jane Smith', 'CANADA'), + ('Li Wei', 'CHINA'), + ('Priya Patel', 'INDIA'), + ('Yuki Tanaka', 'JAPAN'); +select * from customers where country in ('US', 'CANADA'); + id | name | country +----+------------+--------- + 1 | John Doe | US + 2 | Jane Smith | CANADA +(2 rows) + +select * from customers_asia; + id | name | country +----+-------------+--------- + 3 | Li Wei | CHINA + 4 | Priya Patel | INDIA + 5 | Yuki Tanaka | JAPAN +(3 rows) + +drop table customers cascade; +create table products ( + id bigint generated by default as identity, + name text, + category text, + price bigint +) +partition by hash (id); +create table products_one + partition of products + for values with (modulus 2, remainder 1); +create table products_two + partition of products + for values with (modulus 2, remainder 0); +insert into products (name, category, price) values + ('Laptop', 'Electronics', 999), + ('Phone', 'Electronics', 599), + ('Book', 'Education', 29), + ('Chair', 'Furniture', 199); +select * from products where category = 'Electronics'; + id | name | category | price +----+--------+-------------+------- + 1 | Laptop | Electronics | 999 + 2 | Phone | Electronics | 599 +(2 rows) + +select count(*) from products_one; + count +------- + 2 +(1 row) + +select count(*) from products_two; + count +------- + 2 +(1 row) + +drop table products cascade; diff --git a/nix/tests/expected/docs-tables-and-data.out b/nix/tests/expected/docs-tables-and-data.out new file mode 100644 index 000000000..5412b55f8 --- /dev/null +++ b/nix/tests/expected/docs-tables-and-data.out @@ -0,0 +1,286 @@ +-- Test file for "Tables and Data" documentation +-- This file contains all SQL statements from https://supabase.com/docs/guides/database/tables-and-data +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); +select table_name, column_name, data_type, is_nullable, column_default +from information_schema.columns +where table_name = 'movies' +order by ordinal_position; + table_name | column_name | data_type | is_nullable | column_default +------------+-------------+-----------+-------------+---------------- + movies | id | bigint | NO | + movies | name | text | YES | + movies | description | text | YES | +(3 rows) + +drop table if exists movies; +create table movies ( + id bigint generated always as identity primary key +); +select column_name, data_type, is_nullable, column_default, is_identity, identity_generation +from information_schema.columns +where table_name = 'movies' and column_name = 'id'; + column_name | data_type | is_nullable | column_default | is_identity | identity_generation +-------------+-----------+-------------+----------------+-------------+--------------------- + id | bigint | NO | | YES | ALWAYS +(1 row) + +drop table if exists movies; +create table movies ( + id bigint generated by default as identity primary key +); +select column_name, data_type, is_nullable, column_default, is_identity, identity_generation +from information_schema.columns +where table_name = 'movies' and column_name = 'id'; + column_name | data_type | is_nullable | column_default | is_identity | identity_generation +-------------+-----------+-------------+----------------+-------------+--------------------- + id | bigint | NO | | YES | BY DEFAULT +(1 row) + +drop table if exists movies; +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); +insert into movies + (name, description) +values + ( + 'The Empire Strikes Back', + 'After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda.' + ), + ( + 'Return of the Jedi', + 'After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star.' + ); +select id, name, description from movies order by id; + id | name | description +----+-------------------------+-------------------------------------------------------------------------------------------------------------------------------- + 1 | The Empire Strikes Back | After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda. + 2 | Return of the Jedi | After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star. +(2 rows) + +drop table if exists movies; +drop table if exists categories; +NOTICE: table "categories" does not exist, skipping +create table categories ( + id bigint generated always as identity primary key, + name text +); +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); +alter table movies + add column category_id bigint references categories; +select + tc.table_name, + kcu.column_name, + ccu.table_name as foreign_table_name, + ccu.column_name as foreign_column_name +from information_schema.table_constraints as tc +join information_schema.key_column_usage as kcu + on tc.constraint_name = kcu.constraint_name + and tc.table_schema = kcu.table_schema +join information_schema.constraint_column_usage as ccu + on ccu.constraint_name = tc.constraint_name + and ccu.table_schema = tc.table_schema +where tc.constraint_type = 'FOREIGN KEY' and tc.table_name='movies'; + table_name | column_name | foreign_table_name | foreign_column_name +------------+-------------+--------------------+--------------------- + movies | category_id | categories | id +(1 row) + +drop table if exists performances; +NOTICE: table "performances" does not exist, skipping +drop table if exists actors; +NOTICE: table "actors" does not exist, skipping +drop table if exists movies; +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); +create table actors ( + id bigint generated by default as identity primary key, + name text +); +create table performances ( + id bigint generated by default as identity primary key, + movie_id bigint not null references movies, + actor_id bigint not null references actors +); +select table_name from information_schema.tables +where table_name in ('movies', 'actors', 'performances') +order by table_name; + table_name +-------------- + actors + movies + performances +(3 rows) + +create schema private; +select schema_name from information_schema.schemata where schema_name = 'private'; + schema_name +------------- + private +(1 row) + +drop table if exists private.salaries; +NOTICE: table "salaries" does not exist, skipping +drop table if exists actors cascade; +NOTICE: drop cascades to constraint performances_actor_id_fkey on table performances +create table actors ( + id bigint generated by default as identity primary key, + name text +); +create table private.salaries ( + id bigint generated by default as identity primary key, + salary bigint not null, + actor_id bigint not null references public.actors +); +select table_schema, table_name from information_schema.tables +where table_schema = 'private' and table_name = 'salaries'; + table_schema | table_name +--------------+------------ + private | salaries +(1 row) + +drop table if exists grades; +NOTICE: table "grades" does not exist, skipping +drop table if exists courses; +NOTICE: table "courses" does not exist, skipping +drop table if exists students; +NOTICE: table "students" does not exist, skipping +drop view if exists transcripts; +NOTICE: view "transcripts" does not exist, skipping +create table students ( + id bigint generated by default as identity primary key, + name text, + type text +); +create table courses ( + id bigint generated by default as identity primary key, + title text, + code text +); +create table grades ( + id bigint generated by default as identity primary key, + student_id bigint not null references students, + course_id bigint not null references courses, + result text +); +-- Insert test data +insert into students (name, type) values + ('Princess Leia', 'undergraduate'), + ('Yoda', 'graduate'), + ('Anakin Skywalker', 'graduate'); +insert into courses (title, code) values + ('Introduction to Postgres', 'PG101'), + ('Authentication Theories', 'AUTH205'), + ('Fundamentals of Supabase', 'SUP412'); +insert into grades (student_id, course_id, result) values + (1, 1, 'B+'), + (1, 3, 'A+'), + (2, 2, 'A'), + (3, 1, 'A-'), + (3, 2, 'A'), + (3, 3, 'B-'); +-- Create view +create view transcripts as + select + students.name, + students.type, + courses.title, + courses.code, + grades.result + from grades + left join students on grades.student_id = students.id + left join courses on grades.course_id = courses.id; +grant all on table transcripts to authenticated; +select name, type, title, code, result from transcripts order by name, code; + name | type | title | code | result +------------------+---------------+--------------------------+---------+-------- + Anakin Skywalker | graduate | Authentication Theories | AUTH205 | A + Anakin Skywalker | graduate | Introduction to Postgres | PG101 | A- + Anakin Skywalker | graduate | Fundamentals of Supabase | SUP412 | B- + Princess Leia | undergraduate | Introduction to Postgres | PG101 | B+ + Princess Leia | undergraduate | Fundamentals of Supabase | SUP412 | A+ + Yoda | graduate | Authentication Theories | AUTH205 | A +(6 rows) + +drop materialized view if exists transcripts_materialized; +NOTICE: materialized view "transcripts_materialized" does not exist, skipping +create materialized view transcripts_materialized as + select + students.name, + students.type, + courses.title, + courses.code, + grades.result + from + grades + left join students on grades.student_id = students.id + left join courses on grades.course_id = courses.id; +select name, type, title, code, result from transcripts_materialized order by name, code; + name | type | title | code | result +------------------+---------------+--------------------------+---------+-------- + Anakin Skywalker | graduate | Authentication Theories | AUTH205 | A + Anakin Skywalker | graduate | Introduction to Postgres | PG101 | A- + Anakin Skywalker | graduate | Fundamentals of Supabase | SUP412 | B- + Princess Leia | undergraduate | Introduction to Postgres | PG101 | B+ + Princess Leia | undergraduate | Fundamentals of Supabase | SUP412 | A+ + Yoda | graduate | Authentication Theories | AUTH205 | A +(6 rows) + +refresh materialized view transcripts_materialized; +select count(*) from transcripts_materialized; + count +------- + 6 +(1 row) + +drop view if exists secure_transcripts; +NOTICE: view "secure_transcripts" does not exist, skipping +create view secure_transcripts with(security_invoker=true) as ( + select name, type, title, code, result from transcripts +); +select schemaname, viewname +from pg_views +where viewname = 'secure_transcripts'; + schemaname | viewname +------------+-------------------- + public | secure_transcripts +(1 row) + +drop view if exists test_view; +NOTICE: view "test_view" does not exist, skipping +create view test_view as select 1 as test_col; +alter view test_view set (security_invoker = true); +select schemaname, viewname +from pg_views +where viewname = 'test_view'; + schemaname | viewname +------------+----------- + public | test_view +(1 row) + +drop materialized view if exists transcripts_materialized; +drop view if exists secure_transcripts; +drop view if exists transcripts; +drop view if exists test_view; +drop table if exists grades; +drop table if exists courses; +drop table if exists students; +drop table if exists private.salaries; +drop table if exists actors; +drop table if exists performances; +drop table if exists movies; +drop table if exists categories; +drop schema if exists private; diff --git a/nix/tests/expected/docs-triggers.out b/nix/tests/expected/docs-triggers.out new file mode 100644 index 000000000..a3a850925 --- /dev/null +++ b/nix/tests/expected/docs-triggers.out @@ -0,0 +1,217 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgres/triggers +create table employees ( + id serial primary key, + name text, + salary numeric +); +create table salary_log ( + id serial primary key, + employee_id integer, + old_salary numeric, + new_salary numeric, + created_at timestamp default now() +); +create function update_salary_log() +returns trigger +language plpgsql +as $$ +begin + insert into salary_log(employee_id, old_salary, new_salary) + values (new.id, old.salary, new.salary); + return new; +end; +$$; +create trigger salary_update_trigger +after update on employees +for each row +execute function update_salary_log(); +insert into employees (name, salary) values ('John Doe', 50000); +insert into employees (name, salary) values ('Jane Smith', 60000); +update employees set salary = 55000 where name = 'John Doe'; +select id, employee_id, old_salary, new_salary from salary_log; + id | employee_id | old_salary | new_salary +----+-------------+------------+------------ + 1 | 1 | 50000 | 55000 +(1 row) + +create table orders ( + id serial primary key, + customer_id integer, + amount numeric, + status text +); +create table customers ( + id serial primary key, + name text, + email text +); +create function before_insert_function() +returns trigger +language plpgsql +as $$ +begin + if new.amount <= 0 then + raise exception 'Order amount must be greater than 0'; + end if; + return new; +end; +$$; +create trigger before_insert_trigger +before insert on orders +for each row +execute function before_insert_function(); +create table customer_audit ( + id serial primary key, + customer_id integer, + action text, + customer_name text, + deleted_at timestamp default now() +); +create function after_delete_function() +returns trigger +language plpgsql +as $$ +begin + insert into customer_audit(customer_id, action, customer_name) + values (old.id, 'DELETE', old.name); + return old; +end; +$$; +create trigger after_delete_trigger +after delete on customers +for each row +execute function after_delete_function(); +insert into customers (name, email) values ('Alice Johnson', 'alice@example.com'); +insert into customers (name, email) values ('Bob Wilson', 'bob@example.com'); +insert into orders (customer_id, amount, status) values (1, 100.50, 'pending'); +insert into orders (customer_id, amount, status) values (2, 250.75, 'pending'); +delete from customers where name = 'Alice Johnson'; +select id, customer_id, action, customer_name from customer_audit; + id | customer_id | action | customer_name +----+-------------+--------+--------------- + 1 | 1 | DELETE | Alice Johnson +(1 row) + +create table trigger_events ( + id serial primary key, + trigger_name text, + operation text, + table_name text, + event_time timestamp default now() +); +create function statement_level_function() +returns trigger +language plpgsql +as $$ +begin + insert into trigger_events(trigger_name, operation, table_name) + values (tg_name, tg_op, tg_table_name); + return null; +end; +$$; +create trigger statement_level_trigger +after insert on orders +for each statement +execute function statement_level_function(); +insert into orders (customer_id, amount, status) values (2, 150.25, 'pending'); +select id, trigger_name, operation, table_name from trigger_events; + id | trigger_name | operation | table_name +----+-------------------------+-----------+------------ + 1 | statement_level_trigger | INSERT | orders +(1 row) + +create table trigger_variables_log ( + id serial primary key, + trigger_name text, + trigger_when text, + operation text, + table_name text, + table_schema text, + row_id integer, + event_time timestamp default now() +); +create function trigger_variables_example() +returns trigger +language plpgsql +as $$ +begin + if tg_op = 'INSERT' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, new.id); + elsif tg_op = 'UPDATE' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, new.id); + elsif tg_op = 'DELETE' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, old.id); + end if; + + return coalesce(new, old); +end; +$$; +create trigger variables_trigger +after insert or update or delete on employees +for each row +execute function trigger_variables_example(); +insert into employees (name, salary) values ('Charlie Brown', 45000); +update employees set salary = 47000 where name = 'Charlie Brown'; +delete from employees where name = 'Charlie Brown'; +select id, trigger_name, trigger_when, operation, table_name, table_schema, row_id from trigger_variables_log; + id | trigger_name | trigger_when | operation | table_name | table_schema | row_id +----+-------------------+--------------+-----------+------------+--------------+-------- + 1 | variables_trigger | AFTER | INSERT | employees | public | 3 + 2 | variables_trigger | AFTER | UPDATE | employees | public | 3 + 3 | variables_trigger | AFTER | DELETE | employees | public | 3 +(3 rows) + +create table high_salary_alerts ( + id serial primary key, + employee_name text, + salary numeric, + alert_time timestamp default now() +); +create function conditional_trigger_function() +returns trigger +language plpgsql +as $$ +begin + if new.salary > 100000 then + insert into high_salary_alerts(employee_name, salary) + values (new.name, new.salary); + end if; + return new; +end; +$$; +create trigger conditional_trigger +after insert or update on employees +for each row +when (new.salary > 100000) +execute function conditional_trigger_function(); +insert into employees (name, salary) values ('Executive', 150000); +insert into employees (name, salary) values ('Intern', 30000); +select id, employee_name, salary from high_salary_alerts; + id | employee_name | salary +----+---------------+-------- + 1 | Executive | 150000 +(1 row) + +drop trigger conditional_trigger on employees; +drop trigger variables_trigger on employees; +drop trigger statement_level_trigger on orders; +drop trigger after_delete_trigger on customers; +drop trigger before_insert_trigger on orders; +drop trigger salary_update_trigger on employees; +drop function conditional_trigger_function(); +drop function trigger_variables_example(); +drop function statement_level_function(); +drop function after_delete_function(); +drop function before_insert_function(); +drop function update_salary_log(); +drop table high_salary_alerts; +drop table trigger_variables_log; +drop table trigger_events; +drop table customer_audit; +drop table salary_log; +drop table employees; +drop table orders; +drop table customers; diff --git a/nix/tests/expected/docs-webhooks.out b/nix/tests/expected/docs-webhooks.out new file mode 100644 index 000000000..20e4b2fb1 --- /dev/null +++ b/nix/tests/expected/docs-webhooks.out @@ -0,0 +1,266 @@ +-- testing sql found in https://supabase.com/docs/guides/database/webhooks +create table profiles ( + id serial primary key, + name text, + email text, + created_at timestamp default now() +); +create table webhook_logs ( + id serial primary key, + webhook_name text, + event_type text, + table_name text, + schema_name text, + record_data jsonb, + old_record_data jsonb, + created_at timestamp default now() +); +create function webhook_handler() +returns trigger +language plpgsql +as $$ +declare + payload jsonb; +begin + if tg_op = 'INSERT' then + payload := jsonb_build_object( + 'type', 'INSERT', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', null + ); + elsif tg_op = 'UPDATE' then + payload := jsonb_build_object( + 'type', 'UPDATE', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ); + elsif tg_op = 'DELETE' then + payload := jsonb_build_object( + 'type', 'DELETE', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', null, + 'old_record', to_jsonb(old) + ); + end if; + + insert into webhook_logs(webhook_name, event_type, table_name, schema_name, record_data, old_record_data) + values (tg_name, tg_op, tg_table_name, tg_table_schema, payload->'record', payload->'old_record'); + + return coalesce(new, old); +end; +$$; +create trigger insert_webhook +after insert on profiles +for each row +execute function webhook_handler(); +create trigger update_webhook +after update on profiles +for each row +execute function webhook_handler(); +create trigger delete_webhook +after delete on profiles +for each row +execute function webhook_handler(); +insert into profiles (name, email) values ('John Doe', 'john@example.com'); +insert into profiles (name, email) values ('Jane Smith', 'jane@example.com'); +select id, webhook_name, event_type, table_name, schema_name, record_data - 'created_at' from webhook_logs where event_type = 'INSERT'; + id | webhook_name | event_type | table_name | schema_name | ?column? +----+----------------+------------+------------+-------------+-------------------------------------------------------------- + 1 | insert_webhook | INSERT | profiles | public | {"id": 1, "name": "John Doe", "email": "john@example.com"} + 2 | insert_webhook | INSERT | profiles | public | {"id": 2, "name": "Jane Smith", "email": "jane@example.com"} +(2 rows) + +update profiles set email = 'john.doe@example.com' where name = 'John Doe'; +select id, webhook_name, event_type, table_name, schema_name, record_data - 'created_at', old_record_data - 'created_at' from webhook_logs where event_type = 'UPDATE'; + id | webhook_name | event_type | table_name | schema_name | ?column? | ?column? +----+----------------+------------+------------+-------------+----------------------------------------------------------------+------------------------------------------------------------ + 3 | update_webhook | UPDATE | profiles | public | {"id": 1, "name": "John Doe", "email": "john.doe@example.com"} | {"id": 1, "name": "John Doe", "email": "john@example.com"} +(1 row) + +delete from profiles where name = 'Jane Smith'; +select id, webhook_name, event_type, table_name, schema_name, old_record_data - 'created_at' from webhook_logs where event_type = 'DELETE'; + id | webhook_name | event_type | table_name | schema_name | ?column? +----+----------------+------------+------------+-------------+-------------------------------------------------------------- + 4 | delete_webhook | DELETE | profiles | public | {"id": 2, "name": "Jane Smith", "email": "jane@example.com"} +(1 row) + +create table orders ( + id serial primary key, + customer_id integer, + amount numeric, + status text +); +create table webhook_requests ( + id serial primary key, + webhook_name text, + url text, + method text, + headers jsonb, + payload jsonb, + response_status integer, + response_data jsonb, + created_at timestamp default now() +); +create function mock_http_response(url text) +returns table(status integer, body jsonb) +language plpgsql +as $$ +begin + if url like '%dummyjson.com/products/1%' then + return query select 200, '{"id": 1, "title": "Essence Mascara Lash Princess", "price": 9.99, "category": "beauty"}'::jsonb; + elsif url like '%dummyjson.com/products/2%' then + return query select 200, '{"id": 2, "title": "Eyeshadow Palette with Mirror", "price": 19.99, "category": "beauty"}'::jsonb; + else + return query select 404, '{"error": "Product not found"}'::jsonb; + end if; +end; +$$; +create function http_webhook_handler() +returns trigger +language plpgsql +as $$ +declare + response_code integer; + response_body jsonb; +begin + select status, body into response_code, response_body + from mock_http_response('https://dummyjson.com/products/1'); + + insert into webhook_requests(webhook_name, url, method, headers, payload, response_status, response_data) + values ( + 'orders_webhook', + 'https://dummyjson.com/products/1', + 'GET', + '{"Content-Type": "application/json"}'::jsonb, + jsonb_build_object( + 'type', tg_op, + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ), + response_code, + response_body + ); + + return coalesce(new, old); +end; +$$; +create trigger http_webhook +after insert or update or delete on orders +for each row +execute function http_webhook_handler(); +insert into orders (customer_id, amount, status) values (1, 100.50, 'pending'); +insert into orders (customer_id, amount, status) values (2, 250.75, 'completed'); +select id, webhook_name, url, method, response_status, response_data from webhook_requests; + id | webhook_name | url | method | response_status | response_data +----+----------------+----------------------------------+--------+-----------------+------------------------------------------------------------------------------------------ + 1 | orders_webhook | https://dummyjson.com/products/1 | GET | 200 | {"id": 1, "price": 9.99, "title": "Essence Mascara Lash Princess", "category": "beauty"} + 2 | orders_webhook | https://dummyjson.com/products/1 | GET | 200 | {"id": 1, "price": 9.99, "title": "Essence Mascara Lash Princess", "category": "beauty"} +(2 rows) + +create table webhook_config ( + id serial primary key, + webhook_name text, + url text, + method text default 'GET', + headers jsonb default '{"Content-Type": "application/json"}'::jsonb, + timeout_ms integer default 1000 +); +insert into webhook_config (webhook_name, url, method, headers, timeout_ms) +values ('product_webhook', 'https://dummyjson.com/products/2', 'GET', '{"Content-Type": "application/json"}'::jsonb, 5000); +create function configurable_webhook_handler() +returns trigger +language plpgsql +as $$ +declare + config webhook_config%rowtype; + payload jsonb; + response_code integer; + response_body jsonb; +begin + select * into config from webhook_config where webhook_name = 'product_webhook' limit 1; + + if config.id is null then + raise exception 'Webhook configuration not found'; + end if; + + payload := jsonb_build_object( + 'type', tg_op, + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ); + + select status, body into response_code, response_body + from mock_http_response(config.url); + + insert into webhook_requests(webhook_name, url, method, headers, payload, response_status, response_data) + values (config.webhook_name, config.url, config.method, config.headers, payload, response_code, response_body); + + if response_code != 200 then + raise exception 'Configurable webhook failed with status: %', response_code; + end if; + + return coalesce(new, old); +end; +$$; +create trigger product_webhook +after insert on profiles +for each row +execute function configurable_webhook_handler(); +insert into profiles (name, email) values ('Alice Johnson', 'alice@example.com'); +select id, webhook_name, url, method, response_status, response_data from webhook_requests where webhook_name = 'product_webhook'; + id | webhook_name | url | method | response_status | response_data +----+-----------------+----------------------------------+--------+-----------------+------------------------------------------------------------------------------------------- + 3 | product_webhook | https://dummyjson.com/products/2 | GET | 200 | {"id": 2, "price": 19.99, "title": "Eyeshadow Palette with Mirror", "category": "beauty"} +(1 row) + +create function get_webhook_logs() +returns table ( + webhook_name text, + event_type text, + table_name text, + record_count bigint +) +language sql +as $$ + select + webhook_name, + event_type, + table_name, + count(*) as record_count + from webhook_logs + group by webhook_name, event_type, table_name + order by webhook_name, event_type; +$$; +select * from get_webhook_logs(); + webhook_name | event_type | table_name | record_count +----------------+------------+------------+-------------- + delete_webhook | DELETE | profiles | 1 + insert_webhook | INSERT | profiles | 3 + update_webhook | UPDATE | profiles | 1 +(3 rows) + +drop trigger product_webhook on profiles; +drop trigger http_webhook on orders; +drop trigger delete_webhook on profiles; +drop trigger update_webhook on profiles; +drop trigger insert_webhook on profiles; +drop function configurable_webhook_handler(); +drop function http_webhook_handler(); +drop function mock_http_response(text); +drop function get_webhook_logs(); +drop function webhook_handler(); +drop table webhook_config; +drop table webhook_requests; +drop table webhook_logs; +drop table orders; +drop table profiles; + diff --git a/nix/tests/sql/docs-array-test.sql b/nix/tests/sql/docs-array-test.sql new file mode 100644 index 000000000..ee81d2ce0 --- /dev/null +++ b/nix/tests/sql/docs-array-test.sql @@ -0,0 +1,14 @@ +-- testing sql found in https://supabase.com/docs/guides/database/arrays + +create table arraytest ( + id integer not null, + textarray text array +); + +INSERT INTO arraytest (id, textarray) VALUES (1, ARRAY['Harry', 'Larry', 'Moe']);; + +select * from arraytest; + +SELECT textarray[1], array_length(textarray, 1) FROM arraytest; + +drop table arraytest cascade; diff --git a/nix/tests/sql/docs-cascades-deletes.sql b/nix/tests/sql/docs-cascades-deletes.sql new file mode 100644 index 000000000..5a3f75c73 --- /dev/null +++ b/nix/tests/sql/docs-cascades-deletes.sql @@ -0,0 +1,262 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgres/cascades-deletes +-- all of the errors produced by this file are expected + +create table grandparent ( + id serial primary key, + name text +); + +create table parent ( + id serial primary key, + name text, + parent_id integer references grandparent (id) + on delete cascade +); + +create table child ( + id serial primary key, + name text, + father integer references parent (id) + on delete restrict +); + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); + +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); + +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); + +insert into child + (id, name, father) +values + (1, 'William', 1); + +select count(*) from grandparent; +select count(*) from parent; +select count(*) from child; + +delete from grandparent; + +select count(*) from grandparent; +select count(*) from parent; +select count(*) from child; + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); + +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); + +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); + +insert into child + (id, name, father) +values + (1, 'William', 1); + +alter table child +drop constraint child_father_fkey; + +alter table child +add constraint child_father_fkey foreign key (father) references parent (id) + on delete no action; + +delete from grandparent; + +select count(*) from grandparent; +select count(*) from parent; +select count(*) from child; + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); + +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); + +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); + +insert into child + (id, name, father) +values + (1, 'William', 1); + +alter table child +drop constraint child_father_fkey; + +alter table child +add constraint child_father_fkey foreign key (father) references parent (id) + on delete no action initially deferred; + +delete from grandparent; + +select count(*) from grandparent; +select count(*) from parent; +select count(*) from child; + +insert into grandparent + (id, name) +values + (1, 'Elizabeth'); + +insert into parent + (id, name, parent_id) +values + (1, 'Charles', 1); + +insert into parent + (id, name, parent_id) +values + (2, 'Diana', 1); + +insert into child + (id, name, father) +values + (1, 'William', 1); + +alter table child +add column mother integer references parent (id) + on delete cascade; + +update child +set mother = 2 +where id = 1; + +delete from grandparent; + +select count(*) from grandparent; +select count(*) from parent; +select count(*) from child; + +create table test_cascade ( + id serial primary key, + name text +); + +create table test_cascade_child ( + id serial primary key, + parent_id integer references test_cascade (id) on delete cascade, + name text +); + +insert into test_cascade (name) values ('Parent'); +insert into test_cascade_child (parent_id, name) values (1, 'Child'); + +delete from test_cascade; + +select count(*) from test_cascade; +select count(*) from test_cascade_child; + +create table test_restrict ( + id serial primary key, + name text +); + +create table test_restrict_child ( + id serial primary key, + parent_id integer references test_restrict (id) on delete restrict, + name text +); + +insert into test_restrict (name) values ('Parent'); +insert into test_restrict_child (parent_id, name) values (1, 'Child'); + +delete from test_restrict; + +select count(*) from test_restrict; +select count(*) from test_restrict_child; + +create table test_set_null ( + id serial primary key, + name text +); + +create table test_set_null_child ( + id serial primary key, + parent_id integer references test_set_null (id) on delete set null, + name text +); + +insert into test_set_null (name) values ('Parent'); +insert into test_set_null_child (parent_id, name) values (1, 'Child'); + +delete from test_set_null; + +select count(*) from test_set_null; +select count(*) from test_set_null_child; +select parent_id from test_set_null_child; + +create table test_set_default ( + id serial primary key, + name text +); + +create table test_set_default_child ( + id serial primary key, + parent_id integer default 999 references test_set_default (id) on delete set default, + name text +); + +insert into test_set_default (name) values ('Parent'); +insert into test_set_default_child (parent_id, name) values (1, 'Child'); + +delete from test_set_default; + +select count(*) from test_set_default; +select count(*) from test_set_default_child; +select parent_id from test_set_default_child; + +create table test_no_action ( + id serial primary key, + name text +); + +create table test_no_action_child ( + id serial primary key, + parent_id integer references test_no_action (id) on delete no action, + name text +); + +insert into test_no_action (name) values ('Parent'); +insert into test_no_action_child (parent_id, name) values (1, 'Child'); + +delete from test_no_action; + +select count(*) from test_no_action; +select count(*) from test_no_action_child; + +drop table if exists test_cascade_child; +drop table if exists test_cascade; +drop table if exists test_restrict_child; +drop table if exists test_restrict; +drop table if exists test_set_null_child; +drop table if exists test_set_null; +drop table if exists test_set_default_child; +drop table if exists test_set_default; +drop table if exists test_no_action_child; +drop table if exists test_no_action; +drop table if exists child; +drop table if exists parent; +drop table if exists grandparent; diff --git a/nix/tests/sql/docs-connections.sql b/nix/tests/sql/docs-connections.sql new file mode 100644 index 000000000..500d53ea6 --- /dev/null +++ b/nix/tests/sql/docs-connections.sql @@ -0,0 +1,12 @@ +-- testing sql found in https://supabase.com/docs/guides/database/connection-management +-- we can't test every sql statement in this doc because their results won't be deterministic +select + ssl, + datname as database, + usename as connected_role, + application_name, + query, + state +from pg_stat_ssl +join pg_stat_activity +on pg_stat_ssl.pid = pg_stat_activity.pid; diff --git a/nix/tests/sql/docs-enums.sql b/nix/tests/sql/docs-enums.sql new file mode 100644 index 000000000..f9b54283a --- /dev/null +++ b/nix/tests/sql/docs-enums.sql @@ -0,0 +1,154 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgresenums + +create type mood as enum ( + 'happy', + 'sad', + 'excited', + 'calm' +); + +create table person ( + id serial primary key, + name text, + current_mood mood +); + +insert into person + (name, current_mood) +values + ('Alice', 'happy'); + +insert into person + (name, current_mood) +values + ('Bob', 'sad'); + +insert into person + (name, current_mood) +values + ('Charlie', 'excited'); + +select * +from person +where current_mood = 'sad'; + +select * +from person +where current_mood = 'happy'; + +update person +set current_mood = 'excited' +where name = 'Alice'; + +select * +from person +where name = 'Alice'; + +alter type mood add value 'content'; + +insert into person + (name, current_mood) +values + ('David', 'content'); + +select enum_range(null::mood); + +select * +from person +where current_mood = 'content'; + +create type status as enum ( + 'active', + 'inactive', + 'pending' +); + +create table orders ( + id serial primary key, + order_number text, + status status +); + +insert into orders + (order_number, status) +values + ('ORD-001', 'active'), + ('ORD-002', 'pending'), + ('ORD-003', 'inactive'); + +select * +from orders +where status = 'active'; + +update orders +set status = 'inactive' +where order_number = 'ORD-002'; + +select * +from orders +where order_number = 'ORD-002'; + +alter type status add value 'cancelled'; + +insert into orders + (order_number, status) +values + ('ORD-004', 'cancelled'); + +select enum_range(null::status); + +select * +from orders +where status = 'cancelled'; + +create type priority as enum ( + 'low', + 'medium', + 'high', + 'critical' +); + +create table tasks ( + id serial primary key, + title text, + priority priority +); + +insert into tasks + (title, priority) +values + ('Fix bug', 'high'), + ('Update docs', 'low'), + ('Security audit', 'critical'); + +select * +from tasks +where priority = 'critical'; + +update tasks +set priority = 'medium' +where title = 'Update docs'; + +select * +from tasks +where title = 'Update docs'; + +alter type priority add value 'urgent'; + +insert into tasks + (title, priority) +values + ('Server maintenance', 'urgent'); + +select enum_range(null::priority); + +select * +from tasks +where priority = 'urgent'; + +drop table tasks; +drop table orders; +drop table person; +drop type priority; +drop type status; +drop type mood; diff --git a/nix/tests/sql/docs-full-text-search.sql b/nix/tests/sql/docs-full-text-search.sql new file mode 100644 index 000000000..d62521e15 --- /dev/null +++ b/nix/tests/sql/docs-full-text-search.sql @@ -0,0 +1,197 @@ +-- testing sql found in https://supabase.com/docs/guides/database/full-text-search +create table books ( + id serial primary key, + title text, + author text, + description text +); + +insert into books + (title, author, description) +values + ( + 'The Poky Little Puppy', + 'Janette Sebring Lowrey', + 'Puppy is slower than other, bigger animals.' + ), + ('The Tale of Peter Rabbit', 'Beatrix Potter', 'Rabbit eats some vegetables.'), + ('Tootle', 'Gertrude Crampton', 'Little toy train has big dreams.'), + ( + 'Green Eggs and Ham', + 'Dr. Seuss', + 'Sam has changing food preferences and eats unusually colored food.' + ), + ( + 'Harry Potter and the Goblet of Fire', + 'J.K. Rowling', + 'Fourth year of school starts, big drama ensues.' + ); + +select to_tsvector('green eggs and ham'); + +select to_tsvector('english', 'green eggs and ham'); + +select * +from books +where title = 'Harry'; + +select * +from books +where to_tsvector(title) @@ to_tsquery('Harry'); + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('big'); + +select + * +from + books +where + to_tsvector(description || ' ' || title) + @@ to_tsquery('little'); + +create function title_description(books) returns text as $$ + select $1.title || ' ' || $1.description; +$$ language sql immutable; + +select + * +from + books +where + to_tsvector(title_description(books.*)) + @@ to_tsquery('little'); + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('little & big'); + +select + * +from + books +where + to_tsvector(description) + @@ to_tsquery('little | big'); + +select title from books where to_tsvector(title) @@ to_tsquery('Lit:*'); + +create or replace function search_books_by_title_prefix(prefix text) +returns setof books AS $$ +begin + return query + select * from books where to_tsvector('english', title) @@ to_tsquery(prefix || ':*'); +end; +$$ language plpgsql; + +select * from search_books_by_title_prefix('Lit'); + +select * from search_books_by_title_prefix('Little+Puppy'); + +alter table + books +add column + fts tsvector generated always as (to_tsvector('english', description || ' ' || title)) stored; + +create index books_fts on books using gin (fts); + +select id, fts +from books; + +select + * +from + books +where + fts @@ to_tsquery('little & big'); + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('big <-> dreams'); + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('year <2> school'); + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('big & !little'); + +select + * +from + books +where + to_tsvector(title) @@ to_tsquery('harry & potter'); + +select + * +from + books +where + to_tsvector(description) @@ to_tsquery('food & !egg'); + +select + * +from + books +where + to_tsvector(title || ' ' || description) @@ to_tsquery('train & toy'); + +select + * +from + books +where + fts @@ to_tsquery('puppy & slow'); + +select + * +from + books +where + fts @@ to_tsquery('rabbit | peter'); + +select + * +from + books +where + fts @@ to_tsquery('harry <-> potter'); + +select + * +from + books +where + fts @@ to_tsquery('fourth <3> year'); + +select + * +from + books +where + fts @@ to_tsquery('big & !drama'); + +drop function search_books_by_title_prefix(text); +drop function title_description(books); +drop table books; + \ No newline at end of file diff --git a/nix/tests/sql/docs-functions.sql b/nix/tests/sql/docs-functions.sql new file mode 100644 index 000000000..f91f17261 --- /dev/null +++ b/nix/tests/sql/docs-functions.sql @@ -0,0 +1,225 @@ +-- testing sql found in https://supabase.com/docs/guides/database/functions + +create or replace function hello_world() +returns text +language sql +as $$ + select 'hello world'; +$$; + +select hello_world(); + +create table planets ( + id serial primary key, + name text +); + +insert into planets + (id, name) +values + (1, 'Tattoine'), + (2, 'Alderaan'), + (3, 'Kashyyyk'); + +create table people ( + id serial primary key, + name text, + planet_id bigint references planets +); + +insert into people + (id, name, planet_id) +values + (1, 'Anakin Skywalker', 1), + (2, 'Luke Skywalker', 1), + (3, 'Princess Leia', 2), + (4, 'Chewbacca', 3); + +create or replace function get_planets() +returns setof planets +language sql +as $$ + select * from planets; +$$; + +select * +from get_planets() +where id = 1; + +create or replace function add_planet(name text) +returns bigint +language plpgsql +as $$ +declare + new_row bigint; +begin + insert into planets(name) + values (add_planet.name) + returning id into new_row; + + return new_row; +end; +$$; + +select * from add_planet('Jakku'); + +create function hello_world_definer() +returns text +language plpgsql +security definer set search_path = '' +as $$ +begin + select 'hello world'; +end; +$$; + +select hello_world_definer(); + +revoke execute on function public.hello_world from public; +revoke execute on function public.hello_world from anon; + +grant execute on function public.hello_world to authenticated; + +revoke execute on all functions in schema public from public; +revoke execute on all functions in schema public from anon, authenticated; + +alter default privileges in schema public revoke execute on functions from public; +alter default privileges in schema public revoke execute on functions from anon, authenticated; + +grant execute on function public.hello_world to authenticated; + +create function logging_example( + log_message text, + warning_message text, + error_message text +) +returns void +language plpgsql +as $$ +begin + raise log 'logging message: %', log_message; + raise warning 'logging warning: %', warning_message; + raise exception 'logging error: %', error_message; +end; +$$; + +select logging_example('LOGGED MESSAGE', 'WARNING MESSAGE', 'ERROR MESSAGE'); + +create or replace function error_if_null(some_val text) +returns text +language plpgsql +as $$ +begin + if some_val is null then + raise exception 'some_val should not be NULL'; + end if; + return some_val; +end; +$$; + +select error_if_null('not null'); + +create table attendance_table ( + id uuid primary key, + student text +); + +insert into attendance_table (id, student) values ('123e4567-e89b-12d3-a456-426614174000', 'Harry Potter'); + +create function assert_example(name text) +returns uuid +language plpgsql +as $$ +declare + student_id uuid; +begin + select + id into student_id + from attendance_table + where student = name; + + assert student_id is not null, 'assert_example() ERROR: student not found'; + + return student_id; +end; +$$; + +select assert_example('Harry Potter'); + +create function error_example() +returns void +language plpgsql +as $$ +begin + select * from table_that_does_not_exist; + + exception + when others then + raise exception 'An error occurred in function : %', sqlerrm; +end; +$$; + +select error_example(); + +create table some_table ( + col_1 int, + col_2 text +); + +insert into some_table (col_1, col_2) values (42, 'test value'); + +create or replace function advanced_example(num int default 10) +returns text +language plpgsql +as $$ +declare + var1 int := 20; + var2 text; +begin + raise log 'logging start of function call: (%)', (select now()); + + select + col_1 into var1 + from some_table + limit 1; + raise log 'logging a variable (%)', var1; + + raise log 'logging a query with a single return value(%)', (select col_1 from some_table limit 1); + + raise log 'logging an entire row as JSON (%)', (select to_jsonb(some_table.*) from some_table limit 1); + + insert into some_table (col_2) + values ('new val') + returning col_2 into var2; + + raise log 'logging a value from an INSERT (%)', var2; + + return var1 || ',' || var2; +exception + when others then + raise exception 'An error occurred in function : %', sqlerrm; +end; +$$; + +select advanced_example(); + +drop function advanced_example(int); +drop function error_example(); +drop function assert_example(text); +drop function error_if_null(text); +drop function logging_example(text, text, text); +drop function hello_world_definer(); +drop function add_planet(text); +drop function get_planets(); +drop function hello_world(); +drop table people; +drop table planets; +drop table attendance_table; +drop table some_table; + +grant execute on all functions in schema public to public; +grant execute on all functions in schema public to anon, authenticated; + +alter default privileges in schema public grant execute on functions to public; +alter default privileges in schema public grant execute on functions to anon, authenticated; + \ No newline at end of file diff --git a/nix/tests/sql/docs-indexes.sql b/nix/tests/sql/docs-indexes.sql new file mode 100644 index 000000000..9d874adb0 --- /dev/null +++ b/nix/tests/sql/docs-indexes.sql @@ -0,0 +1,26 @@ +-- testing sql found in https://supabase.com/docs/guides/database/indexes + +create table persons ( + id bigint generated by default as identity primary key, + age int, + height int, + weight int, + name text, + deceased boolean +); + +insert into persons (age, height, weight, name, deceased) values (32, 180, 70, 'John Doe', false); + +select name from persons where age = 32; + +create index idx_persons_age on persons (age); + +create index idx_living_persons_age on persons (age) where deceased is false; + +create index idx_persons_age_desc on persons (age desc nulls last); + +reindex index concurrently idx_persons_age; + +reindex table concurrently persons; + +drop table persons cascade; diff --git a/nix/tests/sql/docs-json.sql b/nix/tests/sql/docs-json.sql new file mode 100644 index 000000000..49b62338c --- /dev/null +++ b/nix/tests/sql/docs-json.sql @@ -0,0 +1,47 @@ +-- testing sql found in https://supabase.com/docs/guides/database/json + +create table books ( + id serial primary key, + title text, + author text, + metadata jsonb +); + +insert into books + (title, author, metadata) +values + ( + 'The Poky Little Puppy', + 'Janette Sebring Lowrey', + '{"description":"Puppy is slower than other, bigger animals.","price":5.95,"ages":[3,6]}' + ), + ( + 'The Tale of Peter Rabbit', + 'Beatrix Potter', + '{"description":"Rabbit eats some vegetables.","price":4.49,"ages":[2,5]}' + ), + ( + 'Tootle', + 'Gertrude Crampton', + '{"description":"Little toy train has big dreams.","price":3.99,"ages":[2,5]}' + ), + ( + 'Green Eggs and Ham', + 'Dr. Seuss', + '{"description":"Sam has changing food preferences and eats unusually colored food.","price":7.49,"ages":[4,8]}' + ), + ( + 'Harry Potter and the Goblet of Fire', + 'J.K. Rowling', + '{"description":"Fourth year of school starts, big drama ensues.","price":24.95,"ages":[10,99]}' + ); + +select + title, + metadata ->> 'description' as description, -- returned as text + metadata -> 'price' as price, + metadata -> 'ages' -> 0 as low_age, + metadata -> 'ages' -> 1 as high_age +from books; + +drop table books cascade; diff --git a/nix/tests/sql/docs-partitioning.sql b/nix/tests/sql/docs-partitioning.sql new file mode 100644 index 000000000..6037d526a --- /dev/null +++ b/nix/tests/sql/docs-partitioning.sql @@ -0,0 +1,89 @@ +-- testing sql found in https://supabase.com/docs/guides/database/partitioning + +create table sales ( + id bigint generated by default as identity, + order_date date not null, + customer_id bigint, + amount bigint, + primary key (order_date, id) +) +partition by range (order_date); + +create table sales_2000_01 + partition of sales + for values from ('2000-01-01') to ('2000-02-01'); + +create table sales_2000_02 + partition of sales + for values from ('2000-02-01') to ('2000-03-01'); + +insert into sales (order_date, customer_id, amount) values + ('2000-01-15', 1, 100), + ('2000-01-20', 2, 200), + ('2000-02-10', 3, 150), + ('2000-02-25', 4, 300); + +select * from sales where order_date >= '2000-01-01' and order_date < '2000-03-01'; + +select * from sales_2000_02; + +drop table sales cascade; + +create table customers ( + id bigint generated by default as identity, + name text, + country text, + primary key (country, id) +) +partition by list(country); + +create table customers_americas + partition of customers + for values in ('US', 'CANADA'); + +create table customers_asia + partition of customers + for values in ('INDIA', 'CHINA', 'JAPAN'); + +insert into customers (name, country) values + ('John Doe', 'US'), + ('Jane Smith', 'CANADA'), + ('Li Wei', 'CHINA'), + ('Priya Patel', 'INDIA'), + ('Yuki Tanaka', 'JAPAN'); + +select * from customers where country in ('US', 'CANADA'); + +select * from customers_asia; + +drop table customers cascade; + +create table products ( + id bigint generated by default as identity, + name text, + category text, + price bigint +) +partition by hash (id); + +create table products_one + partition of products + for values with (modulus 2, remainder 1); + +create table products_two + partition of products + for values with (modulus 2, remainder 0); + +insert into products (name, category, price) values + ('Laptop', 'Electronics', 999), + ('Phone', 'Electronics', 599), + ('Book', 'Education', 29), + ('Chair', 'Furniture', 199); + +select * from products where category = 'Electronics'; + +select count(*) from products_one; + +select count(*) from products_two; + +drop table products cascade; diff --git a/nix/tests/sql/docs-tables-and-data.sql b/nix/tests/sql/docs-tables-and-data.sql new file mode 100644 index 000000000..30a2a3cb9 --- /dev/null +++ b/nix/tests/sql/docs-tables-and-data.sql @@ -0,0 +1,249 @@ +-- Test file for "Tables and Data" documentation +-- This file contains all SQL statements from https://supabase.com/docs/guides/database/tables-and-data + +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); + +select table_name, column_name, data_type, is_nullable, column_default +from information_schema.columns +where table_name = 'movies' +order by ordinal_position; + +drop table if exists movies; +create table movies ( + id bigint generated always as identity primary key +); + +select column_name, data_type, is_nullable, column_default, is_identity, identity_generation +from information_schema.columns +where table_name = 'movies' and column_name = 'id'; + + + +drop table if exists movies; +create table movies ( + id bigint generated by default as identity primary key +); + +select column_name, data_type, is_nullable, column_default, is_identity, identity_generation +from information_schema.columns +where table_name = 'movies' and column_name = 'id'; + +drop table if exists movies; +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); + +insert into movies + (name, description) +values + ( + 'The Empire Strikes Back', + 'After the Rebels are brutally overpowered by the Empire on the ice planet Hoth, Luke Skywalker begins Jedi training with Yoda.' + ), + ( + 'Return of the Jedi', + 'After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star.' + ); + +select id, name, description from movies order by id; + +drop table if exists movies; +drop table if exists categories; + +create table categories ( + id bigint generated always as identity primary key, + name text +); + +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); + +alter table movies + add column category_id bigint references categories; + + +select + tc.table_name, + kcu.column_name, + ccu.table_name as foreign_table_name, + ccu.column_name as foreign_column_name +from information_schema.table_constraints as tc +join information_schema.key_column_usage as kcu + on tc.constraint_name = kcu.constraint_name + and tc.table_schema = kcu.table_schema +join information_schema.constraint_column_usage as ccu + on ccu.constraint_name = tc.constraint_name + and ccu.table_schema = tc.table_schema +where tc.constraint_type = 'FOREIGN KEY' and tc.table_name='movies'; + + +drop table if exists performances; +drop table if exists actors; +drop table if exists movies; + +create table movies ( + id bigint generated by default as identity primary key, + name text, + description text +); + +create table actors ( + id bigint generated by default as identity primary key, + name text +); + +create table performances ( + id bigint generated by default as identity primary key, + movie_id bigint not null references movies, + actor_id bigint not null references actors +); + +select table_name from information_schema.tables +where table_name in ('movies', 'actors', 'performances') +order by table_name; + + + +create schema private; + +select schema_name from information_schema.schemata where schema_name = 'private'; + +drop table if exists private.salaries; +drop table if exists actors cascade; + +create table actors ( + id bigint generated by default as identity primary key, + name text +); + +create table private.salaries ( + id bigint generated by default as identity primary key, + salary bigint not null, + actor_id bigint not null references public.actors +); + +select table_schema, table_name from information_schema.tables +where table_schema = 'private' and table_name = 'salaries'; + +drop table if exists grades; +drop table if exists courses; +drop table if exists students; +drop view if exists transcripts; + +create table students ( + id bigint generated by default as identity primary key, + name text, + type text +); + +create table courses ( + id bigint generated by default as identity primary key, + title text, + code text +); + +create table grades ( + id bigint generated by default as identity primary key, + student_id bigint not null references students, + course_id bigint not null references courses, + result text +); + +-- Insert test data +insert into students (name, type) values + ('Princess Leia', 'undergraduate'), + ('Yoda', 'graduate'), + ('Anakin Skywalker', 'graduate'); + +insert into courses (title, code) values + ('Introduction to Postgres', 'PG101'), + ('Authentication Theories', 'AUTH205'), + ('Fundamentals of Supabase', 'SUP412'); + +insert into grades (student_id, course_id, result) values + (1, 1, 'B+'), + (1, 3, 'A+'), + (2, 2, 'A'), + (3, 1, 'A-'), + (3, 2, 'A'), + (3, 3, 'B-'); + +-- Create view +create view transcripts as + select + students.name, + students.type, + courses.title, + courses.code, + grades.result + from grades + left join students on grades.student_id = students.id + left join courses on grades.course_id = courses.id; + +grant all on table transcripts to authenticated; + +select name, type, title, code, result from transcripts order by name, code; + +drop materialized view if exists transcripts_materialized; + +create materialized view transcripts_materialized as + select + students.name, + students.type, + courses.title, + courses.code, + grades.result + from + grades + left join students on grades.student_id = students.id + left join courses on grades.course_id = courses.id; + + +select name, type, title, code, result from transcripts_materialized order by name, code; + +refresh materialized view transcripts_materialized; + +select count(*) from transcripts_materialized; + +drop view if exists secure_transcripts; + +create view secure_transcripts with(security_invoker=true) as ( + select name, type, title, code, result from transcripts +); + + +select schemaname, viewname +from pg_views +where viewname = 'secure_transcripts'; + +drop view if exists test_view; +create view test_view as select 1 as test_col; + +alter view test_view set (security_invoker = true); + +select schemaname, viewname +from pg_views +where viewname = 'test_view'; + +drop materialized view if exists transcripts_materialized; +drop view if exists secure_transcripts; +drop view if exists transcripts; +drop view if exists test_view; +drop table if exists grades; +drop table if exists courses; +drop table if exists students; +drop table if exists private.salaries; +drop table if exists actors; +drop table if exists performances; +drop table if exists movies; +drop table if exists categories; +drop schema if exists private; diff --git a/nix/tests/sql/docs-triggers.sql b/nix/tests/sql/docs-triggers.sql new file mode 100644 index 000000000..1f132bfae --- /dev/null +++ b/nix/tests/sql/docs-triggers.sql @@ -0,0 +1,226 @@ +-- testing sql found in https://supabase.com/docs/guides/database/postgres/triggers + +create table employees ( + id serial primary key, + name text, + salary numeric +); + +create table salary_log ( + id serial primary key, + employee_id integer, + old_salary numeric, + new_salary numeric, + created_at timestamp default now() +); + +create function update_salary_log() +returns trigger +language plpgsql +as $$ +begin + insert into salary_log(employee_id, old_salary, new_salary) + values (new.id, old.salary, new.salary); + return new; +end; +$$; + +create trigger salary_update_trigger +after update on employees +for each row +execute function update_salary_log(); + +insert into employees (name, salary) values ('John Doe', 50000); +insert into employees (name, salary) values ('Jane Smith', 60000); + +update employees set salary = 55000 where name = 'John Doe'; + +select id, employee_id, old_salary, new_salary from salary_log; + +create table orders ( + id serial primary key, + customer_id integer, + amount numeric, + status text +); + +create table customers ( + id serial primary key, + name text, + email text +); + +create function before_insert_function() +returns trigger +language plpgsql +as $$ +begin + if new.amount <= 0 then + raise exception 'Order amount must be greater than 0'; + end if; + return new; +end; +$$; + +create trigger before_insert_trigger +before insert on orders +for each row +execute function before_insert_function(); + +create table customer_audit ( + id serial primary key, + customer_id integer, + action text, + customer_name text, + deleted_at timestamp default now() +); + +create function after_delete_function() +returns trigger +language plpgsql +as $$ +begin + insert into customer_audit(customer_id, action, customer_name) + values (old.id, 'DELETE', old.name); + return old; +end; +$$; + +create trigger after_delete_trigger +after delete on customers +for each row +execute function after_delete_function(); + +insert into customers (name, email) values ('Alice Johnson', 'alice@example.com'); +insert into customers (name, email) values ('Bob Wilson', 'bob@example.com'); + +insert into orders (customer_id, amount, status) values (1, 100.50, 'pending'); +insert into orders (customer_id, amount, status) values (2, 250.75, 'pending'); + +delete from customers where name = 'Alice Johnson'; + +select id, customer_id, action, customer_name from customer_audit; + +create table trigger_events ( + id serial primary key, + trigger_name text, + operation text, + table_name text, + event_time timestamp default now() +); + +create function statement_level_function() +returns trigger +language plpgsql +as $$ +begin + insert into trigger_events(trigger_name, operation, table_name) + values (tg_name, tg_op, tg_table_name); + return null; +end; +$$; + +create trigger statement_level_trigger +after insert on orders +for each statement +execute function statement_level_function(); + +insert into orders (customer_id, amount, status) values (2, 150.25, 'pending'); + +select id, trigger_name, operation, table_name from trigger_events; + +create table trigger_variables_log ( + id serial primary key, + trigger_name text, + trigger_when text, + operation text, + table_name text, + table_schema text, + row_id integer, + event_time timestamp default now() +); + +create function trigger_variables_example() +returns trigger +language plpgsql +as $$ +begin + if tg_op = 'INSERT' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, new.id); + elsif tg_op = 'UPDATE' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, new.id); + elsif tg_op = 'DELETE' then + insert into trigger_variables_log(trigger_name, trigger_when, operation, table_name, table_schema, row_id) + values (tg_name, tg_when, tg_op, tg_table_name, tg_table_schema, old.id); + end if; + + return coalesce(new, old); +end; +$$; + +create trigger variables_trigger +after insert or update or delete on employees +for each row +execute function trigger_variables_example(); + +insert into employees (name, salary) values ('Charlie Brown', 45000); +update employees set salary = 47000 where name = 'Charlie Brown'; +delete from employees where name = 'Charlie Brown'; + +select id, trigger_name, trigger_when, operation, table_name, table_schema, row_id from trigger_variables_log; + +create table high_salary_alerts ( + id serial primary key, + employee_name text, + salary numeric, + alert_time timestamp default now() +); + +create function conditional_trigger_function() +returns trigger +language plpgsql +as $$ +begin + if new.salary > 100000 then + insert into high_salary_alerts(employee_name, salary) + values (new.name, new.salary); + end if; + return new; +end; +$$; + +create trigger conditional_trigger +after insert or update on employees +for each row +when (new.salary > 100000) +execute function conditional_trigger_function(); + +insert into employees (name, salary) values ('Executive', 150000); +insert into employees (name, salary) values ('Intern', 30000); + +select id, employee_name, salary from high_salary_alerts; + +drop trigger conditional_trigger on employees; +drop trigger variables_trigger on employees; +drop trigger statement_level_trigger on orders; +drop trigger after_delete_trigger on customers; +drop trigger before_insert_trigger on orders; +drop trigger salary_update_trigger on employees; + +drop function conditional_trigger_function(); +drop function trigger_variables_example(); +drop function statement_level_function(); +drop function after_delete_function(); +drop function before_insert_function(); +drop function update_salary_log(); + +drop table high_salary_alerts; +drop table trigger_variables_log; +drop table trigger_events; +drop table customer_audit; +drop table salary_log; +drop table employees; +drop table orders; +drop table customers; diff --git a/nix/tests/sql/docs-webhooks.sql b/nix/tests/sql/docs-webhooks.sql new file mode 100644 index 000000000..56ce68144 --- /dev/null +++ b/nix/tests/sql/docs-webhooks.sql @@ -0,0 +1,262 @@ +-- testing sql found in https://supabase.com/docs/guides/database/webhooks + +create table profiles ( + id serial primary key, + name text, + email text, + created_at timestamp default now() +); + +create table webhook_logs ( + id serial primary key, + webhook_name text, + event_type text, + table_name text, + schema_name text, + record_data jsonb, + old_record_data jsonb, + created_at timestamp default now() +); + +create function webhook_handler() +returns trigger +language plpgsql +as $$ +declare + payload jsonb; +begin + if tg_op = 'INSERT' then + payload := jsonb_build_object( + 'type', 'INSERT', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', null + ); + elsif tg_op = 'UPDATE' then + payload := jsonb_build_object( + 'type', 'UPDATE', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ); + elsif tg_op = 'DELETE' then + payload := jsonb_build_object( + 'type', 'DELETE', + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', null, + 'old_record', to_jsonb(old) + ); + end if; + + insert into webhook_logs(webhook_name, event_type, table_name, schema_name, record_data, old_record_data) + values (tg_name, tg_op, tg_table_name, tg_table_schema, payload->'record', payload->'old_record'); + + return coalesce(new, old); +end; +$$; + +create trigger insert_webhook +after insert on profiles +for each row +execute function webhook_handler(); + +create trigger update_webhook +after update on profiles +for each row +execute function webhook_handler(); + +create trigger delete_webhook +after delete on profiles +for each row +execute function webhook_handler(); + +insert into profiles (name, email) values ('John Doe', 'john@example.com'); +insert into profiles (name, email) values ('Jane Smith', 'jane@example.com'); + +select id, webhook_name, event_type, table_name, schema_name, record_data - 'created_at' from webhook_logs where event_type = 'INSERT'; + +update profiles set email = 'john.doe@example.com' where name = 'John Doe'; + +select id, webhook_name, event_type, table_name, schema_name, record_data - 'created_at', old_record_data - 'created_at' from webhook_logs where event_type = 'UPDATE'; + +delete from profiles where name = 'Jane Smith'; + +select id, webhook_name, event_type, table_name, schema_name, old_record_data - 'created_at' from webhook_logs where event_type = 'DELETE'; + +create table orders ( + id serial primary key, + customer_id integer, + amount numeric, + status text +); + +create table webhook_requests ( + id serial primary key, + webhook_name text, + url text, + method text, + headers jsonb, + payload jsonb, + response_status integer, + response_data jsonb, + created_at timestamp default now() +); + +create function mock_http_response(url text) +returns table(status integer, body jsonb) +language plpgsql +as $$ +begin + if url like '%dummyjson.com/products/1%' then + return query select 200, '{"id": 1, "title": "Essence Mascara Lash Princess", "price": 9.99, "category": "beauty"}'::jsonb; + elsif url like '%dummyjson.com/products/2%' then + return query select 200, '{"id": 2, "title": "Eyeshadow Palette with Mirror", "price": 19.99, "category": "beauty"}'::jsonb; + else + return query select 404, '{"error": "Product not found"}'::jsonb; + end if; +end; +$$; + +create function http_webhook_handler() +returns trigger +language plpgsql +as $$ +declare + response_code integer; + response_body jsonb; +begin + select status, body into response_code, response_body + from mock_http_response('https://dummyjson.com/products/1'); + + insert into webhook_requests(webhook_name, url, method, headers, payload, response_status, response_data) + values ( + 'orders_webhook', + 'https://dummyjson.com/products/1', + 'GET', + '{"Content-Type": "application/json"}'::jsonb, + jsonb_build_object( + 'type', tg_op, + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ), + response_code, + response_body + ); + + return coalesce(new, old); +end; +$$; + +create trigger http_webhook +after insert or update or delete on orders +for each row +execute function http_webhook_handler(); + +insert into orders (customer_id, amount, status) values (1, 100.50, 'pending'); +insert into orders (customer_id, amount, status) values (2, 250.75, 'completed'); + +select id, webhook_name, url, method, response_status, response_data from webhook_requests; + +create table webhook_config ( + id serial primary key, + webhook_name text, + url text, + method text default 'GET', + headers jsonb default '{"Content-Type": "application/json"}'::jsonb, + timeout_ms integer default 1000 +); + +insert into webhook_config (webhook_name, url, method, headers, timeout_ms) +values ('product_webhook', 'https://dummyjson.com/products/2', 'GET', '{"Content-Type": "application/json"}'::jsonb, 5000); + +create function configurable_webhook_handler() +returns trigger +language plpgsql +as $$ +declare + config webhook_config%rowtype; + payload jsonb; + response_code integer; + response_body jsonb; +begin + select * into config from webhook_config where webhook_name = 'product_webhook' limit 1; + + if config.id is null then + raise exception 'Webhook configuration not found'; + end if; + + payload := jsonb_build_object( + 'type', tg_op, + 'table', tg_table_name, + 'schema', tg_table_schema, + 'record', to_jsonb(new), + 'old_record', to_jsonb(old) + ); + + select status, body into response_code, response_body + from mock_http_response(config.url); + + insert into webhook_requests(webhook_name, url, method, headers, payload, response_status, response_data) + values (config.webhook_name, config.url, config.method, config.headers, payload, response_code, response_body); + + if response_code != 200 then + raise exception 'Configurable webhook failed with status: %', response_code; + end if; + + return coalesce(new, old); +end; +$$; + +create trigger product_webhook +after insert on profiles +for each row +execute function configurable_webhook_handler(); + +insert into profiles (name, email) values ('Alice Johnson', 'alice@example.com'); + +select id, webhook_name, url, method, response_status, response_data from webhook_requests where webhook_name = 'product_webhook'; + +create function get_webhook_logs() +returns table ( + webhook_name text, + event_type text, + table_name text, + record_count bigint +) +language sql +as $$ + select + webhook_name, + event_type, + table_name, + count(*) as record_count + from webhook_logs + group by webhook_name, event_type, table_name + order by webhook_name, event_type; +$$; + +select * from get_webhook_logs(); + +drop trigger product_webhook on profiles; +drop trigger http_webhook on orders; +drop trigger delete_webhook on profiles; +drop trigger update_webhook on profiles; +drop trigger insert_webhook on profiles; + +drop function configurable_webhook_handler(); +drop function http_webhook_handler(); +drop function mock_http_response(text); +drop function get_webhook_logs(); +drop function webhook_handler(); + +drop table webhook_config; +drop table webhook_requests; +drop table webhook_logs; +drop table orders; +drop table profiles; + \ No newline at end of file From dcbaa6dd72fdd4c305ebd82301d9ec9582cbfd12 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:24:14 +0100 Subject: [PATCH 018/134] feat: add the supabase admin agent to the ami build (#1679) * feat: add the supabase admin agent to the ami build * chore: bump saa * chore: underscore versus dashes * chore: correc the uri * chore: omg squash this later * chore: xz to gz for saa --- .github/workflows/nix-build.yml | 10 +-- .github/workflows/testinfra-ami-build.yml | 14 +-- ansible/files/permission_check.py | 10 +++ .../supabase-admin-agent.sudoers.conf | 2 + .../supabase-admin-agent_salt.service | 19 ++++ .../supabase-admin-agent_salt.timer | 13 +++ .../tasks/internal/supabase-admin-agent.yml | 87 +++++++++++++++++++ ansible/tasks/setup-supabase-internal.yml | 17 ++-- ansible/vars.yml | 7 +- 9 files changed, 158 insertions(+), 21 deletions(-) create mode 100644 ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf create mode 100644 ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service create mode 100644 ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer create mode 100644 ansible/tasks/internal/supabase-admin-agent.yml diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index d562ab6ca..36dc01d05 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -79,19 +79,19 @@ jobs: trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Build psql bundle run: > - nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" - -- --skip-cached --no-nom - --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" + nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" + -- --skip-cached --no-nom + --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }} AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }} - + run-testinfra: needs: build-run-image if: ${{ success() }} uses: ./.github/workflows/testinfra-ami-build.yml - + run-tests: needs: build-run-image if: ${{ success() }} diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 8544f1b85..321430c86 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -37,7 +37,7 @@ jobs: ubuntu_release: focal ubuntu_version: 20.04 mcpu: neoverse-n1 - runs-on: ${{ matrix.runner }} + runs-on: ${{ matrix.runner }} timeout-minutes: 150 permissions: contents: write @@ -73,7 +73,7 @@ jobs: echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file echo "" >> common-nix.vars.pkr.hcl - + - name: Build AMI stage 1 run: | packer init amazon-arm64-nix.pkr.hcl @@ -84,7 +84,7 @@ jobs: run: | packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl + packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl - name: Run tests timeout-minutes: 10 @@ -93,8 +93,8 @@ jobs: run: | # TODO: use poetry for pkg mgmt pip3 install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest pytest-testinfra[paramiko,docker] requests - pytest -vv -s testinfra/test_ami_nix.py - + pytest -vv -s testinfra/test_ami_nix.py + - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | @@ -111,7 +111,7 @@ jobs: # Define AMI name patterns STAGE1_AMI_NAME="supabase-postgres-ci-ami-test-stage-1" STAGE2_AMI_NAME="${{ steps.random.outputs.random_string }}" - + # Function to deregister AMIs by name pattern deregister_ami_by_name() { local ami_name_pattern=$1 @@ -121,7 +121,7 @@ jobs: aws ec2 deregister-image --region ap-southeast-1 --image-id $ami_id done } - + # Deregister AMIs deregister_ami_by_name "$STAGE1_AMI_NAME" deregister_ami_by_name "$STAGE2_AMI_NAME" diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index a753f69ec..46f458f9a 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -94,11 +94,17 @@ "systemd-coredump": [ {"groupname": "systemd-coredump", "username": "systemd-coredump"} ], + "supabase-admin-agent": [ + {"groupname": "supabase-admin-agent", "username": "supabase-admin-agent"}, + {"groupname": "admin", "username": "supabase-admin-agent"}, + {"groupname": "salt", "username": "supabase-admin-agent"}, + ], } # postgresql.service is expected to mount /etc as read-only expected_mount = "/etc ro" + # This program depends on osquery being installed on the system # Function to run osquery def run_osquery(query): @@ -154,6 +160,7 @@ def check_nixbld_users(): print("All nixbld users are in the 'nixbld' group.") + def check_postgresql_mount(): # processes table has the nix .postgres-wrapped path as the # binary path, rather than /usr/lib/postgresql/bin/postgres which @@ -182,6 +189,7 @@ def check_postgresql_mount(): print("postgresql.service mounts /etc as read-only.") + def main(): parser = argparse.ArgumentParser( prog="Supabase Postgres Artifact Permissions Checker", @@ -234,6 +242,7 @@ def main(): "postgrest", "tcpdump", "systemd-coredump", + "supabase-admin-agent", ] if not qemu_artifact: usernames.append("ec2-instance-connect") @@ -251,5 +260,6 @@ def main(): # Check if postgresql.service is using a read-only mount for /etc check_postgresql_mount() + if __name__ == "__main__": main() diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf b/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf new file mode 100644 index 000000000..6896e2f0c --- /dev/null +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf @@ -0,0 +1,2 @@ +%supabase-admin-agent ALL= NOPASSWD: /usr/bin/salt-call +%supabase-admin-agent ALL= NOPASSWD: /usr/bin/gpg --homedir {{ gpgdir }} --import, /usr/bin/gpg --homedir {{ gpgdir }} --list-secret-keys * diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service new file mode 100644 index 000000000..92f1d2e31 --- /dev/null +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service @@ -0,0 +1,19 @@ +[Unit] +Description=Configuration management via supabase-admin-agent salt +After=network.target + +[Service] +Type=oneshot +ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result +User=supabase-admin-agent +Group=supabase-admin-agent +StandardOutput=journal +StandardError=journal +StateDirectory=supabase-admin-agent +CacheDirectory=supabase-admin-agent + +# Security hardening +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer new file mode 100644 index 000000000..8044c2e1a --- /dev/null +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer @@ -0,0 +1,13 @@ +[Unit] +Description=Run Supabase supabase-admin-agent salt on a schedule +Requires=supabase-admin-agent_salt.service + +[Timer] +OnCalendar=*:0/10 +# Random delay up to {{ splay }} seconds splay +RandomizedDelaySec={{ splay }} +AccuracySec=1s +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/ansible/tasks/internal/supabase-admin-agent.yml b/ansible/tasks/internal/supabase-admin-agent.yml new file mode 100644 index 000000000..4e5f87e5e --- /dev/null +++ b/ansible/tasks/internal/supabase-admin-agent.yml @@ -0,0 +1,87 @@ +- name: supabase-admin-agent - system group + group: + name: supabase-admin-agent + system: yes + +- name: supabase-admin-agent - system user + user: + name: supabase-admin-agent + group: supabase-admin-agent + groups: admin,salt + append: yes + system: yes + shell: /bin/sh + +- name: supabase-admin-agent - config dir + file: + path: /opt/supabase-admin-agent + owner: supabase-admin-agent + state: directory + +- name: supabase-admin-agent - gpg dir + file: + path: /etc/salt/gpgkeys + owner: root + group: salt + state: directory + +- name: give supabase-admin-agent user permissions + copy: + src: files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf + dest: /etc/sudoers.d/supabase-admin-agent + mode: "0644" + +- name: Setting arch (x86) + set_fact: + arch: "x86" + when: platform == "amd64" + +- name: Setting arch (arm) + set_fact: + arch: "arm64" + when: platform == "arm64" + +- name: Download supabase-admin-agent archive + get_url: + url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/supabase-admin-agent/v%7B%7B%20supabase_admin_agent_release%20%7D%7D/supabase-admin-agent-%7B%7B%20supabase_admin_agent_release%20%7D%7D-linux-%7B%7B%20arch%20%7D%7D.tar.gz" + dest: "/tmp/supabase-admin-agent.tar.gz" + timeout: 90 + +- name: supabase-admin-agent - unpack archive in /opt + unarchive: + remote_src: yes + src: /tmp/supabase-admin-agent.tar.gz + dest: /opt/supabase-admin-agent/ + owner: supabase-admin-agent + extra_opts: + - --strip-components=1 + +- name: supabase-admin-agent - create symlink + ansible.builtin.file: + path: /opt/supabase-admin-agent/supabase-admin-agent + src: "/opt/supabase-admin-agent/supabase-admin-agent-linux-{{ arch }}" + state: link + owner: supabase-admin-agent + mode: "0755" + force: yes + +- name: supabase-admin-agent - create salt systemd timer file + copy: + src: files/supabase_admin_agent_config/supabase-admin-agent_salt.timer + dest: /etc/systemd/system/supabase-admin-agent_salt.timer + +- name: supabase-admin-agent - create salt service file + copy: + src: files/supabase_admin_agent_config/supabase-admin-agent_salt.service + dest: /etc/systemd/system/supabase-admin-agent_salt.service + +- name: supabase-admin-agent - reload systemd + systemd: + daemon_reload: yes + +# Initially ensure supabase-admin-agent is installed but not started +- name: supabase-admin-agent - DISABLE service + systemd: + name: supabase-admin-agent_salt + enabled: no + state: stopped diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index 7aa931763..d5583b597 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -34,19 +34,19 @@ aws configure set default.s3.use_dualstack_endpoint true - name: install Vector for logging - become: yes + become: true apt: deb: "{{ vector_x86_deb }}" when: platform == "amd64" - name: install Vector for logging - become: yes + become: true apt: deb: "{{ vector_arm_deb }}" when: platform == "arm64" - name: add Vector to postgres group - become: yes + become: true shell: cmd: | usermod -a -G postgres vector @@ -72,21 +72,21 @@ daemon_reload: yes - name: Create checkpoints dir - become: yes + become: true file: path: /var/lib/vector state: directory owner: vector - name: Include file for generated optimizations in postgresql.conf - become: yes + become: true replace: path: /etc/postgresql/postgresql.conf regexp: "#include = '/etc/postgresql-custom/generated-optimizations.conf'" replace: "include = '/etc/postgresql-custom/generated-optimizations.conf'" - name: Include file for custom overrides in postgresql.conf - become: yes + become: true replace: path: /etc/postgresql/postgresql.conf regexp: "#include = '/etc/postgresql-custom/custom-overrides.conf'" @@ -115,5 +115,10 @@ tags: - aws-only +- name: Install supabase-admin-agent + import_tasks: internal/supabase-admin-agent.yml + tags: + - aws-only + - name: Envoy - use lds.supabase.yaml for /etc/envoy/lds.yaml command: mv /etc/envoy/lds.supabase.yaml /etc/envoy/lds.yaml diff --git a/ansible/vars.yml b/ansible/vars.yml index 7a7147353..1d24249ad 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.098-orioledb" - postgres17: "17.4.1.048" - postgres15: "15.8.1.105" + postgresorioledb-17: "17.0.1.099-orioledb" + postgres17: "17.4.1.049" + postgres15: "15.8.1.106" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -54,6 +54,7 @@ postgres_exporter_release_checksum: adminapi_release: 0.84.1 adminmgr_release: 0.25.1 +supabase_admin_agent_release: 1.4.36 vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" From d5599642a83e3bcaffc5941dece45ef8e6ea6f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 3 Jul 2025 16:34:17 +0200 Subject: [PATCH 019/134] refactor(nix): split flake.nix using flake-parts (#1681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(nix): split flake.nix using flake-parts This commit introduces a modular Nix flake structure using flake-parts. The monolithic flake.nix has been split into specialized modules. Here is an overview of the new directory structure: ``` ├── flake.nix # Root flake file only referencing modules nix/ ├── apps.nix # Application definitions ├── checks.nix # Build checks and tests ├── config.nix # Global configuration ├── devShells.nix # Development environment shell ├── fmt.nix # Code formatting configuration ├── hooks.nix # Git hooks and pre-commit ├── ext/ # PostgreSQL extensions ├── overlays/ # Nixpkgs overlays ├── packages/ # Custom packages └── postgresql/ # PostgreSQL packages ``` * refactor: move overlays to dedicated directory The commit moves the overlay configuration from packages/default.nix to a new dedicated overlays/default.nix file for better organization, while keeping the same functionality. This change improves code structure and maintainability. * refactor(nix): centralize postgresql configuration in config.nix Moves postgresql version definitions and default settings into a centralized config.nix module. * refactor(nix): generate postgresql packages into single module Moves postgresql source and debug package generation into the postgresql module. This reduces duplication by generating packages dynamically based on supported versions. * refactor: reorganize groonga package and cleanup dependencies The changes reorganize the groonga-related packages by moving files to a dedicated directory and cleaning up dependencies. It also removes some unused variables and improves package structure. * feat: configure formatter for nix files * chore: format nix files * feat: add git-hooks.nix for pre-commit formatting checks Adds pre-commit hooks using git-hooks.nix to run treefmt formatting checks before commits. * docs: generate documentation site with MkDocs Add MkDocs configuration and assets for generating a documentation site. This is more readable and provides a structured way to present information about the project. We don't store the generated site in the repository, but instead use MkDocs to build it on demand. In a development shell, one can run `mkdocs serve` to quickly preview the site locally. * fix: add missing recommended direnv We document the recommended `.envrc` file in the docs, but we forgot to add it to the repository. * doc: add documentation about formatting and directory structure * doc: add helper to generate documentation using mkdocs mkdocs renders the documentation present in the `nix/docs/` directory in HTML format. --- .envrc.recommended | 3 + .gitignore | 5 + flake.lock | 119 +- flake.nix | 1482 +---------------- nix/apps.nix | 32 + nix/cargo-pgrx/buildPgrxExtension.nix | 82 +- nix/cargo-pgrx/default.nix | 42 +- nix/checks.nix | 311 ++++ nix/config.nix | 62 + nix/devShells.nix | 81 + nix/docs/README.md | 32 +- nix/docs/adding-new-package.md | 4 +- nix/docs/assets/images/logo.png | Bin 0 -> 2530 bytes nix/docs/documentation.md | 19 + nix/docs/new-major-postgres.md | 17 +- nix/docs/nix-directory-structure.md | 163 ++ nix/docs/nix-formatter.md | 97 ++ nix/docs/nix-overlays.md | 2 +- nix/docs/pre-commit-hooks.md | 69 + nix/docs/references.md | 56 +- nix/docs/site/.keep | 0 nix/ext/default.nix | 11 + nix/ext/gdal.nix | 62 +- nix/ext/hypopg.nix | 7 +- nix/ext/index_advisor.nix | 7 +- nix/ext/mecab-naist-jdic/default.nix | 17 +- nix/ext/orioledb.nix | 19 +- nix/ext/pg-safeupdate.nix | 23 +- nix/ext/pg_backtrace.nix | 19 +- nix/ext/pg_cron.nix | 21 +- nix/ext/pg_graphql.nix | 29 +- nix/ext/pg_hashids.nix | 7 +- nix/ext/pg_jsonschema.nix | 37 +- nix/ext/pg_net.nix | 13 +- nix/ext/pg_partman.nix | 23 +- nix/ext/pg_plan_filter.nix | 7 +- nix/ext/pg_regress.nix | 7 +- nix/ext/pg_repack.nix | 20 +- nix/ext/pg_stat_monitor.nix | 24 +- nix/ext/pg_tle.nix | 18 +- nix/ext/pgaudit.nix | 46 +- nix/ext/pgjwt.nix | 14 +- nix/ext/pgmq.nix | 19 +- nix/ext/pgroonga.nix | 51 +- nix/ext/pgrouting.nix | 55 +- nix/ext/pgsodium.nix | 13 +- nix/ext/pgsql-http.nix | 13 +- nix/ext/pgtap.nix | 17 +- nix/ext/pgvector.nix | 7 +- nix/ext/pljava.nix | 45 +- nix/ext/plpgsql-check.nix | 8 +- nix/ext/plv8.nix | 145 +- nix/ext/postgis.nix | 88 +- nix/ext/rum.nix | 7 +- nix/ext/sfcgal/sfcgal.nix | 32 +- nix/ext/supautils.nix | 7 +- nix/ext/timescaledb-2.9.1.nix | 25 +- nix/ext/timescaledb.nix | 24 +- nix/ext/vault.nix | 13 +- nix/ext/wal2json.nix | 9 +- nix/ext/wrappers/default.nix | 187 ++- nix/fmt.nix | 12 + nix/hooks.nix | 19 + nix/mkdocs.yml | 132 ++ nix/nixpkgs.nix | 16 + nix/overlays/default.nix | 55 + nix/packages/build-test-ami.nix | 158 ++ nix/packages/cleanup-ami.nix | 61 + nix/packages/dbmate-tool.nix | 45 + nix/packages/default.nix | 78 + nix/packages/docs.nix | 22 + .../groonga/default.nix} | 68 +- .../do-not-use-vendored-libraries.patch | 0 .../groonga}/fix-cmake-install-path.patch | 0 nix/packages/lib.nix | 137 ++ nix/packages/local-infra-bootstrap.nix | 6 + .../local-infra-bootstrap.sh.in | 0 nix/packages/migrate-tool.nix | 18 + nix/packages/pg-restore.nix | 7 + nix/packages/postgres.nix | 176 ++ nix/{tools => packages}/run-restore.sh.in | 0 nix/packages/run-testinfra.nix | 146 ++ nix/packages/show-commands.nix | 23 + nix/packages/start-client.nix | 27 + nix/packages/start-replica.nix | 12 + .../start-replica.sh.in} | 0 nix/packages/sync-exts-versions.nix | 17 + nix/packages/trigger-nix-build.nix | 125 ++ nix/packages/update-readme.nix | 17 + nix/{ => packages}/wal-g.nix | 28 +- nix/postgresql/15.nix | 4 - nix/postgresql/17.nix | 4 - nix/postgresql/default.nix | 94 +- nix/postgresql/generic.nix | 663 ++++---- nix/postgresql/orioledb-17.nix | 4 - nix/postgresql/src.nix | 31 + 96 files changed, 3775 insertions(+), 2304 deletions(-) create mode 100644 .envrc.recommended create mode 100644 nix/apps.nix create mode 100644 nix/checks.nix create mode 100644 nix/config.nix create mode 100644 nix/devShells.nix create mode 100644 nix/docs/assets/images/logo.png create mode 100644 nix/docs/documentation.md create mode 100644 nix/docs/nix-directory-structure.md create mode 100644 nix/docs/nix-formatter.md create mode 100644 nix/docs/pre-commit-hooks.md create mode 100644 nix/docs/site/.keep create mode 100644 nix/ext/default.nix create mode 100644 nix/fmt.nix create mode 100644 nix/hooks.nix create mode 100644 nix/mkdocs.yml create mode 100644 nix/nixpkgs.nix create mode 100644 nix/overlays/default.nix create mode 100644 nix/packages/build-test-ami.nix create mode 100644 nix/packages/cleanup-ami.nix create mode 100644 nix/packages/dbmate-tool.nix create mode 100644 nix/packages/default.nix create mode 100644 nix/packages/docs.nix rename nix/{supabase-groonga.nix => packages/groonga/default.nix} (65%) rename nix/{ => packages/groonga}/do-not-use-vendored-libraries.patch (100%) rename nix/{ => packages/groonga}/fix-cmake-install-path.patch (100%) create mode 100644 nix/packages/lib.nix create mode 100644 nix/packages/local-infra-bootstrap.nix rename nix/{tools => packages}/local-infra-bootstrap.sh.in (100%) create mode 100644 nix/packages/migrate-tool.nix create mode 100644 nix/packages/pg-restore.nix create mode 100644 nix/packages/postgres.nix rename nix/{tools => packages}/run-restore.sh.in (100%) create mode 100644 nix/packages/run-testinfra.nix create mode 100644 nix/packages/show-commands.nix create mode 100644 nix/packages/start-client.nix create mode 100644 nix/packages/start-replica.nix rename nix/{tools/run-replica.sh.in => packages/start-replica.sh.in} (100%) create mode 100644 nix/packages/sync-exts-versions.nix create mode 100644 nix/packages/trigger-nix-build.nix create mode 100644 nix/packages/update-readme.nix rename nix/{ => packages}/wal-g.nix (90%) delete mode 100644 nix/postgresql/15.nix delete mode 100644 nix/postgresql/17.nix delete mode 100644 nix/postgresql/orioledb-17.nix create mode 100644 nix/postgresql/src.nix diff --git a/.envrc.recommended b/.envrc.recommended new file mode 100644 index 000000000..a7aaf82ac --- /dev/null +++ b/.envrc.recommended @@ -0,0 +1,3 @@ +watch_file nix/devShells.nix + +use flake diff --git a/.gitignore b/.gitignore index d32cc8f60..5372bfdeb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ __pycache__/ result* .env-local .history +.envrc +.direnv #IDE @@ -25,3 +27,6 @@ result* db/schema.sql common-nix.vars.pkr.hcl + +# pre-commit config is managed in nix +.pre-commit-config.yaml diff --git a/flake.lock b/flake.lock index bea404a1f..167905994 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,40 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "nix-fast-build", @@ -57,6 +91,49 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "nix-editor": { "inputs": { "nixpkgs": "nixpkgs", @@ -78,7 +155,7 @@ }, "nix-fast-build": { "inputs": { - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix" }, @@ -131,6 +208,21 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1750555020, + "narHash": "sha256-/MjivcZIz8dyLOTFdJzS5Yazt2QCePQBh8uZooODaYw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "6fb7349157ee1bffd053b1fdd454aa74ff7b4aee", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1749411262, @@ -196,12 +288,15 @@ }, "root": { "inputs": { + "flake-parts": "flake-parts", "flake-utils": "flake-utils", + "git-hooks": "git-hooks", "nix-editor": "nix-editor", "nix-fast-build": "nix-fast-build", "nix2container": "nix2container", "nixpkgs": "nixpkgs_4", - "rust-overlay": "rust-overlay" + "rust-overlay": "rust-overlay", + "treefmt-nix": "treefmt-nix_2" } }, "rust-overlay": { @@ -273,6 +368,26 @@ "type": "github" } }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750931469, + "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index 18cd9ba13..3aa651b09 100644 --- a/flake.nix +++ b/flake.nix @@ -8,1471 +8,33 @@ nix-editor.url = "github:snowfallorg/nix-editor"; rust-overlay.url = "github:oxalica/rust-overlay"; nix-fast-build.url = "github:Mic92/nix-fast-build"; + flake-parts.url = "github:hercules-ci/flake-parts"; + treefmt-nix.url = "github:numtide/treefmt-nix"; + treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; + git-hooks.url = "github:cachix/git-hooks.nix"; + git-hooks.inputs.nixpkgs.follows = "nixpkgs"; }; - outputs = { self, nixpkgs, flake-utils, nix-editor, rust-overlay, nix2container, ... }@inputs: - let - gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; - - ourSystems = with flake-utils.lib; [ + outputs = + { flake-utils, ... }@inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } (_: { + systems = with flake-utils.lib; [ system.x86_64-linux system.aarch64-linux system.aarch64-darwin ]; - in - flake-utils.lib.eachSystem ourSystems (system: - let - pgsqlDefaultPort = "5435"; - pgsqlDefaultHost = "localhost"; - pgsqlSuperuser = "supabase_admin"; - - pkgs = import nixpkgs { - config = { - allowUnfree = true; - permittedInsecurePackages = [ - "v8-9.7.106.18" - ]; - }; - inherit system; - overlays = [ - # NOTE: add any needed overlays here. in theory we could - # pull them from the overlays/ directory automatically, but we don't - # want to have an arbitrary order, since it might matter. being - # explicit is better. - (final: prev: { - xmrig = throw "The xmrig package has been explicitly disabled in this flake."; - }) - (import rust-overlay) - (final: prev: { - cargo-pgrx = final.callPackage ./nix/cargo-pgrx/default.nix { - inherit (final) lib; - inherit (final) darwin; - inherit (final) fetchCrate; - inherit (final) openssl; - inherit (final) pkg-config; - inherit (final) makeRustPlatform; - inherit (final) stdenv; - inherit (final) rust-bin; - }; - - buildPgrxExtension = final.callPackage ./nix/cargo-pgrx/buildPgrxExtension.nix { - inherit (final) cargo-pgrx; - inherit (final) lib; - inherit (final) Security; - inherit (final) pkg-config; - inherit (final) makeRustPlatform; - inherit (final) stdenv; - inherit (final) writeShellScriptBin; - }; - - buildPgrxExtension_0_11_3 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_3; - }; - - buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6; - }; - - buildPgrxExtension_0_12_9 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9; - }; - - buildPgrxExtension_0_14_3 = prev.buildPgrxExtension.override { - cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3; - }; - - }) - (final: prev: { - postgresql = final.callPackage ./nix/postgresql/default.nix { - inherit (final) lib stdenv fetchurl makeWrapper callPackage buildEnv newScope; - }; - }) - ]; - }; - # Define pythonEnv here - pythonEnv = pkgs.python3.withPackages (ps: with ps; [ - boto3 - docker - pytest - pytest-testinfra - requests - ec2instanceconnectcli - paramiko - ]); - sfcgal = pkgs.callPackage ./nix/ext/sfcgal/sfcgal.nix { }; - supabase-groonga = pkgs.callPackage ./nix/supabase-groonga.nix { }; - mecab-naist-jdic = pkgs.callPackage ./nix/ext/mecab-naist-jdic/default.nix { }; - inherit (pkgs.callPackage ./nix/wal-g.nix { }) wal-g-2 wal-g-3; - # Our list of PostgreSQL extensions which come from upstream Nixpkgs. - # These are maintained upstream and can easily be used here just by - # listing their name. Anytime the version of nixpkgs is upgraded, these - # may also bring in new versions of the extensions. - psqlExtensions = [ - /* pljava */ - /*"postgis"*/ - ]; - - #FIXME for now, timescaledb is not included in the orioledb version of supabase extensions, as there is an issue - # with building timescaledb with the orioledb patched version of postgresql - orioledbPsqlExtensions = [ - /* pljava */ - /*"timescaledb"*/ - ]; - - # Custom extensions that exist in our repository. These aren't upstream - # either because nobody has done the work, maintaining them here is - # easier and more expedient, or because they may not be suitable, or are - # too niche/one-off. - # - # Ideally, most of these should have copies upstream for third party - # use, but even if they did, keeping our own copies means that we can - # rollout new versions of these critical things easier without having to - # go through the upstream release engineering process. - ourExtensions = [ - ./nix/ext/rum.nix - ./nix/ext/timescaledb.nix - ./nix/ext/timescaledb-2.9.1.nix - ./nix/ext/pgroonga.nix - ./nix/ext/index_advisor.nix - ./nix/ext/wal2json.nix - ./nix/ext/pgmq.nix - ./nix/ext/pg_repack.nix - ./nix/ext/pg-safeupdate.nix - ./nix/ext/plpgsql-check.nix - ./nix/ext/pgjwt.nix - ./nix/ext/pgaudit.nix - ./nix/ext/postgis.nix - ./nix/ext/pgrouting.nix - ./nix/ext/pgtap.nix - ./nix/ext/pg_cron.nix - ./nix/ext/pgsql-http.nix - ./nix/ext/pg_plan_filter.nix - ./nix/ext/pg_net.nix - ./nix/ext/pg_hashids.nix - ./nix/ext/pgsodium.nix - ./nix/ext/pg_graphql.nix - ./nix/ext/pg_stat_monitor.nix - ./nix/ext/pg_jsonschema.nix - ./nix/ext/pgvector.nix - ./nix/ext/vault.nix - ./nix/ext/hypopg.nix - ./nix/ext/pg_tle.nix - ./nix/ext/wrappers/default.nix - ./nix/ext/supautils.nix - ./nix/ext/plv8.nix - ]; - - #Where we import and build the orioledb extension, we add on our custom extensions - # plus the orioledb option - #we're not using timescaledb or plv8 in the orioledb-17 version or pg 17 of supabase extensions - orioleFilteredExtensions = builtins.filter - ( - x: - x != ./nix/ext/timescaledb.nix && - x != ./nix/ext/timescaledb-2.9.1.nix && - x != ./nix/ext/plv8.nix - ) ourExtensions; - - orioledbExtensions = orioleFilteredExtensions ++ [ ./nix/ext/orioledb.nix ]; - dbExtensions17 = orioleFilteredExtensions; - getPostgresqlPackage = version: - pkgs.postgresql."postgresql_${version}"; - # Create a 'receipt' file for a given postgresql package. This is a way - # of adding a bit of metadata to the package, which can be used by other - # tools to inspect what the contents of the install are: the PSQL - # version, the installed extensions, et cetera. - # - # This takes two arguments: - # - pgbin: the postgresql package we are building on top of - # not a list of packages, but an attrset containing extension names - # mapped to versions. - # - ourExts: the list of extensions from upstream nixpkgs. This is not - # a list of packages, but an attrset containing extension names - # mapped to versions. - # - # The output is a package containing the receipt.json file, which can be - # merged with the PostgreSQL installation using 'symlinkJoin'. - makeReceipt = pgbin: ourExts: pkgs.writeTextFile { - name = "receipt"; - destination = "/receipt.json"; - text = builtins.toJSON { - revision = gitRev; - psql-version = pgbin.version; - nixpkgs = { - revision = nixpkgs.rev; - }; - extensions = ourExts; - - # NOTE this field can be used to do cache busting (e.g. - # force a rebuild of the psql packages) but also to helpfully inform - # tools what version of the schema is being used, for forwards and - # backwards compatibility - receipt-version = "1"; - }; - }; - - makeOurPostgresPkgs = version: - let - postgresql = getPostgresqlPackage version; - extensionsToUse = - if (builtins.elem version [ "orioledb-17" ]) - then orioledbExtensions - else if (builtins.elem version [ "17" ]) - then dbExtensions17 - else ourExtensions; - in - map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; - - # Create an attrset that contains all the extensions included in a server. - makeOurPostgresPkgsSet = version: - (builtins.listToAttrs (map - (drv: - { name = drv.pname; value = drv; } - ) - (makeOurPostgresPkgs version))) - // { recurseForDerivations = true; }; - - - # Create a binary distribution of PostgreSQL, given a version. - # - # NOTE: The version here does NOT refer to the exact PostgreSQL version; - # it refers to the *major number only*, which is used to select the - # correct version of the package from nixpkgs. This is because we want - # to be able to do so in an open ended way. As an example, the version - # "15" passed in will use the nixpkgs package "postgresql_15" as the - # basis for building extensions, etc. - makePostgresBin = version: - let - postgresql = getPostgresqlPackage version; - ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurPostgresPkgs version); - - pgbin = postgresql.withPackages (ps: - makeOurPostgresPkgs version - ); - in - pkgs.symlinkJoin { - inherit (pgbin) name version; - paths = [ pgbin (makeReceipt pgbin ourExts) ]; - }; - - # Create an attribute set, containing all the relevant packages for a - # PostgreSQL install, wrapped up with a bow on top. There are three - # packages: - # - # - bin: the postgresql package itself, with all the extensions - # installed, and a receipt.json file containing metadata about the - # install. - # - exts: an attrset containing all the extensions, mapped to their - # package names. - makePostgres = version: rec { - bin = makePostgresBin version; - exts = makeOurPostgresPkgsSet version; - recurseForDerivations = true; - }; - - makePostgresDevSetup = { pkgs, name, extraSubstitutions ? { } }: - let - paths = { - migrationsDir = builtins.path { - name = "migrations"; - path = ./migrations/db; - }; - postgresqlSchemaSql = builtins.path { - name = "postgresql-schema"; - path = ./nix/tools/postgresql_schema.sql; - }; - pgbouncerAuthSchemaSql = builtins.path { - name = "pgbouncer-auth-schema"; - path = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - }; - statExtensionSql = builtins.path { - name = "stat-extension"; - path = ./ansible/files/stat_extension.sql; - }; - pgconfigFile = builtins.path { - name = "postgresql.conf"; - path = ./ansible/files/postgresql_config/postgresql.conf.j2; - }; - supautilsConfigFile = builtins.path { - name = "supautils.conf"; - path = ./ansible/files/postgresql_config/supautils.conf.j2; - }; - loggingConfigFile = builtins.path { - name = "logging.conf"; - path = ./ansible/files/postgresql_config/postgresql-csvlog.conf; - }; - readReplicaConfigFile = builtins.path { - name = "readreplica.conf"; - path = ./ansible/files/postgresql_config/custom_read_replica.conf.j2; - }; - pgHbaConfigFile = builtins.path { - name = "pg_hba.conf"; - path = ./ansible/files/postgresql_config/pg_hba.conf.j2; - }; - pgIdentConfigFile = builtins.path { - name = "pg_ident.conf"; - path = ./ansible/files/postgresql_config/pg_ident.conf.j2; - }; - postgresqlExtensionCustomScriptsPath = builtins.path { - name = "extension-custom-scripts"; - path = ./ansible/files/postgresql_extension_custom_scripts; - }; - getkeyScript = builtins.path { - name = "pgsodium_getkey.sh"; - path = ./nix/tests/util/pgsodium_getkey.sh; - }; - }; - - localeArchive = - if pkgs.stdenv.isDarwin - then "${pkgs.darwin.locale}/share/locale" - else "${pkgs.glibcLocales}/lib/locale/locale-archive"; - - substitutions = { - SHELL_PATH = "${pkgs.bash}/bin/bash"; - PGSQL_DEFAULT_PORT = "${pgsqlDefaultPort}"; - PGSQL_SUPERUSER = "${pgsqlSuperuser}"; - PSQL15_BINDIR = "${basePackages.psql_15.bin}"; - PSQL17_BINDIR = "${basePackages.psql_17.bin}"; - PSQL_CONF_FILE = "${paths.pgconfigFile}"; - PSQLORIOLEDB17_BINDIR = "${basePackages.psql_orioledb-17.bin}"; - PGSODIUM_GETKEY = "${paths.getkeyScript}"; - READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; - LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; - SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; - PG_HBA = "${paths.pgHbaConfigFile}"; - PG_IDENT = "${paths.pgIdentConfigFile}"; - LOCALES = "${localeArchive}"; - EXTENSION_CUSTOM_SCRIPTS_DIR = "${paths.postgresqlExtensionCustomScriptsPath}"; - MECAB_LIB = "${basePackages.psql_15.exts.pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so"; - GROONGA_DIR = "${supabase-groonga}"; - MIGRATIONS_DIR = "${paths.migrationsDir}"; - POSTGRESQL_SCHEMA_SQL = "${paths.postgresqlSchemaSql}"; - PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; - STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; - CURRENT_SYSTEM = "${system}"; - } // extraSubstitutions; # Merge in any extra substitutions - in - pkgs.runCommand name - { - inherit (paths) migrationsDir postgresqlSchemaSql pgbouncerAuthSchemaSql statExtensionSql; - } '' - mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts - - # Copy config files with error handling - cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } - cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } - cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } - cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } - cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } - cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } - cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } - - echo "Copy operation completed" - chmod 644 $out/etc/postgresql-custom/supautils.conf - chmod 644 $out/etc/postgresql/postgresql.conf - chmod 644 $out/etc/postgresql-custom/logging.conf - chmod 644 $out/etc/postgresql/pg_hba.conf - - substitute ${./nix/tools/run-server.sh.in} $out/bin/start-postgres-server \ - ${builtins.concatStringsSep " " (builtins.attrValues (builtins.mapAttrs - (name: value: "--subst-var-by '${name}' '${value}'") - substitutions - ))} - chmod +x $out/bin/start-postgres-server - ''; - - # The base set of packages that we export from this Nix Flake, that can - # be used with 'nix build'. Don't use the names listed below; check the - # name in 'nix flake show' in order to make sure exactly what name you - # want. - basePackages = - let - # Function to get the PostgreSQL version from the attribute name - getVersion = name: - let - match = builtins.match "psql_([0-9]+)" name; - in - if match == null then null else builtins.head match; - - # Define the available PostgreSQL versions - postgresVersions = { - psql_15 = makePostgres "15"; - psql_17 = makePostgres "17"; - psql_orioledb-17 = makePostgres "orioledb-17"; - }; - - # Find the active PostgreSQL version - activeVersion = getVersion (builtins.head (builtins.attrNames postgresVersions)); - - # Function to create the pg_regress package - makePgRegress = version: - let - postgresqlPackage = pkgs."postgresql_${version}"; - in - pkgs.callPackage ./nix/ext/pg_regress.nix { - postgresql = postgresqlPackage; - }; - postgresql_15 = getPostgresqlPackage "15"; - postgresql_17 = getPostgresqlPackage "17"; - postgresql_orioledb-17 = getPostgresqlPackage "orioledb-17"; - in - postgresVersions // { - supabase-groonga = supabase-groonga; - cargo-pgrx_0_11_3 = pkgs.cargo-pgrx.cargo-pgrx_0_11_3; - cargo-pgrx_0_12_6 = pkgs.cargo-pgrx.cargo-pgrx_0_12_6; - cargo-pgrx_0_12_9 = pkgs.cargo-pgrx.cargo-pgrx_0_12_9; - cargo-pgrx_0_14_3 = pkgs.cargo-pgrx.cargo-pgrx_0_14_3; - # PostgreSQL versions. - psql_15 = postgresVersions.psql_15; - psql_17 = postgresVersions.psql_17; - psql_orioledb-17 = postgresVersions.psql_orioledb-17; - wal-g-2 = wal-g-2; - wal-g-3 = wal-g-3; - sfcgal = sfcgal; - pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - inherit postgresql_15 postgresql_17 postgresql_orioledb-17; - postgresql_15_debug = if pkgs.stdenv.isLinux then postgresql_15.debug else null; - postgresql_17_debug = if pkgs.stdenv.isLinux then postgresql_17.debug else null; - postgresql_orioledb-17_debug = if pkgs.stdenv.isLinux then postgresql_orioledb-17.debug else null; - postgresql_15_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-15-src"; - version = postgresql_15.version; - - src = postgresql_15.src; - - nativeBuildInputs = [ pkgs.bzip2 ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out - cp -r . $out - ''; - - meta = with pkgs.lib; { - description = "PostgreSQL 15 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; - }; - }; - postgresql_17_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-17-src"; - version = postgresql_17.version; - src = postgresql_17.src; - - nativeBuildInputs = [ pkgs.bzip2 ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out - cp -r . $out - ''; - meta = with pkgs.lib; { - description = "PostgreSQL 17 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; - }; - }; - postgresql_orioledb-17_src = pkgs.stdenv.mkDerivation { - pname = "postgresql-17-src"; - version = postgresql_orioledb-17.version; - - src = postgresql_orioledb-17.src; - - nativeBuildInputs = [ pkgs.bzip2 ]; - - phases = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out - cp -r . $out - ''; - - meta = with pkgs.lib; { - description = "PostgreSQL 15 source files"; - homepage = "https://www.postgresql.org/"; - license = licenses.postgresql; - platforms = platforms.all; - }; - }; - mecab_naist_jdic = mecab-naist-jdic; - supabase_groonga = supabase-groonga; - pg_regress = makePgRegress activeVersion; - # Start a version of the server. - start-server = makePostgresDevSetup { - inherit pkgs; - name = "start-postgres-server"; - }; - - # Start a version of the client and runs migrations script on server. - start-client = - let - migrationsDir = ./migrations/db; - postgresqlSchemaSql = ./nix/tools/postgresql_schema.sql; - pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - statExtensionSql = ./ansible/files/stat_extension.sql; - in - pkgs.runCommand "start-postgres-client" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/run-client.sh.in} $out/bin/start-postgres-client \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL17_BINDIR' '${basePackages.psql_17.bin}' \ - --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${basePackages.psql_orioledb-17.bin}' \ - --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ - --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ - --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ - --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' - chmod +x $out/bin/start-postgres-client - ''; - - # Migrate between two data directories. - migrate-tool = - let - configFile = ./nix/tests/postgresql.conf.in; - getkeyScript = ./nix/tests/util/pgsodium_getkey.sh; - primingScript = ./nix/tests/prime.sql; - migrationData = ./nix/tests/migrations/data.sql; - in - pkgs.runCommand "migrate-postgres" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/migrate-tool.sh.in} $out/bin/migrate-postgres \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' \ - --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ - --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ - --subst-var-by 'PRIMING_SCRIPT' '${primingScript}' \ - --subst-var-by 'MIGRATION_DATA' '${migrationData}' - - chmod +x $out/bin/migrate-postgres - ''; - - start-replica = pkgs.runCommand "start-postgres-replica" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/run-replica.sh.in} $out/bin/start-postgres-replica \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'PSQL15_BINDIR' '${basePackages.psql_15.bin}' - chmod +x $out/bin/start-postgres-replica - ''; - pg-restore = - pkgs.runCommand "run-pg-restore" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/run-restore.sh.in} $out/bin/pg-restore \ - --subst-var-by PSQL15_BINDIR '${basePackages.psql_15.bin}' - chmod +x $out/bin/pg-restore - ''; - sync-exts-versions = pkgs.runCommand "sync-exts-versions" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ - --subst-var-by 'YQ' '${pkgs.yq}/bin/yq' \ - --subst-var-by 'JQ' '${pkgs.jq}/bin/jq' \ - --subst-var-by 'NIX_EDITOR' '${nix-editor.packages.${system}.nix-editor}/bin/nix-editor' \ - --subst-var-by 'NIXPREFETCHURL' '${pkgs.nixVersions.nix_2_20}/bin/nix-prefetch-url' \ - --subst-var-by 'NIX' '${pkgs.nixVersions.nix_2_20}/bin/nix' - chmod +x $out/bin/sync-exts-versions - ''; - - local-infra-bootstrap = pkgs.runCommand "local-infra-bootstrap" { } '' - mkdir -p $out/bin - substitute ${./nix/tools/local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap - chmod +x $out/bin/local-infra-bootstrap - ''; - dbmate-tool = - let - migrationsDir = ./migrations/db; - ansibleVars = ./ansible/vars.yml; - pgbouncerAuthSchemaSql = ./ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; - statExtensionSql = ./ansible/files/stat_extension.sql; - in - pkgs.runCommand "dbmate-tool" - { - buildInputs = with pkgs; [ - overmind - dbmate - nix - jq - yq - ]; - nativeBuildInputs = with pkgs; [ - makeWrapper - ]; - } '' - mkdir -p $out/bin $out/migrations - cp -r ${migrationsDir}/* $out - substitute ${./nix/tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ - --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ - --subst-var-by 'MIGRATIONS_DIR' $out \ - --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ - --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ - --subst-var-by 'CURRENT_SYSTEM' '${system}' \ - --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ - --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' - chmod +x $out/bin/dbmate-tool - wrapProgram $out/bin/dbmate-tool \ - --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]} - ''; - show-commands = pkgs.runCommand "show-commands" - { - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ pkgs.nushell ]; - } '' - mkdir -p $out/bin - cat > $out/bin/show-commands << 'EOF' - #!${pkgs.nushell}/bin/nu - let json_output = (nix flake show --json --quiet --all-systems | from json) - let apps = ($json_output | get apps.${system}) - $apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" } - EOF - chmod +x $out/bin/show-commands - wrapProgram $out/bin/show-commands \ - --prefix PATH : ${pkgs.nushell}/bin - ''; - update-readme = pkgs.runCommand "update-readme" - { - nativeBuildInputs = [ pkgs.makeWrapper ]; - buildInputs = [ pkgs.nushell ]; - } '' - mkdir -p $out/bin - cp ${./nix/tools/update_readme.nu} $out/bin/update-readme - chmod +x $out/bin/update-readme - wrapProgram $out/bin/update-readme \ - --prefix PATH : ${pkgs.nushell}/bin - ''; - # Script to run the AMI build and tests locally - build-test-ami = pkgs.runCommand "build-test-ami" - { - buildInputs = with pkgs; [ - packer - awscli2 - yq - jq - openssl - git - coreutils - aws-vault - ]; - } '' - mkdir -p $out/bin - cat > $out/bin/build-test-ami << 'EOL' - #!/usr/bin/env bash - set -euo pipefail - - show_help() { - cat << EOF - Usage: build-test-ami [--help] - - Build AMI images for PostgreSQL testing. - - This script will: - 1. Check for required tools and AWS authentication - 2. Build two AMI stages using Packer - 3. Clean up any temporary instances - 4. Output the final AMI name for use with run-testinfra - - Arguments: - postgres-version PostgreSQL major version to build (required) - - Options: - --help Show this help message and exit - - Requirements: - - AWS Vault profile must be set in AWS_VAULT environment variable - - Packer, AWS CLI, yq, jq, and OpenSSL must be installed - - Must be run from a git repository - - Example: - aws-vault exec -- nix run .#build-test-ami 15 - EOF - } - - # Handle help flag - if [[ "$#" -gt 0 && "$1" == "--help" ]]; then - show_help - exit 0 - fi - - export PATH="${pkgs.lib.makeBinPath (with pkgs; [ - packer - awscli2 - yq - jq - openssl - git - coreutils - aws-vault - ])}:$PATH" - - # Check for required tools - for cmd in packer aws-vault yq jq openssl; do - if ! command -v $cmd &> /dev/null; then - echo "Error: $cmd is required but not found" - exit 1 - fi - done - - # Check AWS Vault profile - if [ -z "''${AWS_VAULT:-}" ]; then - echo "Error: AWS_VAULT environment variable must be set with the profile name" - echo "Usage: aws-vault exec -- nix run .#build-test-ami " - exit 1 - fi - - # Set values - REGION="ap-southeast-1" - POSTGRES_VERSION="$1" - RANDOM_STRING=$(openssl rand -hex 8) - GIT_SHA=$(git rev-parse HEAD) - RUN_ID=$(date +%s) - - # Generate common-nix.vars.pkr.hcl - PG_VERSION=$(yq -r ".postgres_release[\"postgres$POSTGRES_VERSION\"]" ansible/vars.yml) - echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl - - # Build AMI Stage 1 - packer init amazon-arm64-nix.pkr.hcl - packer build \ - -var "git-head-version=$GIT_SHA" \ - -var "packer-execution-id=$RUN_ID" \ - -var-file="development-arm.vars.pkr.hcl" \ - -var-file="common-nix.vars.pkr.hcl" \ - -var "ansible_arguments=" \ - -var "postgres-version=$RANDOM_STRING" \ - -var "region=$REGION" \ - -var 'ami_regions=["'"$REGION"'"]' \ - -var "force-deregister=true" \ - -var "ansible_arguments=-e postgresql_major=$POSTGRES_VERSION" \ - amazon-arm64-nix.pkr.hcl - - # Build AMI Stage 2 - packer init stage2-nix-psql.pkr.hcl - packer build \ - -var "git-head-version=$GIT_SHA" \ - -var "packer-execution-id=$RUN_ID" \ - -var "postgres_major_version=$POSTGRES_VERSION" \ - -var-file="development-arm.vars.pkr.hcl" \ - -var-file="common-nix.vars.pkr.hcl" \ - -var "postgres-version=$RANDOM_STRING" \ - -var "region=$REGION" \ - -var 'ami_regions=["'"$REGION"'"]' \ - -var "force-deregister=true" \ - -var "git_sha=$GIT_SHA" \ - stage2-nix-psql.pkr.hcl - - # Cleanup instances from AMI builds - cleanup_instances() { - echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." - aws ec2 --region $REGION describe-instances \ - --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ - --query "Reservations[].Instances[].InstanceId" \ - --output text | xargs -r aws ec2 terminate-instances \ - --region $REGION --instance-ids || true - } - - # Set up traps for various signals to ensure cleanup - trap cleanup_instances EXIT HUP INT QUIT TERM - - # Create and activate virtual environment - VENV_DIR=$(mktemp -d) - trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM - python3 -m venv "$VENV_DIR" - source "$VENV_DIR/bin/activate" - - # Install required Python packages - echo "Installing required Python packages..." - pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests - - # Run the tests with aws-vault - echo "Running tests for AMI: $RANDOM_STRING using AWS Vault profile: $AWS_VAULT_PROFILE" - aws-vault exec $AWS_VAULT_PROFILE -- pytest -vv -s testinfra/test_ami_nix.py - - # Deactivate virtual environment (cleanup is handled by trap) - deactivate - EOL - chmod +x $out/bin/build-test-ami - ''; - - run-testinfra = pkgs.runCommand "run-testinfra" - { - buildInputs = with pkgs; [ - aws-vault - python3 - python3Packages.pip - coreutils - ]; - } '' - mkdir -p $out/bin - cat > $out/bin/run-testinfra << 'EOL' - #!/usr/bin/env bash - set -euo pipefail - - show_help() { - cat << EOF - Usage: run-testinfra --ami-name NAME [--aws-vault-profile PROFILE] - - Run the testinfra tests locally against a specific AMI. - - This script will: - 1. Check if aws-vault is installed and configured - 2. Set up the required environment variables - 3. Create and activate a virtual environment - 4. Install required Python packages from pip - 5. Run the tests with aws-vault credentials - 6. Clean up the virtual environment - - Required flags: - --ami-name NAME The name of the AMI to test - - Optional flags: - --aws-vault-profile PROFILE AWS Vault profile to use (default: staging) - --help Show this help message and exit - Requirements: - - aws-vault installed and configured - - Python 3 with pip - - Must be run from the repository root - - Examples: - run-testinfra --ami-name supabase-postgres-abc123 - run-testinfra --ami-name supabase-postgres-abc123 --aws-vault-profile production - EOF - } - - # Default values - AWS_VAULT_PROFILE="staging" - AMI_NAME="" - - # Parse arguments - while [[ $# -gt 0 ]]; do - case $1 in - --aws-vault-profile) - AWS_VAULT_PROFILE="$2" - shift 2 - ;; - --ami-name) - AMI_NAME="$2" - shift 2 - ;; - --help) - show_help - exit 0 - ;; - *) - echo "Error: Unexpected argument: $1" - show_help - exit 1 - ;; - esac - done - - # Check for required tools - if ! command -v aws-vault &> /dev/null; then - echo "Error: aws-vault is required but not found" - exit 1 - fi - - # Check for AMI name argument - if [ -z "$AMI_NAME" ]; then - echo "Error: --ami-name is required" - show_help - exit 1 - fi - - # Set environment variables - export AWS_REGION="ap-southeast-1" - export AWS_DEFAULT_REGION="ap-southeast-1" - export AMI_NAME="$AMI_NAME" # Export AMI_NAME for pytest - export RUN_ID="local-$(date +%s)" # Generate a unique RUN_ID - - # Function to terminate EC2 instances - terminate_instances() { - echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." - aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 --region ap-southeast-1 describe-instances \ - --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ - --query "Reservations[].Instances[].InstanceId" \ - --output text | xargs -r aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 terminate-instances \ - --region ap-southeast-1 --instance-ids || true - } - - # Set up traps for various signals to ensure cleanup - trap terminate_instances EXIT HUP INT QUIT TERM - - # Create and activate virtual environment - VENV_DIR=$(mktemp -d) - trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM - python3 -m venv "$VENV_DIR" - source "$VENV_DIR/bin/activate" - - # Install required Python packages - echo "Installing required Python packages..." - pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests - - # Function to run tests and ensure cleanup - run_tests() { - local exit_code=0 - echo "Running tests for AMI: $AMI_NAME using AWS Vault profile: $AWS_VAULT_PROFILE" - aws-vault exec "$AWS_VAULT_PROFILE" -- pytest -vv -s testinfra/test_ami_nix.py || exit_code=$? - return $exit_code - } - - # Run tests and capture exit code - run_tests - test_exit_code=$? - - # Deactivate virtual environment - deactivate - - # Explicitly call cleanup - terminate_instances - - # Exit with the test exit code - exit $test_exit_code - EOL - chmod +x $out/bin/run-testinfra - ''; - - cleanup-ami = pkgs.runCommand "cleanup-ami" - { - buildInputs = with pkgs; [ - awscli2 - aws-vault - ]; - } '' - mkdir -p $out/bin - cat > $out/bin/cleanup-ami << 'EOL' - #!/usr/bin/env bash - set -euo pipefail - - export PATH="${pkgs.lib.makeBinPath (with pkgs; [ - awscli2 - aws-vault - ])}:$PATH" - - # Check for required tools - for cmd in aws-vault; do - if ! command -v $cmd &> /dev/null; then - echo "Error: $cmd is required but not found" - exit 1 - fi - done - - # Check AWS Vault profile - if [ -z "''${AWS_VAULT:-}" ]; then - echo "Error: AWS_VAULT environment variable must be set with the profile name" - echo "Usage: aws-vault exec -- nix run .#cleanup-ami " - exit 1 - fi - - # Check for AMI name argument - if [ -z "''${1:-}" ]; then - echo "Error: AMI name must be provided" - echo "Usage: aws-vault exec -- nix run .#cleanup-ami " - exit 1 - fi - - AMI_NAME="$1" - REGION="ap-southeast-1" - - # Deregister AMIs - for AMI_PATTERN in "supabase-postgres-ci-ami-test-stage-1" "$AMI_NAME"; do - aws ec2 describe-images --region $REGION --owners self \ - --filters "Name=name,Values=$AMI_PATTERN" \ - --query 'Images[*].ImageId' --output text | while read -r ami_id; do - echo "Deregistering AMI: $ami_id" - aws ec2 deregister-image --region $REGION --image-id "$ami_id" || true - done - done - EOL - chmod +x $out/bin/cleanup-ami - ''; - - trigger-nix-build = pkgs.runCommand "trigger-nix-build" - { - buildInputs = with pkgs; [ - gh - git - coreutils - ]; - } '' - mkdir -p $out/bin - cat > $out/bin/trigger-nix-build << 'EOL' - #!/usr/bin/env bash - set -euo pipefail - - show_help() { - cat << EOF - Usage: trigger-nix-build [--help] - - Trigger the nix-build workflow for the current branch and watch its progress. - - This script will: - 1. Check if you're authenticated with GitHub - 2. Get the current branch and commit - 3. Verify you're on a standard branch (develop or release/*) or prompt for confirmation - 4. Trigger the nix-build workflow - 5. Watch the workflow progress until completion - - Options: - --help Show this help message and exit - - Requirements: - - GitHub CLI (gh) installed and authenticated - - Git installed - - Must be run from a git repository - - Example: - trigger-nix-build - EOF - } - - # Handle help flag - if [[ "$#" -gt 0 && "$1" == "--help" ]]; then - show_help - exit 0 - fi - - export PATH="${pkgs.lib.makeBinPath (with pkgs; [ - gh - git - coreutils - ])}:$PATH" - - # Check for required tools - for cmd in gh git; do - if ! command -v $cmd &> /dev/null; then - echo "Error: $cmd is required but not found" - exit 1 - fi - done - - # Check if user is authenticated with GitHub - if ! gh auth status &>/dev/null; then - echo "Error: Not authenticated with GitHub. Please run 'gh auth login' first." - exit 1 - fi - - # Get current branch and commit - BRANCH=$(git rev-parse --abbrev-ref HEAD) - COMMIT=$(git rev-parse HEAD) - - # Check if we're on a standard branch - if [[ "$BRANCH" != "develop" && ! "$BRANCH" =~ ^release/ ]]; then - echo "Warning: Running workflow from non-standard branch: $BRANCH" - echo "This is supported for testing purposes." - read -p "Continue? [y/N] " -n 1 -r - echo - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo "Aborted." - exit 1 - fi - fi - - # Trigger the workflow - echo "Triggering nix-build workflow for branch $BRANCH (commit: $COMMIT)" - gh workflow run nix-build.yml --ref "$BRANCH" - - # Wait for workflow to start and get the run ID - echo "Waiting for workflow to start..." - sleep 5 - - # Get the latest run ID for this workflow - RUN_ID=$(gh run list --workflow=nix-build.yml --limit 1 --json databaseId --jq '.[0].databaseId') - - if [ -z "$RUN_ID" ]; then - echo "Error: Could not find workflow run ID" - exit 1 - fi - - echo "Watching workflow run $RUN_ID..." - echo "The script will automatically exit when the workflow completes." - echo "Press Ctrl+C to stop watching (workflow will continue running)" - echo "----------------------------------------" - - # Try to watch the run, but handle network errors gracefully - while true; do - if gh run watch "$RUN_ID" --exit-status; then - break - else - echo "Network error while watching workflow. Retrying in 5 seconds..." - echo "You can also check the status manually with: gh run view $RUN_ID" - sleep 5 - fi - done - EOL - chmod +x $out/bin/trigger-nix-build - ''; - }; - - - # Create a testing harness for a PostgreSQL package. This is used for - # 'nix flake check', and works with any PostgreSQL package you hand it. - - makeCheckHarness = pgpkg: - let - sqlTests = ./nix/tests/smoke; - pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - pg_regress = basePackages.pg_regress; - getkey-script = pkgs.stdenv.mkDerivation { - name = "pgsodium-getkey"; - buildCommand = '' - mkdir -p $out/bin - cat > $out/bin/pgsodium-getkey << 'EOF' - #!${pkgs.bash}/bin/bash - set -euo pipefail - - TMPDIR_BASE=$(mktemp -d) - - KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" - KEY_FILE="$KEY_DIR/pgsodium.key" - - if ! mkdir -p "$KEY_DIR" 2>/dev/null; then - echo "Error: Could not create key directory $KEY_DIR" >&2 - exit 1 - fi - chmod 1777 "$KEY_DIR" - - if [[ ! -f "$KEY_FILE" ]]; then - if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then - if ! (openssl rand -hex 32 > "$KEY_FILE"); then - echo "00000000000000000000000000000000" > "$KEY_FILE" - echo "Warning: Using fallback key" >&2 - fi - fi - chmod 644 "$KEY_FILE" - fi - - if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then - cat "$KEY_FILE" - else - echo "Error: Cannot read key file $KEY_FILE" >&2 - exit 1 - fi - EOF - chmod +x $out/bin/pgsodium-getkey - ''; - }; - - # Use the shared setup but with a test-specific name - start-postgres-server-bin = makePostgresDevSetup { - inherit pkgs; - name = "start-postgres-server-test"; - extraSubstitutions = { - PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey"; - PGSQL_DEFAULT_PORT = pgPort; - }; - }; - - getVersionArg = pkg: - let - name = pkg.version; - in - if builtins.match "15.*" name != null then "15" - else if builtins.match "17.*" name != null then "17" - else if builtins.match "orioledb-17.*" name != null then "orioledb-17" - else throw "Unsupported PostgreSQL version: ${name}"; - - # Helper function to filter SQL files based on version - filterTestFiles = version: dir: - let - files = builtins.readDir dir; - isValidFile = name: - let - isVersionSpecific = builtins.match "z_.*" name != null; - matchesVersion = - if isVersionSpecific - then - if version == "orioledb-17" - then builtins.match "z_orioledb-17_.*" name != null - else if version == "17" - then builtins.match "z_17_.*" name != null - else builtins.match "z_15_.*" name != null - else true; - in - pkgs.lib.hasSuffix ".sql" name && matchesVersion; - in - pkgs.lib.filterAttrs (name: _: isValidFile name) files; - - # Get the major version for filtering - majorVersion = - let - version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version; - _ = builtins.trace "Entering majorVersion logic"; - isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null; - isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null; - result = - if isOrioledbMatch - then "orioledb-17" - else if isSeventeenMatch - then "17" - else "15"; - in - builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8" - - # Filter SQL test files - filteredSqlTests = filterTestFiles majorVersion ./nix/tests/sql; - - pgPort = if (majorVersion == "17") then - "5535" - else if (majorVersion == "15") then - "5536" - else "5537"; - - # Convert filtered tests to a sorted list of basenames (without extension) - testList = pkgs.lib.mapAttrsToList - (name: _: - builtins.substring 0 (pkgs.lib.stringLength name - 4) name - ) - filteredSqlTests; - sortedTestList = builtins.sort (a: b: a < b) testList; - - in - pkgs.runCommand "postgres-${pgpkg.version}-check-harness" - { - nativeBuildInputs = with pkgs; [ - coreutils - bash - perl - pgpkg - pg_prove - pg_regress - procps - start-postgres-server-bin - which - getkey-script - supabase-groonga - ]; - } '' - set -e - - #First we need to create a generic pg cluster for pgtap tests and run those - export GRN_PLUGINS_DIR=${supabase-groonga}/lib/groonga/plugins - PGTAP_CLUSTER=$(mktemp -d) - initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" - substitute ${./nix/tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ - --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" - echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "port = ${pgPort}" >> "$PGTAP_CLUSTER"/postgresql.conf - echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf - echo "Checking shared_preload_libraries setting:" - grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf - # Remove timescaledb if running orioledb-17 check - echo "I AM ${pgpkg.version}====================================================" - if [[ "${pgpkg.version}" == *"17"* ]]; then - perl -pi -e 's/ timescaledb,//g' "$PGTAP_CLUSTER/postgresql.conf" - fi - #NOTE in the future we may also need to add the orioledb extension to the cluster when cluster is oriole - echo "PGTAP_CLUSTER directory contents:" - ls -la "$PGTAP_CLUSTER" - - # Check if postgresql.conf exists - if [ ! -f "$PGTAP_CLUSTER/postgresql.conf" ]; then - echo "postgresql.conf is missing!" - exit 1 - fi - - # PostgreSQL startup - if [[ "$(uname)" == "Darwin" ]]; then - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgPort} -d 5" start 2>&1 - else - mkdir -p "$PGTAP_CLUSTER/sockets" - pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgPort} -d 5" start 2>&1 - fi || { - echo "pg_ctl failed to start PostgreSQL" - echo "Contents of postgresql.log:" - cat "$PGTAP_CLUSTER"/postgresql.log - exit 1 - } - for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort}; then - echo "PostgreSQL is ready" - break - fi - sleep 1 - if [ $i -eq 60 ]; then - echo "PostgreSQL is not ready after 60 seconds" - echo "PostgreSQL status:" - pg_ctl -D "$PGTAP_CLUSTER" status - echo "PostgreSQL log content:" - cat "$PGTAP_CLUSTER"/postgresql.log - exit 1 - fi - done - createdb -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin testing - if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then - echo "Error executing SQL file. PostgreSQL log content:" - cat "$PGTAP_CLUSTER"/postgresql.log - pg_ctl -D "$PGTAP_CLUSTER" stop - exit 1 - fi - SORTED_DIR=$(mktemp -d) - for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do - psql -p ${pgPort} -h ${pgsqlDefaultHost} --username=supabase_admin -d testing -f "${./nix/tests/sql}/$t.sql" || true - done - rm -rf "$SORTED_DIR" - pg_ctl -D "$PGTAP_CLUSTER" stop - rm -rf $PGTAP_CLUSTER - - # End of pgtap tests - # from here on out we are running pg_regress tests, we use a different cluster for this - # which is start by the start-postgres-server-bin script - # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations - - unset GRN_PLUGINS_DIR - ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize - - for i in {1..60}; do - if pg_isready -h ${pgsqlDefaultHost} -p ${pgPort} -U supabase_admin -q; then - echo "PostgreSQL is ready" - break - fi - sleep 1 - if [ $i -eq 60 ]; then - echo "PostgreSQL failed to start" - exit 1 - fi - done - - if ! psql -p ${pgPort} -h ${pgsqlDefaultHost} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xf ${./nix/tests/prime.sql}; then - echo "Error executing SQL file" - exit 1 - fi - - mkdir -p $out/regression_output - if ! pg_regress \ - --use-existing \ - --dbname=postgres \ - --inputdir=${./nix/tests} \ - --outputdir=$out/regression_output \ - --host=${pgsqlDefaultHost} \ - --port=${pgPort} \ - --user=supabase_admin \ - ${builtins.concatStringsSep " " sortedTestList}; then - echo "pg_regress tests failed" - cat $out/regression_output/regression.diffs - exit 1 - fi - - echo "Running migrations tests" - pg_prove -p ${pgPort} -U supabase_admin -h ${pgsqlDefaultHost} -d postgres -v ${./migrations/tests}/test.sql - - # Copy logs to output - for logfile in $(find /tmp -name postgresql.log -type f); do - cp "$logfile" $out/postgresql.log - done - exit 0 - ''; - in - rec { - # The list of all packages that can be built with 'nix build'. The list - # of names that can be used can be shown with 'nix flake show' - packages = flake-utils.lib.flattenTree basePackages // { - # Any extra packages we might want to include in our package - # set can go here. - inherit (pkgs); - }; - - # The list of exported 'checks' that are run with every run of 'nix - # flake check'. This is run in the CI system, as well. - checks = { - psql_15 = makeCheckHarness basePackages.psql_15.bin; - psql_17 = makeCheckHarness basePackages.psql_17.bin; - psql_orioledb-17 = makeCheckHarness basePackages.psql_orioledb-17.bin; - inherit (basePackages) wal-g-2 wal-g-3 dbmate-tool pg_regress; - devShell = devShells.default; - } // pkgs.lib.optionalAttrs (system == "aarch64-linux") { - inherit (basePackages) postgresql_15_debug postgresql_15_src postgresql_orioledb-17_debug postgresql_orioledb-17_src postgresql_17_debug postgresql_17_src; - }; - - # Apps is a list of names of things that can be executed with 'nix run'; - # these are distinct from the things that can be built with 'nix build', - # so they need to be listed here too. - apps = - let - mkApp = attrName: binName: { - type = "app"; - program = "${basePackages."${attrName}"}/bin/${binName}"; - }; - in - { - start-server = mkApp "start-server" "start-postgres-server"; - start-client = mkApp "start-client" "start-postgres-client"; - start-replica = mkApp "start-replica" "start-postgres-replica"; - # migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; - # sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; - pg-restore = mkApp "pg-restore" "pg-restore"; - local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; - dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; - update-readme = mkApp "update-readme" "update-readme"; - show-commands = mkApp "show-commands" "show-commands"; - build-test-ami = mkApp "build-test-ami" "build-test-ami"; - run-testinfra = mkApp "run-testinfra" "run-testinfra"; - cleanup-ami = mkApp "cleanup-ami" "cleanup-ami"; - trigger-nix-build = mkApp "trigger-nix-build" "trigger-nix-build"; - }; - - # 'devShells.default' lists the set of packages that are included in the - # ambient $PATH environment when you run 'nix develop'. This is useful - # for development and puts many convenient devtools instantly within - # reach. - - devShells = - let - mkCargoPgrxDevShell = { pgrxVersion, rustVersion }: pkgs.mkShell { - packages = with pkgs; [ - basePackages."cargo-pgrx_${pgrxVersion}" - (rust-bin.stable.${rustVersion}.default.override { - extensions = [ "rust-src" ]; - }) - ]; - shellHook = '' - export HISTFILE=.history - ''; - }; - nix-fast-build = inputs.nix-fast-build.packages.${system}.default; - in - { - default = pkgs.mkShell { - packages = with pkgs; [ - coreutils - just - nix-update - #pg_prove - shellcheck - ansible - ansible-lint - (packer.overrideAttrs (oldAttrs: { - version = "1.7.8"; - })) - - basePackages.start-server - basePackages.start-client - basePackages.start-replica - basePackages.migrate-tool - basePackages.sync-exts-versions - basePackages.build-test-ami - basePackages.run-testinfra - basePackages.cleanup-ami - dbmate - nushell - pythonEnv - nix-fast-build - ]; - shellHook = '' - export HISTFILE=.history - ''; - }; - cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { - pgrxVersion = "0_11_3"; - rustVersion = "1.80.0"; - }; - cargo-pgrx_0_12_6 = mkCargoPgrxDevShell { - pgrxVersion = "0_12_6"; - rustVersion = "1.80.0"; - }; - }; - } - ); + imports = [ + nix/apps.nix + nix/checks.nix + nix/config.nix + nix/devShells.nix + nix/ext + nix/fmt.nix + nix/hooks.nix + nix/nixpkgs.nix + nix/packages + nix/overlays + ]; + }); } diff --git a/nix/apps.nix b/nix/apps.nix new file mode 100644 index 000000000..75eaae49e --- /dev/null +++ b/nix/apps.nix @@ -0,0 +1,32 @@ +{ ... }: +{ + perSystem = + { self', ... }: + let + mkApp = attrName: binName: { + type = "app"; + program = "${self'.packages."${attrName}"}/bin/${binName}"; + }; + in + { + # Apps is a list of names of things that can be executed with 'nix run'; + # these are distinct from the things that can be built with 'nix build', + # so they need to be listed here too. + apps = { + start-server = mkApp "start-server" "start-postgres-server"; + start-client = mkApp "start-client" "start-postgres-client"; + start-replica = mkApp "start-replica" "start-postgres-replica"; + # migrate-postgres = mkApp "migrate-tool" "migrate-postgres"; + # sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions"; + pg-restore = mkApp "pg-restore" "pg-restore"; + local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap"; + dbmate-tool = mkApp "dbmate-tool" "dbmate-tool"; + update-readme = mkApp "update-readme" "update-readme"; + show-commands = mkApp "show-commands" "show-commands"; + build-test-ami = mkApp "build-test-ami" "build-test-ami"; + run-testinfra = mkApp "run-testinfra" "run-testinfra"; + cleanup-ami = mkApp "cleanup-ami" "cleanup-ami"; + trigger-nix-build = mkApp "trigger-nix-build" "trigger-nix-build"; + }; + }; +} diff --git a/nix/cargo-pgrx/buildPgrxExtension.nix b/nix/cargo-pgrx/buildPgrxExtension.nix index 89293ab62..0b2b14fb9 100644 --- a/nix/cargo-pgrx/buildPgrxExtension.nix +++ b/nix/cargo-pgrx/buildPgrxExtension.nix @@ -27,13 +27,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -{ lib -, cargo-pgrx -, pkg-config -, rustPlatform -, stdenv -, Security -, writeShellScriptBin +{ + lib, + cargo-pgrx, + pkg-config, + rustPlatform, + stdenv, + Security, + writeShellScriptBin, }: # The idea behind: Use it mostly like rustPlatform.buildRustPackage and so @@ -47,26 +48,31 @@ # unnecessary and heavy dependency. If you set this to true, you also # have to add `rustfmt` to `nativeBuildInputs`. -{ buildAndTestSubdir ? null -, buildType ? "release" -, buildFeatures ? [ ] -, cargoBuildFlags ? [ ] -, postgresql -# cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the -# dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g. -# if you include the generated code in the output via postInstall. -, useFakeRustfmt ? true -, usePgTestCheckFeature ? true -, ... -} @ args: +{ + buildAndTestSubdir ? null, + buildType ? "release", + buildFeatures ? [ ], + cargoBuildFlags ? [ ], + postgresql, + # cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the + # dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g. + # if you include the generated code in the output via postInstall. + useFakeRustfmt ? true, + usePgTestCheckFeature ? true, + ... +}@args: let - rustfmtInNativeBuildInputs = lib.lists.any (dep: lib.getName dep == "rustfmt") (args.nativeBuildInputs or []); + rustfmtInNativeBuildInputs = lib.lists.any (dep: lib.getName dep == "rustfmt") ( + args.nativeBuildInputs or [ ] + ); in -assert lib.asserts.assertMsg ((args.installPhase or "") == "") - "buildPgrxExtensions overwrites the installPhase, so providing one does nothing"; -assert lib.asserts.assertMsg ((args.buildPhase or "") == "") - "buildPgrxExtensions overwrites the buildPhase, so providing one does nothing"; +assert lib.asserts.assertMsg ( + (args.installPhase or "") == "" +) "buildPgrxExtensions overwrites the installPhase, so providing one does nothing"; +assert lib.asserts.assertMsg ( + (args.buildPhase or "") == "" +) "buildPgrxExtensions overwrites the buildPhase, so providing one does nothing"; assert lib.asserts.assertMsg (useFakeRustfmt -> !rustfmtInNativeBuildInputs) "The parameter useFakeRustfmt is set to true, but rustfmt is included in nativeBuildInputs. Either set useFakeRustfmt to false or remove rustfmt from nativeBuildInputs."; assert lib.asserts.assertMsg (!useFakeRustfmt -> rustfmtInNativeBuildInputs) @@ -75,7 +81,7 @@ assert lib.asserts.assertMsg (!useFakeRustfmt -> rustfmtInNativeBuildInputs) let fakeRustfmt = writeShellScriptBin "rustfmt" '' exit 0 - ''; + ''; maybeDebugFlag = lib.optionalString (buildType != "release") "--debug"; maybeEnterBuildAndTestSubdir = lib.optionalString (buildAndTestSubdir != null) '' export CARGO_TARGET_DIR="$(pwd)/target" @@ -97,19 +103,26 @@ let pg_ctl stop ''; - argsForBuildRustPackage = builtins.removeAttrs args [ "postgresql" "useFakeRustfmt" "usePgTestCheckFeature" ]; + argsForBuildRustPackage = builtins.removeAttrs args [ + "postgresql" + "useFakeRustfmt" + "usePgTestCheckFeature" + ]; # so we don't accidentally `(rustPlatform.buildRustPackage argsForBuildRustPackage) // { ... }` because # we forgot parentheses finalArgs = argsForBuildRustPackage // { buildInputs = (args.buildInputs or [ ]) ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ]; - nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ - cargo-pgrx - postgresql - pkg-config - rustPlatform.bindgenHook - ] ++ lib.optionals useFakeRustfmt [ fakeRustfmt ]; + nativeBuildInputs = + (args.nativeBuildInputs or [ ]) + ++ [ + cargo-pgrx + postgresql + pkg-config + rustPlatform.bindgenHook + ] + ++ lib.optionals useFakeRustfmt [ fakeRustfmt ]; buildPhase = '' runHook preBuild @@ -155,7 +168,10 @@ let RUST_BACKTRACE = "full"; checkNoDefaultFeatures = true; - checkFeatures = (args.checkFeatures or [ ]) ++ (lib.optionals usePgTestCheckFeature [ "pg_test" ]) ++ [ "pg${pgrxPostgresMajor}" ]; + checkFeatures = + (args.checkFeatures or [ ]) + ++ (lib.optionals usePgTestCheckFeature [ "pg_test" ]) + ++ [ "pg${pgrxPostgresMajor}" ]; }; in rustPlatform.buildRustPackage finalArgs diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index c1e1a4dee..5b5cd7222 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -1,11 +1,12 @@ -{ lib -, darwin -, fetchCrate -, openssl -, pkg-config -, makeRustPlatform -, stdenv -, rust-bin +{ + lib, + darwin, + fetchCrate, + openssl, + pkg-config, + makeRustPlatform, + stdenv, + rust-bin, }: let rustVersion = "1.85.1"; @@ -14,9 +15,10 @@ let rustc = rust-bin.stable.${rustVersion}.default; }; generic = - { version - , hash - , cargoHash + { + version, + hash, + cargoHash, }: rustPlatform.buildRustPackage rec { # rust-overlay uses 'cargo-auditable' wrapper for 'cargo' command, but it @@ -26,19 +28,13 @@ let auditable = false; pname = "cargo-pgrx"; inherit version; - src = fetchCrate { - inherit version pname hash; - }; + src = fetchCrate { inherit version pname hash; }; inherit cargoHash; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; - buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ - openssl - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.Security - ]; - + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + buildInputs = + lib.optionals stdenv.hostPlatform.isLinux [ openssl ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + OPENSSL_DIR = "${openssl.dev}"; OPENSSL_INCLUDE_DIR = "${openssl.dev}/include"; OPENSSL_LIB_DIR = "${openssl.out}/lib"; diff --git a/nix/checks.nix b/nix/checks.nix new file mode 100644 index 000000000..fc042ad12 --- /dev/null +++ b/nix/checks.nix @@ -0,0 +1,311 @@ +{ self, ... }: +{ + perSystem = + { + lib, + self', + system, + pkgs, + ... + }: + let + pkgs-lib = pkgs.callPackage ./packages/lib.nix { + psql_15 = self'.packages."psql_15/bin"; + psql_17 = self'.packages."psql_17/bin"; + psql_orioledb-17 = self'.packages."psql_orioledb-17/bin"; + pgroonga = self'.packages."psql_15/exts/pgroonga"; + inherit (self.supabase) defaults; + }; + in + { + checks = + let + # Create a testing harness for a PostgreSQL package. This is used for + # 'nix flake check', and works with any PostgreSQL package you hand it. + makeCheckHarness = + pgpkg: + let + pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; + pg_regress = self'.packages.pg_regress; + getkey-script = pkgs.stdenv.mkDerivation { + name = "pgsodium-getkey"; + buildCommand = '' + mkdir -p $out/bin + cat > $out/bin/pgsodium-getkey << 'EOF' + #!${pkgs.bash}/bin/bash + set -euo pipefail + + TMPDIR_BASE=$(mktemp -d) + + KEY_DIR="''${PGSODIUM_KEY_DIR:-$TMPDIR_BASE/pgsodium}" + KEY_FILE="$KEY_DIR/pgsodium.key" + + if ! mkdir -p "$KEY_DIR" 2>/dev/null; then + echo "Error: Could not create key directory $KEY_DIR" >&2 + exit 1 + fi + chmod 1777 "$KEY_DIR" + + if [[ ! -f "$KEY_FILE" ]]; then + if ! (dd if=/dev/urandom bs=32 count=1 2>/dev/null | od -A n -t x1 | tr -d ' \n' > "$KEY_FILE"); then + if ! (openssl rand -hex 32 > "$KEY_FILE"); then + echo "00000000000000000000000000000000" > "$KEY_FILE" + echo "Warning: Using fallback key" >&2 + fi + fi + chmod 644 "$KEY_FILE" + fi + + if [[ -f "$KEY_FILE" && -r "$KEY_FILE" ]]; then + cat "$KEY_FILE" + else + echo "Error: Cannot read key file $KEY_FILE" >&2 + exit 1 + fi + EOF + chmod +x $out/bin/pgsodium-getkey + ''; + }; + + # Use the shared setup but with a test-specific name + start-postgres-server-bin = pkgs-lib.makePostgresDevSetup { + inherit pkgs; + name = "start-postgres-server-test"; + extraSubstitutions = { + PGSODIUM_GETKEY = "${getkey-script}/bin/pgsodium-getkey"; + PGSQL_DEFAULT_PORT = pgPort; + }; + }; + + getVersionArg = + pkg: + let + name = pkg.version; + in + if builtins.match "15.*" name != null then + "15" + else if builtins.match "17.*" name != null then + "17" + else if builtins.match "orioledb-17.*" name != null then + "orioledb-17" + else + throw "Unsupported PostgreSQL version: ${name}"; + + # Helper function to filter SQL files based on version + filterTestFiles = + version: dir: + let + files = builtins.readDir dir; + isValidFile = + name: + let + isVersionSpecific = builtins.match "z_.*" name != null; + matchesVersion = + if isVersionSpecific then + if version == "orioledb-17" then + builtins.match "z_orioledb-17_.*" name != null + else if version == "17" then + builtins.match "z_17_.*" name != null + else + builtins.match "z_15_.*" name != null + else + true; + in + pkgs.lib.hasSuffix ".sql" name && matchesVersion; + in + pkgs.lib.filterAttrs (name: _: isValidFile name) files; + + # Get the major version for filtering + majorVersion = + let + version = builtins.trace "pgpkg.version is: ${pgpkg.version}" pgpkg.version; + isOrioledbMatch = builtins.match "^17_[0-9]+$" version != null; + isSeventeenMatch = builtins.match "^17[.][0-9]+$" version != null; + result = + if isOrioledbMatch then + "orioledb-17" + else if isSeventeenMatch then + "17" + else + "15"; + in + builtins.trace "Major version result: ${result}" result; # Trace the result # For "15.8" + + # Filter SQL test files + filteredSqlTests = filterTestFiles majorVersion ./tests/sql; + + pgPort = + if (majorVersion == "17") then + "5535" + else if (majorVersion == "15") then + "5536" + else + "5537"; + + # Convert filtered tests to a sorted list of basenames (without extension) + testList = pkgs.lib.mapAttrsToList ( + name: _: builtins.substring 0 (pkgs.lib.stringLength name - 4) name + ) filteredSqlTests; + sortedTestList = builtins.sort (a: b: a < b) testList; + in + pkgs.runCommand "postgres-${pgpkg.version}-check-harness" + { + nativeBuildInputs = with pkgs; [ + coreutils + bash + perl + pgpkg + pg_prove + pg_regress + procps + start-postgres-server-bin + which + getkey-script + supabase-groonga + ]; + } + '' + set -e + + #First we need to create a generic pg cluster for pgtap tests and run those + export GRN_PLUGINS_DIR=${pkgs.supabase-groonga}/lib/groonga/plugins + PGTAP_CLUSTER=$(mktemp -d) + initdb --locale=C --username=supabase_admin -D "$PGTAP_CLUSTER" + substitute ${./tests/postgresql.conf.in} "$PGTAP_CLUSTER"/postgresql.conf \ + --subst-var-by PGSODIUM_GETKEY_SCRIPT "${getkey-script}/bin/pgsodium-getkey" + echo "listen_addresses = '*'" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "port = ${pgPort}" >> "$PGTAP_CLUSTER"/postgresql.conf + echo "host all all 127.0.0.1/32 trust" >> $PGTAP_CLUSTER/pg_hba.conf + echo "Checking shared_preload_libraries setting:" + grep -rn "shared_preload_libraries" "$PGTAP_CLUSTER"/postgresql.conf + # Remove timescaledb if running orioledb-17 check + echo "I AM ${pgpkg.version}====================================================" + if [[ "${pgpkg.version}" == *"17"* ]]; then + perl -pi -e 's/ timescaledb,//g' "$PGTAP_CLUSTER/postgresql.conf" + fi + #NOTE in the future we may also need to add the orioledb extension to the cluster when cluster is oriole + echo "PGTAP_CLUSTER directory contents:" + ls -la "$PGTAP_CLUSTER" + + # Check if postgresql.conf exists + if [ ! -f "$PGTAP_CLUSTER/postgresql.conf" ]; then + echo "postgresql.conf is missing!" + exit 1 + fi + + # PostgreSQL startup + if [[ "$(uname)" == "Darwin" ]]; then + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k "$PGTAP_CLUSTER" -p ${pgPort} -d 5" start 2>&1 + else + mkdir -p "$PGTAP_CLUSTER/sockets" + pg_ctl -D "$PGTAP_CLUSTER" -l "$PGTAP_CLUSTER"/postgresql.log -o "-k $PGTAP_CLUSTER/sockets -p ${pgPort} -d 5" start 2>&1 + fi || { + echo "pg_ctl failed to start PostgreSQL" + echo "Contents of postgresql.log:" + cat "$PGTAP_CLUSTER"/postgresql.log + exit 1 + } + for i in {1..60}; do + if pg_isready -h ${self.supabase.defaults.host} -p ${pgPort}; then + echo "PostgreSQL is ready" + break + fi + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL is not ready after 60 seconds" + echo "PostgreSQL status:" + pg_ctl -D "$PGTAP_CLUSTER" status + echo "PostgreSQL log content:" + cat "$PGTAP_CLUSTER"/postgresql.log + exit 1 + fi + done + createdb -p ${pgPort} -h ${self.supabase.defaults.host} --username=supabase_admin testing + if ! psql -p ${pgPort} -h ${self.supabase.defaults.host} --username=supabase_admin -d testing -v ON_ERROR_STOP=1 -Xf ${./tests/prime.sql}; then + echo "Error executing SQL file. PostgreSQL log content:" + cat "$PGTAP_CLUSTER"/postgresql.log + pg_ctl -D "$PGTAP_CLUSTER" stop + exit 1 + fi + SORTED_DIR=$(mktemp -d) + for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do + psql -p ${pgPort} -h ${self.supabase.defaults.host} --username=supabase_admin -d testing -f "${./tests/sql}/$t.sql" || true + done + rm -rf "$SORTED_DIR" + pg_ctl -D "$PGTAP_CLUSTER" stop + rm -rf $PGTAP_CLUSTER + + # End of pgtap tests + # from here on out we are running pg_regress tests, we use a different cluster for this + # which is start by the start-postgres-server-bin script + # start-postgres-server-bin script closely matches our AMI setup, configurations and migrations + + unset GRN_PLUGINS_DIR + ${start-postgres-server-bin}/bin/start-postgres-server ${getVersionArg pgpkg} --daemonize + + for i in {1..60}; do + if pg_isready -h ${self.supabase.defaults.host} -p ${pgPort} -U supabase_admin -q; then + echo "PostgreSQL is ready" + break + fi + sleep 1 + if [ $i -eq 60 ]; then + echo "PostgreSQL failed to start" + exit 1 + fi + done + + if ! psql -p ${pgPort} -h ${self.supabase.defaults.host} --no-password --username=supabase_admin -d postgres -v ON_ERROR_STOP=1 -Xf ${./tests/prime.sql}; then + echo "Error executing SQL file" + exit 1 + fi + + mkdir -p $out/regression_output + if ! pg_regress \ + --use-existing \ + --dbname=postgres \ + --inputdir=${./tests} \ + --outputdir=$out/regression_output \ + --host=${self.supabase.defaults.host} \ + --port=${pgPort} \ + --user=supabase_admin \ + ${builtins.concatStringsSep " " sortedTestList}; then + echo "pg_regress tests failed" + cat $out/regression_output/regression.diffs + exit 1 + fi + + echo "Running migrations tests" + pg_prove -p ${pgPort} -U supabase_admin -h ${self.supabase.defaults.host} -d postgres -v ${../migrations/tests}/test.sql + + # Copy logs to output + for logfile in $(find /tmp -name postgresql.log -type f); do + cp "$logfile" $out/postgresql.log + done + exit 0 + ''; + in + { + psql_15 = makeCheckHarness self'.packages."psql_15/bin"; + psql_17 = makeCheckHarness self'.packages."psql_17/bin"; + psql_orioledb-17 = makeCheckHarness self'.packages."psql_orioledb-17/bin"; + inherit (self'.packages) + wal-g-2 + wal-g-3 + dbmate-tool + pg_regress + ; + devShell = self'.devShells.default; + } + // pkgs.lib.optionalAttrs (system == "aarch64-linux") { + inherit (self'.packages) + postgresql_15_debug + postgresql_15_src + postgresql_orioledb-17_debug + postgresql_orioledb-17_src + postgresql_17_debug + postgresql_17_src + ; + }; + }; +} diff --git a/nix/config.nix b/nix/config.nix new file mode 100644 index 000000000..b1ebe3fd7 --- /dev/null +++ b/nix/config.nix @@ -0,0 +1,62 @@ +{ lib, ... }: +let + postgresqlDefaults = lib.types.submodule { + options = { + port = lib.mkOption { + type = lib.types.str; + default = "5435"; + }; + host = lib.mkOption { + type = lib.types.str; + default = "localhost"; + }; + superuser = lib.mkOption { + type = lib.types.str; + default = "supabase_admin"; + }; + }; + }; + postgresqlVersion = lib.types.submodule { + options = { + version = lib.mkOption { type = lib.types.str; }; + hash = lib.mkOption { type = lib.types.str; }; + }; + }; + supabaseSubmodule = lib.types.submodule { + options = { + defaults = lib.mkOption { type = postgresqlDefaults; }; + supportedPostgresVersions = lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf postgresqlVersion); + default = { }; + }; + }; + }; +in +{ + flake = { + options = { + supabase = lib.mkOption { type = supabaseSubmodule; }; + }; + config.supabase = { + defaults = { }; + supportedPostgresVersions = { + postgres = { + "15" = { + version = "15.8"; + hash = "sha256-RANRX5pp7rPv68mPMLjGlhIr/fiV6Ss7I/W452nty2o="; + }; + "17" = { + version = "17.4"; + hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c="; + }; + }; + orioledb = { + "17" = { + version = "17_6"; + hash = "sha256-HbuTcXNanFOl9YfvlSzQJon8CfAhc8TFwo/y7jXy51w="; + }; + }; + }; + }; + }; +} diff --git a/nix/devShells.nix b/nix/devShells.nix new file mode 100644 index 000000000..7ff4d0720 --- /dev/null +++ b/nix/devShells.nix @@ -0,0 +1,81 @@ +{ ... }: +{ + perSystem = + { + pkgs, + self', + config, + ... + }: + let + # Define pythonEnv here + pythonEnv = pkgs.python3.withPackages ( + ps: with ps; [ + boto3 + docker + pytest + pytest-testinfra + requests + ec2instanceconnectcli + paramiko + ] + ); + mkCargoPgrxDevShell = + { pgrxVersion, rustVersion }: + pkgs.mkShell { + packages = with pkgs; [ + self'.packages."cargo-pgrx_${pgrxVersion}" + (rust-bin.stable.${rustVersion}.default.override { extensions = [ "rust-src" ]; }) + ]; + shellHook = '' + export HISTFILE=.history + ''; + }; + in + { + devShells = { + default = pkgs.mkShell { + packages = + with pkgs; + [ + coreutils + just + nix-update + #pg_prove + shellcheck + ansible + ansible-lint + (packer.overrideAttrs (_oldAttrs: { + version = "1.7.8"; + })) + + self'.packages.start-server + self'.packages.start-client + self'.packages.start-replica + self'.packages.migrate-tool + self'.packages.sync-exts-versions + self'.packages.build-test-ami + self'.packages.run-testinfra + self'.packages.cleanup-ami + dbmate + nushell + pythonEnv + config.treefmt.build.wrapper + ] + ++ self'.packages.docs.nativeBuildInputs; + shellHook = '' + export HISTFILE=.history + ${config.pre-commit.installationScript} + ''; + }; + cargo-pgrx_0_11_3 = mkCargoPgrxDevShell { + pgrxVersion = "0_11_3"; + rustVersion = "1.80.0"; + }; + cargo-pgrx_0_12_6 = mkCargoPgrxDevShell { + pgrxVersion = "0_12_6"; + rustVersion = "1.80.0"; + }; + }; + }; +} diff --git a/nix/docs/README.md b/nix/docs/README.md index 400632984..66d63ef4c 100644 --- a/nix/docs/README.md +++ b/nix/docs/README.md @@ -3,6 +3,36 @@ This directory contains most of the "runbooks" and documentation on how to use this repository. +## Getting Started + You probably want to start with the [starting guide](./start-here.md). Then, learn how to play with `postgres` in the [build guide](./build-postgres.md). -After that, you can probe around a bit. + +## Development + +- **[Nix tree structure](./nix-directory-structure.md)** - Overview of the Nix directory structure +- **[Development Workflow](./development-workflow.md)** - Complete development and testing workflow +- **[Build PostgreSQL](./build-postgres.md)** - Building PostgreSQL from source +- **[Receipt Files](./receipt-files.md)** - Understanding build receipts +- **[Start Client/Server](./start-client-server.md)** - Running PostgreSQL client and server +- **[Docker](./docker.md)** - Docker integration and usage +- **[Use direnv](./use-direnv.md)** - Development environment with direnv +- **[Pre-commit Hooks](./pre-commit-hooks.md)** - Automatic formatting and code checks before commits +- **[Nix Formatter](./nix-formatter.md)** - Code formatting with treefmt + +## Package Management + +- **[Adding New Packages](./adding-new-package.md)** - How to add new PostgreSQL extensions +- **[Update Extensions](./update-extension.md)** - How to update existing extensions +- **[New Major PostgreSQL](./new-major-postgres.md)** - Adding support for new PostgreSQL versions +- **[Nix Overlays](./nix-overlays.md)** - Understanding and using Nix overlays + +## Testing + +- **[Adding Tests](./adding-tests.md)** - How to add tests for extensions +- **[Migration Tests](./migration-tests.md)** - Testing database migrations +- **[Testing PG Upgrade Scripts](./testing-pg-upgrade-scripts.md)** - Testing PostgreSQL upgrades + +## Reference + +- **[References](./references.md)** - Useful links and resources diff --git a/nix/docs/adding-new-package.md b/nix/docs/adding-new-package.md index 6f7753953..83d546d21 100644 --- a/nix/docs/adding-new-package.md +++ b/nix/docs/adding-new-package.md @@ -48,7 +48,7 @@ This uses `stdenv.mkDerivation` which is a general nix builder for C and C++ pro Your build should produce all of the sql and control files needed for the install phase. -1. Once you have created this file, you can add it to `nix/ext/.nix` and edit `flake.nix` and add it to the `ourExtensions` list. +1. Once you have created this file, you can add it to `nix/ext/.nix` and edit `nix/packages/postgres.nix` and add it to the `ourExtensions` list. 2. `git add .` as nix uses git to track changes 3. In your package file, temporarily empty the `hash = "sha256<...>=";` to `hash = "";` and save and `git add .` 4. Run `nix build .#psql_15/exts/` to try to trigger a build, nix will print the calculated sha256 value that you can add back the the `hash` variable, save the file again, and re-run `nix build .#psql_15/exts/`. @@ -156,4 +156,4 @@ A few things about `buildPgrxExtension_x`: 5. You can also run `nix run .#start-server 15` and in a new terminal window run `nix run .#star-client-and-migrate 15` and try to `CREATE EXTENSION ` and work with it there 6. Check that your extension works with the `pg_upgrade` process (TODO documentation forthcoming) 7. Now you are ready to PR the extension -8. From here, the release process should typically take care of the rest. \ No newline at end of file +8. From here, the release process should typically take care of the rest. diff --git a/nix/docs/assets/images/logo.png b/nix/docs/assets/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..c5dd5e27aadd48f4de768aac7db1a8575f41b709 GIT binary patch literal 2530 zcmbVOc{tPy7ygZ*k-f5pvE+6&a_w1TEMti*#U+J_ELjpG+hC^1Qi(9x$5I$;$u5Sh z*Dl#DCdLLgPAc|y zuri%wvpc`C0N`}7iGi+laMpUZSFD3AU-!iHGAU#>WJoH=S*fyCYEnFsu)Pd)`+ z7B@_d6f>x#i6aVbyq`WON1Wl*hCgHBJL9CwtG|&_Sp8Uh{Ouneq60C}Z$I6CUk)|4nj@## zo_l%%K4_BW_EU6m`TNrEEQ!sJkTZ)$S9DWaDl>L}34Rw-@7J*R4I8`I`sJ;v{KF&5 zwGG-MxpuR}XX^Z8F8~ehuT!W1xf;Gp#VbJdEPn21LBh@3ukab{z?!#c*b%E&-woj; ze8y>@{pd|jFV`>2nO7wltZ>G%cGe7ft&7+`{95IH@hyNliwWAQJQhCYuT`tXSK40( z<$4A073TbKw4eeX^p9^t4+LxY?&U+|w>uLaJfV$h@+)9B-=I-qliylDHW-}F_1Sy* z7{Wb17PVu-BZ@_OO?;c!Dy_XQw!lji?>}crhbrT6y2jv#4^l`j?AB0;lD5 zIDskAV_Hm1xpKK^H(z1a{`ksIG2Ea?KelquMNYWc2_k6_36hkvH!<{KLZ)G;L~r5@ z$(I!cyLjk7I7upAwg};|DcvB<*q$yITdcTJ9))-L`Er>Vi#N#F3x%WXf7nx`Sy@C{ z;c*~S_XzOa9-gm11OknWN2n-KIPrnJhf?gJ_Bot)jUf)@44!CUNLj^ zA&%1VnC0|Uy-!KBcnG%P^(>M4w^01qC$PF6?3*5m1N^tqi{3 zhChzafmC~Mnfgqqu`{6_6rfeoNY;ah#VC!!WGgs-Oo_)RIm?1^wBDBfJka-(Uh<{C zMkS*@>mc0_#{C>i)P7b?@xdoe@NxNoC%h-p^sM)wP(^=D5+l37(g{NN;awn29tmAC?Zw0Lf_8QG3bhbH}nQJHp(#iXW?g9x%?6)^}Z{Ud07y`&Sr8^^aCv zA*)sm)t8T8+`BDaz;Q*$W*qYB;Y_NJ^2b^#wYSW5RWF-E=Y8O>Vt;E|rTq!}HC`uJ zp$m}@FnxC?opu}|EIYx5+uB7dk(n>Fs4myXaqyiJ=%@b}TNqnWevxob#vz?Xb}Gb2 z6gS@ZFiNyk9`3F4uW;4i@9!Vk4*z-nDcd#MA`-p5^lzVvW|mTn?9)eeK_Zh=f!(qm z?v7nxy9d|JvAYYYS*eKU?J&&|6w5_{_{9U!pSY1sr(>I5lPFV6gmcf|@3hLU>etQENwW=A&hYYsVZcV`!vlWbtA1HsduSEf8qapL&E z(SL80phh{eHt%SoZJ$WDbAgfD2(ANB7GAzk^}H$*sAy^(1@}wZSy~|XtQ0v(Hl6fu zUmJ@(tm$jOHZJ74J9p)+w)J)d<&Zns=4IVi_uM%8CnW$ zsW)MP6*AqRl+wn+cNgn=5J4)i*v|{o7K14_F8>#ySa;ibx`(!NOUaC(F!aNbzEpy& z`9I;nSc&6H-Rl=B6?sG*g+$SZs+THwzh=!sEazc;Q62n4`xyJP+`6uw5vwspUv9b1 zCeA`~tAtV9go+`=lxN5)q==SZK47zZG74AHz?O3-?gc4D=H?uR7~q;TJzPW92Jm($ z3ogjK*QSL48{_To&y)!Ow#k=Yc9p43m)V56_(v?Mc%Ji>+5@E^RP<~l0-Ws~E}Jtb zEYeo|niIG~Ac=gXSvR)5My$m$-SZdbTSqux^PnHI8<^XWyv)wX|KDDg^D3ExXZ&bK zxTnh*8dMo|?p%$!GS#~X@oO$hRXSHsE_t9g1TY;Up6dKi67hO2Bb!cQl~YC()7+MR zbzPPiPhArv%AibrS9X6qT{g|)27If|;?}MBSBB;PdY^Fy7yuXy=tP0>A|fE@ Q#Jd3|2y=r9J>--B0M-)JdH?_b literal 0 HcmV?d00001 diff --git a/nix/docs/documentation.md b/nix/docs/documentation.md new file mode 100644 index 000000000..034b1f460 --- /dev/null +++ b/nix/docs/documentation.md @@ -0,0 +1,19 @@ +# Documentation + +We are using markdown for documentation in the `nix/docs` directory, which is rendered by [mkdocs](https://www.mkdocs.org/). + +## Usage + +To generate the documentation locally, you can use the following command in a development shell: + +```bash +cd nix +mkdocs serve +``` + +This will start a local server at `http://localhost:8000` where you can view the documentation. +The documentation is automatically updated as you make changes to the markdown files. + +## Configuration + +Mkdocs configuration is done in the `nix/mkdocs.yml` file. Refer to the [Mkdocs documentation](https://www.mkdocs.org/user-guide/configuration/) for details on how to configure the site. diff --git a/nix/docs/new-major-postgres.md b/nix/docs/new-major-postgres.md index 1c5a2dffc..b934b38bf 100644 --- a/nix/docs/new-major-postgres.md +++ b/nix/docs/new-major-postgres.md @@ -1,9 +1,10 @@ PostgreSQL versions are managed in upstream nixpkgs. -See this example PR to add a new version of PostgreSQL; this version is for 16 -beta3, but any version is roughly the same. In short, you need to: +[See this example PR](https://github.com/NixOS/nixpkgs/pull/249030) to add a +new version of PostgreSQL; this version is for 16 beta3, but any version is +roughly the same. In short, you need to: -- Add a new version and hash +- Add a new version and hash to `nix/config.nix` - Possibly patch the source code for minor refactorings - In this example, an old patch had to be rewritten because a function was split into two different functions; the patch is functionally equivalent but @@ -12,16 +13,14 @@ beta3, but any version is roughly the same. In short, you need to: - Integrate inside the CI and get code review - Run `nix flake update` to get a new version, once it's ready -https://github.com/NixOS/nixpkgs/pull/249030 - ## Adding the major version to this repository It isn't well abstracted, unfortunately. In short: look for the strings `14` and -`15` under `flake.nix` and `nix/tools/`. More specifically: +`15` under the nix configuration files. More specifically: -- Add `psql_XX` to `basePackages` in `flake.nix` -- Ditto with `checks` in `flake.nix` -- Modify the tools under `tools/` to understand the new major version +- Add `psql_XX` to `basePackages` in `nix/packages/postgres.nix` +- Ditto with `checks` in `nix/checks.nix` +- Modify the tools under `nix/packages/` to understand the new major version - Make sure the CI is integrated under the GitHub Actions. The third step and fourth steps are the most annoying, really. The first two are diff --git a/nix/docs/nix-directory-structure.md b/nix/docs/nix-directory-structure.md new file mode 100644 index 000000000..24ca49943 --- /dev/null +++ b/nix/docs/nix-directory-structure.md @@ -0,0 +1,163 @@ +# Nix Directory Structure + +This document explains the Nix structure used in this repository. The project uses [flake-parts](https://flake.parts/) to split a `flake.nix` into specialized, maintainable modules. + +The root `flake.nix` serves only as an entry point that references specialized modules in the `nix/` directory: + +``` +├── flake.nix # Root flake file only referencing modules +nix/ + ├── apps.nix # Application definitions + ├── checks.nix # Build checks and tests + ├── config.nix # Global configuration + ├── devShells.nix # Development environment shell + ├── fmt.nix # Code formatting configuration + ├── hooks.nix # Git hooks and pre-commit + ├── ext/ # PostgreSQL extensions + ├── overlays/ # Nixpkgs overlays + ├── packages/ # Custom packages + └── postgresql/ # PostgreSQL packages +``` + +## Module Descriptions + +### Root Files + +#### `flake.nix` + +The main flake file that: + +- Declares inputs (nixpkgs, flake-parts, etc.) +- Sets up the systems to support (x86_64-linux, aarch64-linux, aarch64-darwin) +- Imports all module files using flake-parts + +#### `flake.lock` + +Lockfile containing exact versions of all flake inputs. + +### Core Configuration Modules + +#### `nix/config.nix` + +Global configuration and constants used throughout the flake: + +- PostgreSQL default ports and users +- System-wide package configurations +- Shared constants and variables + +#### `nix/nixpkgs.nix` + +Nixpkgs configuration: + +- System-specific package imports +- Overlay applications +- Package configuration (allow unfree packages, etc.) + +### Development Environment + +#### `nix/devShells.nix` + +Development shell configurations: + +- Default development environment +- Tool dependencies for development +- Environment variables and setup + +#### `nix/fmt.nix` + +Code formatting configuration using [treefmt](https://github.com/numtide/treefmt/): + +- nixfmt-rfc-style for Nix code formatting +- deadnix for removing unused nix code + +More details in [Code formatter](./nix-formatter.md). + +#### `nix/hooks.nix` + +Git hooks and pre-commit configuration: + +- Integration with [git-hooks.nix](https://github.com/cachix/git-hooks.nix) +- Automatic formatting on commit +- Code quality checks + +More details in [Pre-coommit hooks](./pre-commit-hooks.md). + +### Applications and Packages + +#### `nix/apps.nix` + +Application definitions accessible via `nix run`: + +- Development tools and scripts +- Build and deployment utilities +- Testing and validation tools + +#### `nix/packages/` + +Directory containing custom package definitions such as: + + - `default.nix` - Main package exports and basePackages + - `start-client.nix` - PostgreSQL client tools + - `start-replica.nix` - Replication tools + - `migrate-tool.nix` - Migration utilities + - `dbmate-tool.nix` - Database migration tool + +#### `nix/checks.nix` + +Build checks and validation: + +- Package build validation +- Integration tests +- Code quality checks +- Ensures all Postgres packages build correctly + +### PostgreSQL-Specific + +#### `nix/postgresql/` + +PostgreSQL package definitions: + +- `default.nix` - Main PostgreSQL package exports +- `generic.nix` - Generic PostgreSQL build functions +- `src.nix` - PostgreSQL source package generation +- `patches/` - PostgreSQL-specific patches + +#### `nix/ext/` + +PostgreSQL extensions: + +- `default.nix` - Extension registry and ourExtensions list +- Individual `.nix` files - Extension definitions like: + - `pgvector.nix` - Vector similarity search + - `pgsodium.nix` - Encryption extension + - `pg_graphql.nix` - GraphQL support + - `timescaledb.nix` - Time-series database + - And 30+ other extensions + +### System Customization + +#### `nix/overlays/` + +Nixpkgs overlays for package customization: + +- `default.nix` - Main overlay that imports all others +- `cargo-pgrx-0-11-3.nix` - PGRX toolchain overlay +- `psql_16-oriole.nix` - OrioleDB PostgreSQL variant + +#### `nix/cargo-pgrx/` + +Rust-based PostgreSQL extension building: + +- `default.nix` - cargo-pgrx package definitions +- `buildPgrxExtension.nix` - Builder for Rust extensions + +### Testing + +#### `nix/tests/` + +Test suites and expected outputs: + +- `sql/` - SQL test files +- `expected/` - Expected test outputs +- `migrations/` - Migration test data +- `smoke/` - Smoke tests for quick validation diff --git a/nix/docs/nix-formatter.md b/nix/docs/nix-formatter.md new file mode 100644 index 000000000..22047a4d4 --- /dev/null +++ b/nix/docs/nix-formatter.md @@ -0,0 +1,97 @@ +# Code Formatting + +This repository uses [treefmt](https://treefmt.com/) with [nixfmt](https://github.com/NixOS/nixfmt) and [deadnix](https://github.com/astro/deadnix) to maintain consistent formatting and clean code in Nix files. + +## Formatting Tools + +### nixfmt-rfc-style + +- **Purpose**: Formats Nix code according to [RFC 166](https://github.com/NixOS/rfcs/blob/master/rfcs/0166-nix-formatting.md) style guidelines +- **What it does**: + + - Standardizes indentation and spacing + - Formats function calls and attribute sets consistently + - Ensures consistent line breaks and alignment + +### deadnix + +- **Purpose**: Removes unused/dead code from Nix expressions +- **What it does**: + + - Identifies unused variables and bindings + - Removes unused function arguments + - Cleans up dead code paths + +## Usage + +### Command Line + +```bash +# Run treefmt and format all Nix files in the repository +nix fmt +``` + +### In Development Shell + +The formatter is available when you enter the development shell: + +```bash +# Enter development shell +nix develop + +# Format all nix files +treefmt + +# Format specific files +treefmt file1.nix file2.nix + +# Check formatting without making changes +treefmt --check + +# Format with verbose output +treefmt --verbose +``` + +### With direnv + +If you're using direnv, the formatter is automatically available: + +```bash +cd /path/to/project +treefmt +``` + +## Configuration + +The formatter configuration is defined with nix in `nix/fmt.nix` using [treefmt-nix](https://github.com/numtide/treefmt-nix). +See the [treefmt-nix project documentation](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#supported-programs) +for the list of supported formatters and their configurations. + +## Integration with Pre-commit Hooks + +The formatter is automatically run via pre-commit hooks (see [pre-commit-hooks.md](./pre-commit-hooks.md)) to ensure all committed code is properly formatted. + +## Best Practices + +### 1. Run Formatter Before Committing + +```bash +nix fmt +git add . +git commit -m "your message" +``` + +### 2. Review Formatting Changes + +Sometimes we want to first review formatting changes to ensure they're sensible: + +```bash +# See what would be changed +treefmt --check --diff +``` + +## Editor Integration + +### VS Code + +Use the [Nix IDE extension](https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide) with treefmt support. diff --git a/nix/docs/nix-overlays.md b/nix/docs/nix-overlays.md index 90b6f221f..4ca7d246e 100644 --- a/nix/docs/nix-overlays.md +++ b/nix/docs/nix-overlays.md @@ -8,7 +8,7 @@ Overlays are a feature of Nixpkgs that allow you to: disabled-by-default feature. First, you need to define a file for the overlay under -[overlays/](../overlays/), and then import it in `flake.nix`. There is an +[overlays/](../overlays/), and then import it in `nix/overlays/default.nix`. There is an example pull request in [#14](https://github.com/supabase/nix-postgres/issues/14) for this; an overlay typically looks like this: diff --git a/nix/docs/pre-commit-hooks.md b/nix/docs/pre-commit-hooks.md new file mode 100644 index 000000000..820c3a001 --- /dev/null +++ b/nix/docs/pre-commit-hooks.md @@ -0,0 +1,69 @@ +# Pre-commit Hooks + +This repository uses [git-hooks.nix](https://github.com/cachix/git-hooks.nix) and [pre-commit](https://pre-commit.com) to automatically run checks before commits. + +## What it does + +The pre-commit hooks are configured to run `treefmt` which formats Nix files using: + +- **nixfmt** (RFC-style) for Nix code formatting +- **deadnix** for removing dead/unused Nix code + +## Setup + +### Automatic Setup (Recommended) + +If you're using the development shell (via `nix develop` or direnv), the pre-commit hooks are automatically installed and will run before each commit. + +## Usage + +### Automatic Formatting on Commit + +Once set up, the hooks will automatically run before each commit: + +```bash +git add . +git commit -m "your commit message" +# treefmt will run automatically and format files if needed +``` + +If formatting changes are made, the commit will be aborted and you'll need to review and stage the changes: + +```bash +# Review the formatting changes +git diff + +# Stage the formatted files +git add . + +# Commit again +git commit -m "your commit message" +``` + +### Manual Formatting + +You can also run the formatter manually at any time. See [nix-formatter.md](./nix-formatter.md) for details on using `treefmt`. + +### Bypassing Hooks (Not Recommended) + +If you need to bypass the pre-commit hooks (not recommended for normal development): + +```bash +git commit --no-verify -m "your commit message" +``` + +Note that this check will be enforced in CI, so it's best to always run the hooks locally. + +## Configuration + +The pre-commit hooks are configured in: + +- **`nix/hooks.nix`** - Main git-hooks configuration +- **`nix/fmt.nix`** - treefmt formatter configuration + +## Best Practices + +1. **Always run formatting before pushing** - Even if you bypass hooks locally, CI may reject improperly formatted code +2. **Review formatting changes** - Don't blindly accept all formatting changes; review them to ensure they make sense +3. **Keep formatting commits separate** - If you need to make large formatting changes, consider doing them in a separate commit +4. **Use the development shell** - The easiest way to ensure everything works is to use `nix develop` or direnv diff --git a/nix/docs/references.md b/nix/docs/references.md index fe5b791e2..940f51df0 100644 --- a/nix/docs/references.md +++ b/nix/docs/references.md @@ -1,31 +1,37 @@ Nix references and other useful tools: - **Zero to Nix**: Start here to get your feet wet with how Nix works, and how - to use Nixpkgs: https://zero-to-nix.com/ -- `nix-installer`: My recommended way to install Nix - - https://github.com/DeterminateSystems/nix-installer -- Nix manual https://nixos.org/manual/nix/stable/ - - Useful primarily for option and command references -- Flake schema reference https://nixos.wiki/wiki/Flakes - - Useful to know what `flake.nix` is referring to + to use Nixpkgs: + +- `nix-installer`: My recommended way to install Nix: + - + +- Nix manual : + - Useful primarily for option and command references + +- Flake schema reference + - Useful to know what `flake.nix` is referring to + - Example pull requests for this repo: - - Adding smoke tests for an extension: - https://github.com/supabase/nix-postgres/pull/2 - - Extension smoke tests, part 2: - https://github.com/supabase/nix-postgres/pull/3 - - Adding an extension and a smoke test at once: - https://github.com/supabase/nix-postgres/pull/4/files - - Updating an extension to trunk: - https://github.com/supabase/nix-postgres/pull/7 - - Updating an extension to the latest release: - https://github.com/supabase/nix-postgres/pull/9 + - Adding smoke tests for an extension: + + - Extension smoke tests, part 2: + + - Adding an extension and a smoke test at once: + + - Updating an extension to trunk: + + - Updating an extension to the latest release: + + - Contributing to [nixpkgs](https://github.com/nixos/nixpkgs) - - Adding a PGRX-powered extension: - https://github.com/NixOS/nixpkgs/pull/246803 - - Adding a normal extension: https://github.com/NixOS/nixpkgs/pull/249000 - - Adding new PostgreSQL versions: https://github.com/NixOS/nixpkgs/pull/249030 + - Adding a PGRX-powered extension: + + - Adding a normal extension: + - Adding new PostgreSQL versions: + - NixOS Discourse: https://discourse.nixos.org/ - - Useful for community feedback, guidance, and help -- `nix-update`: https://github.com/Mic92/nix-update - - Used in this repository to help update extensions -- pgTAP for testing: https://pgtap.org/documentation.html + - Useful for community feedback, guidance, and help +- `nix-update`: + - Used in this repository to help update extensions +- pgTAP for testing: diff --git a/nix/docs/site/.keep b/nix/docs/site/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/nix/ext/default.nix b/nix/ext/default.nix new file mode 100644 index 000000000..9cd3de8bc --- /dev/null +++ b/nix/ext/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + perSystem = + { pkgs, ... }: + { + packages = { + sfcgal = pkgs.callPackage ./sfcgal/sfcgal.nix { }; + mecab_naist_jdic = pkgs.callPackage ./mecab-naist-jdic/default.nix { }; + }; + }; +} diff --git a/nix/ext/gdal.nix b/nix/ext/gdal.nix index 83924d9ff..739f7e432 100644 --- a/nix/ext/gdal.nix +++ b/nix/ext/gdal.nix @@ -1,22 +1,23 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, pkg-config -, curl -, expat -, libgeotiff -, geos -, json_c -, libxml2 -, postgresql -, proj -, sqlite -, libtiff -, zlib +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + curl, + expat, + libgeotiff, + geos, + json_c, + libxml2, + postgresql, + proj, + sqlite, + libtiff, + zlib, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "gdal"; version = "3.8.5"; @@ -46,16 +47,15 @@ stdenv.mkDerivation rec { zlib ]; - cmakeFlags = [ - "-DGDAL_USE_INTERNAL_LIBS=OFF" - "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" - "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" - "-DBUILD_PYTHON_BINDINGS=OFF" - ] ++ lib.optionals (!stdenv.isDarwin) [ - "-DCMAKE_SKIP_BUILD_RPATH=ON" - ] ++ lib.optionals stdenv.isDarwin [ - "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" - ]; + cmakeFlags = + [ + "-DGDAL_USE_INTERNAL_LIBS=OFF" + "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" + "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DBUILD_PYTHON_BINDINGS=OFF" + ] + ++ lib.optionals (!stdenv.isDarwin) [ "-DCMAKE_SKIP_BUILD_RPATH=ON" ] + ++ lib.optionals stdenv.isDarwin [ "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ]; enableParallelBuilding = true; @@ -63,7 +63,13 @@ stdenv.mkDerivation rec { description = "Translator library for raster geospatial data formats (PostGIS-focused build)"; homepage = "https://www.gdal.org/"; license = licenses.mit; - maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ]; + maintainers = + with maintainers; + teams.geospatial.members + ++ [ + marcweber + dotlambda + ]; platforms = platforms.unix; }; } diff --git a/nix/ext/hypopg.nix b/nix/ext/hypopg.nix index ffafe904e..1e38b11c6 100644 --- a/nix/ext/hypopg.nix +++ b/nix/ext/hypopg.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "hypopg"; diff --git a/nix/ext/index_advisor.nix b/nix/ext/index_advisor.nix index ae23354b9..19777f39e 100644 --- a/nix/ext/index_advisor.nix +++ b/nix/ext/index_advisor.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "index_advisor"; diff --git a/nix/ext/mecab-naist-jdic/default.nix b/nix/ext/mecab-naist-jdic/default.nix index 82f0ed37c..c3148a4e5 100644 --- a/nix/ext/mecab-naist-jdic/default.nix +++ b/nix/ext/mecab-naist-jdic/default.nix @@ -1,19 +1,22 @@ -{ lib, stdenv, fetchurl, mecab }: +{ + lib, + stdenv, + fetchurl, + mecab, +}: stdenv.mkDerivation rec { pname = "mecab-naist-jdic"; version = "0.6.3b-20111013"; - + src = fetchurl { url = "https://github.com/supabase/mecab-naist-jdic/raw/main/mecab-naist-jdic-$%7Bversion%7D.tar.gz"; sha256 = "sha256-yzdwDcmne5U/K/OxW0nP7NZ4SFMKLPirywm1lMpWKMw="; }; - + buildInputs = [ mecab ]; - - configureFlags = [ - "--with-charset=utf8" - ]; + + configureFlags = [ "--with-charset=utf8" ]; buildPhase = '' runHook preBuild diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 96e70e308..96976f83d 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, fetchFromGitHub, curl, libkrb5, postgresql, python3, openssl }: +{ + lib, + stdenv, + fetchFromGitHub, + curl, + libkrb5, + postgresql, + python3, + openssl, +}: stdenv.mkDerivation rec { pname = "orioledb"; @@ -10,7 +19,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-O4OTi8ickylVXE9FURm5R++A+l15Z22YLna7OVzVMjc="; }; version = "beta10"; - buildInputs = [ curl libkrb5 postgresql python3 openssl ]; + buildInputs = [ + curl + libkrb5 + postgresql + python3 + openssl + ]; buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=6"; installPhase = '' runHook preInstall diff --git a/nix/ext/pg-safeupdate.nix b/nix/ext/pg-safeupdate.nix index f5ad17a82..5ac32c352 100644 --- a/nix/ext/pg-safeupdate.nix +++ b/nix/ext/pg-safeupdate.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg-safeupdate"; @@ -7,9 +12,9 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "eradman"; - repo = pname; - rev = version; + owner = "eradman"; + repo = pname; + rev = version; hash = "sha256-1cyvVEC9MQGMr7Tg6EUbsVBrMc8ahdFS3+CmDkmAq4Y="; }; @@ -19,10 +24,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE"; - homepage = "https://github.com/eradman/pg-safeupdate"; - changelog = "https://github.com/eradman/pg-safeupdate/raw/$%7Bsrc.rev%7D/NEWS"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - broken = versionOlder postgresql.version "14"; + homepage = "https://github.com/eradman/pg-safeupdate"; + changelog = "https://github.com/eradman/pg-safeupdate/raw/$%7Bsrc.rev%7D/NEWS"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + broken = versionOlder postgresql.version "14"; }; } diff --git a/nix/ext/pg_backtrace.nix b/nix/ext/pg_backtrace.nix index 0a0b0ae4f..7b92f0637 100644 --- a/nix/ext/pg_backtrace.nix +++ b/nix/ext/pg_backtrace.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_backtrace"; @@ -7,9 +12,9 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "pashkinelfe"; - repo = pname; - rev = "d100bac815a7365e199263f5b3741baf71b14c70"; + owner = "pashkinelfe"; + repo = pname; + rev = "d100bac815a7365e199263f5b3741baf71b14c70"; hash = "sha256-IVCL4r4oj1Ams03D8y+XCFkckPFER/W9tQ68GkWQQMY="; }; @@ -25,8 +30,8 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Updated fork of pg_backtrace"; - homepage = "https://github.com/pashkinelfe/pg_backtrace"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + homepage = "https://github.com/pashkinelfe/pg_backtrace"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/nix/ext/pg_cron.nix b/nix/ext/pg_cron.nix index 792db7676..bcaaf180c 100644 --- a/nix/ext/pg_cron.nix +++ b/nix/ext/pg_cron.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_cron"; @@ -7,9 +12,9 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "citusdata"; - repo = pname; - rev = "v${version}"; + owner = "citusdata"; + repo = pname; + rev = "v${version}"; hash = "sha256-t1DpFkPiSfdoGG2NgNT7g1lkvSooZoRoUrix6cBID40="; }; @@ -23,9 +28,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Run Cron jobs through PostgreSQL"; - homepage = "https://github.com/citusdata/pg_cron"; - changelog = "https://github.com/citusdata/pg_cron/raw/v$%7Bversion%7D/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + homepage = "https://github.com/citusdata/pg_cron"; + changelog = "https://github.com/citusdata/pg_cron/raw/v$%7Bversion%7D/CHANGELOG.md"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix index ef406f8d4..ebe6fea7f 100644 --- a/nix/ext/pg_graphql.nix +++ b/nix/ext/pg_graphql.nix @@ -1,8 +1,15 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_9, cargo, rust-bin }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + buildPgrxExtension_0_12_9, + rust-bin, +}: let - rustVersion = "1.81.0"; - cargo = rust-bin.stable.${rustVersion}.default; + rustVersion = "1.81.0"; + cargo = rust-bin.stable.${rustVersion}.default; in buildPgrxExtension_0_12_9 rec { pname = "pg_graphql"; @@ -18,25 +25,27 @@ buildPgrxExtension_0_12_9 rec { nativeBuildInputs = [ cargo ]; buildInputs = [ postgresql ]; - + CARGO = "${cargo}/bin/cargo"; - + cargoLock = { lockFile = "${src}/Cargo.lock"; }; # Setting RUSTFLAGS in env to ensure it's available for all phases env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; - PGPORT = toString (5430 + - (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB - ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version + PGPORT = toString ( + 5430 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 + ); # +2 for each major version RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - NIX_BUILD_CORES = "4"; # Limit parallel jobs + NIX_BUILD_CORES = "4"; # Limit parallel jobs CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism }; CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; - doCheck = false; meta = with lib; { diff --git a/nix/ext/pg_hashids.nix b/nix/ext/pg_hashids.nix index 828db60fb..20d39a623 100644 --- a/nix/ext/pg_hashids.nix +++ b/nix/ext/pg_hashids.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_hashids"; diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix index 654bb93f5..794757678 100644 --- a/nix/ext/pg_jsonschema.nix +++ b/nix/ext/pg_jsonschema.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, buildPgrxExtension_0_12_6, cargo, rust-bin }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + buildPgrxExtension_0_12_6, + rust-bin, +}: let rustVersion = "1.80.0"; cargo = rust-bin.stable.${rustVersion}.default; @@ -20,23 +27,34 @@ buildPgrxExtension_0_12_6 rec { # update the following array when the pg_jsonschema version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.3.1" "0.3.0" "0.2.0" "0.1.4" "0.1.4" "0.1.2" "0.1.1" "0.1.0"]; - CARGO="${cargo}/bin/cargo"; + previousVersions = [ + "0.3.1" + "0.3.0" + "0.2.0" + "0.1.4" + "0.1.4" + "0.1.2" + "0.1.1" + "0.1.0" + ]; + CARGO = "${cargo}/bin/cargo"; #darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions env = lib.optionalAttrs stdenv.isDarwin { POSTGRES_LIB = "${postgresql}/lib"; RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - PGPORT = toString (5441 + - (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB - ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version - + PGPORT = toString ( + 5441 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 + ); # +2 for each major version }; cargoLock = { lockFile = "${src}/Cargo.lock"; allowBuiltinFetchGit = false; }; - + # FIXME (aseipp): testsuite tries to write files into /nix/store; we'll have # to fix this a bit later. doCheck = false; @@ -50,7 +68,7 @@ buildPgrxExtension_0_12_6 rec { echo "Creating SQL files for previous versions..." current_version="${version}" sql_file="$out/share/postgresql/extension/pg_jsonschema--$current_version.sql" - + if [ -f "$sql_file" ]; then while read -r previous_version; do if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then @@ -65,7 +83,6 @@ buildPgrxExtension_0_12_6 rec { rm git_tags.txt ''; - meta = with lib; { description = "JSON Schema Validation for PostgreSQL"; homepage = "https://github.com/supabase/$%7Bpname%7D"; diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 0f20163e5..02d673297 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -1,10 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, curl, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + curl, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_net"; version = "0.14.0"; - buildInputs = [ curl postgresql ]; + buildInputs = [ + curl + postgresql + ]; src = fetchFromGitHub { owner = "supabase"; diff --git a/nix/ext/pg_partman.nix b/nix/ext/pg_partman.nix index 899716b44..08fc74cee 100644 --- a/nix/ext/pg_partman.nix +++ b/nix/ext/pg_partman.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_partman"; @@ -7,9 +12,9 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "pgpartman"; - repo = pname; - rev = "refs/tags/v${version}"; + owner = "pgpartman"; + repo = pname; + rev = "refs/tags/v${version}"; sha256 = "sha256-GrVOJ5ywZMyqyDroYDLdKkXDdIJSDGhDfveO/ZvrmYs="; }; @@ -24,10 +29,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Partition management extension for PostgreSQL"; - homepage = "https://github.com/pgpartman/pg_partman"; - changelog = "https://github.com/pgpartman/pg_partman/blob/v$%7Bversion%7D/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - broken = versionOlder postgresql.version "14"; + homepage = "https://github.com/pgpartman/pg_partman"; + changelog = "https://github.com/pgpartman/pg_partman/blob/v$%7Bversion%7D/CHANGELOG.md"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + broken = versionOlder postgresql.version "14"; }; } diff --git a/nix/ext/pg_plan_filter.nix b/nix/ext/pg_plan_filter.nix index 6281d0b67..1e11c1d3f 100644 --- a/nix/ext/pg_plan_filter.nix +++ b/nix/ext/pg_plan_filter.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pg_plan_filter"; diff --git a/nix/ext/pg_regress.nix b/nix/ext/pg_regress.nix index 08f82aa79..6233219b2 100644 --- a/nix/ext/pg_regress.nix +++ b/nix/ext/pg_regress.nix @@ -1,6 +1,7 @@ -{ lib -, stdenv -, postgresql +{ + lib, + stdenv, + postgresql, }: stdenv.mkDerivation { diff --git a/nix/ext/pg_repack.nix b/nix/ext/pg_repack.nix index 076e878f2..1f21335df 100644 --- a/nix/ext/pg_repack.nix +++ b/nix/ext/pg_repack.nix @@ -1,12 +1,10 @@ -{ lib -, stdenv -, fetchFromGitHub -, openssl -, postgresql -, postgresqlTestHook -, readline -, testers -, zlib +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + postgresqlTestHook, + testers, }: stdenv.mkDerivation (finalAttrs: { @@ -29,9 +27,7 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru.tests = { - version = testers.testVersion { - package = finalAttrs.finalPackage; - }; + version = testers.testVersion { package = finalAttrs.finalPackage; }; extension = stdenv.mkDerivation { name = "plpgsql-check-test"; dontUnpack = true; diff --git a/nix/ext/pg_stat_monitor.nix b/nix/ext/pg_stat_monitor.nix index 8469f4b98..742e1c0aa 100644 --- a/nix/ext/pg_stat_monitor.nix +++ b/nix/ext/pg_stat_monitor.nix @@ -1,20 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: -let - # NOTE (aseipp): the 1.x series of pg_stat_monitor has some non-standard and - # weird build logic (Percona projects in general seem to have their own - # strange build harness) where it will try to pick the right .sql file to - # install into the extension dir based on the postgresql major version. for - # our purposes, we only need to support v13 and v14+, so just replicate this - # logic from the makefile and pick the right file here. - # - # this seems to all be cleaned up in version 2.0 of the extension, so ideally - # we could upgrade to it later on and nuke this. - # DEPRECATED sqlFilename = if lib.versionOlder postgresql.version "14" - # then "pg_stat_monitor--1.0.13.sql.in" - # else "pg_stat_monitor--1.0.14.sql.in"; - -in stdenv.mkDerivation rec { pname = "pg_stat_monitor"; version = "2.1.0"; @@ -32,7 +22,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} - + cp *${postgresql.dlSuffix} $out/lib cp *.sql $out/share/postgresql/extension cp *.control $out/share/postgresql/extension diff --git a/nix/ext/pg_tle.nix b/nix/ext/pg_tle.nix index a0e9385b2..df83d4307 100644 --- a/nix/ext/pg_tle.nix +++ b/nix/ext/pg_tle.nix @@ -1,11 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, flex, openssl, libkrb5 }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + flex, + openssl, + libkrb5, +}: stdenv.mkDerivation rec { pname = "pg_tle"; version = "1.4.0"; nativeBuildInputs = [ flex ]; - buildInputs = [ openssl postgresql libkrb5 ]; + buildInputs = [ + openssl + postgresql + libkrb5 + ]; src = fetchFromGitHub { owner = "aws"; @@ -14,10 +26,8 @@ stdenv.mkDerivation rec { hash = "sha256-crxj5R9jblIv0h8lpqddAoYe2UqgUlnvbOajKTzVces="; }; - makeFlags = [ "FLEX=flex" ]; - installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} diff --git a/nix/ext/pgaudit.nix b/nix/ext/pgaudit.nix index 01ab66f15..3535447a7 100644 --- a/nix/ext/pgaudit.nix +++ b/nix/ext/pgaudit.nix @@ -1,20 +1,30 @@ -{ lib, stdenv, fetchFromGitHub, libkrb5, openssl, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + libkrb5, + openssl, + postgresql, +}: #adapted from https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sql/postgresql/ext/pgaudit.nix let - source = { - "17" = { - version = "17.0"; - hash = "sha256-3ksq09wiudQPuBQI3dhEQi8IkXKLVIsPFgBnwLiicro="; - }; - "16" = { - version = "16.0"; - hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc="; - }; - "15" = { - version = "1.7.0"; - hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw="; - }; - }.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}"); + source = + { + "17" = { + version = "17.0"; + hash = "sha256-3ksq09wiudQPuBQI3dhEQi8IkXKLVIsPFgBnwLiicro="; + }; + "16" = { + version = "16.0"; + hash = "sha256-8+tGOl1U5y9Zgu+9O5UDDE4bec4B0JC/BQ6GLhHzQzc="; + }; + "15" = { + version = "1.7.0"; + hash = "sha256-8pShPr4HJaJQPjW1iPJIpj3CutTx8Tgr+rOqoXtgCcw="; + }; + } + .${lib.versions.major postgresql.version} + or (throw "Source for pgaudit is not available for ${postgresql.version}"); in stdenv.mkDerivation { pname = "pgaudit"; @@ -27,7 +37,11 @@ stdenv.mkDerivation { hash = source.hash; }; - buildInputs = [ libkrb5 openssl postgresql ]; + buildInputs = [ + libkrb5 + openssl + postgresql + ]; makeFlags = [ "USE_PGXS=1" ]; diff --git a/nix/ext/pgjwt.nix b/nix/ext/pgjwt.nix index 4ecd76339..1a2f895b7 100644 --- a/nix/ext/pgjwt.nix +++ b/nix/ext/pgjwt.nix @@ -1,13 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, unstableGitUpdater }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + unstableGitUpdater, +}: stdenv.mkDerivation rec { pname = "pgjwt"; version = "9742dab1b2f297ad3811120db7b21451bca2d3c9"; src = fetchFromGitHub { - owner = "michelp"; - repo = "pgjwt"; - rev = "${version}"; + owner = "michelp"; + repo = "pgjwt"; + rev = "${version}"; hash = "sha256-Hw3R9bMGDmh+dMzjmqZSy/rT4mX8cPU969OJiARFg10="; }; diff --git a/nix/ext/pgmq.nix b/nix/ext/pgmq.nix index 97a3c27e3..e718c1d02 100644 --- a/nix/ext/pgmq.nix +++ b/nix/ext/pgmq.nix @@ -1,13 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pgmq"; version = "1.4.4"; buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "tembo-io"; - repo = pname; - rev = "v${version}"; + owner = "tembo-io"; + repo = pname; + rev = "v${version}"; hash = "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw="; }; @@ -25,9 +30,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres."; - homepage = "https://github.com/tembo-io/pgmq"; + homepage = "https://github.com/tembo-io/pgmq"; maintainers = with maintainers; [ olirice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/nix/ext/pgroonga.nix b/nix/ext/pgroonga.nix index de0dedc93..d57efc8fb 100644 --- a/nix/ext/pgroonga.nix +++ b/nix/ext/pgroonga.nix @@ -1,7 +1,15 @@ -{ lib, stdenv, fetchurl, pkg-config, postgresql, msgpack-c, callPackage, mecab, makeWrapper, xxHash }: -let - supabase-groonga = callPackage ../supabase-groonga.nix { }; -in +{ + lib, + stdenv, + fetchurl, + pkg-config, + postgresql, + msgpack-c, + mecab, + makeWrapper, + xxHash, + supabase-groonga, +}: stdenv.mkDerivation rec { pname = "pgroonga"; version = "3.2.5"; @@ -9,12 +17,19 @@ stdenv.mkDerivation rec { url = "https://packages.groonga.org/source/$%7Bpname%7D/$%7Bpname%7D-$%7Bversion%7D.tar.gz"; sha256 = "sha256-GM9EOQty72hdE4Ecq8jpDudhZLiH3pP9ODLxs8DXcSY="; }; - nativeBuildInputs = [ pkg-config makeWrapper ]; - - buildInputs = [ postgresql msgpack-c supabase-groonga mecab ] ++ lib.optionals stdenv.isDarwin [ - xxHash + + nativeBuildInputs = [ + pkg-config + makeWrapper ]; + buildInputs = [ + postgresql + msgpack-c + supabase-groonga + mecab + ] ++ lib.optionals stdenv.isDarwin [ xxHash ]; + propagatedBuildInputs = [ supabase-groonga ]; configureFlags = [ "--with-mecab=${mecab}" @@ -23,20 +38,22 @@ stdenv.mkDerivation rec { "--with-groonga-plugin-dir=${supabase-groonga}/lib/groonga/plugins" ]; - makeFlags = [ + makeFlags = [ "HAVE_MSGPACK=1" "MSGPACK_PACKAGE_NAME=msgpack-c" "HAVE_MECAB=1" ]; - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (builtins.concatStringsSep " " [ - "-Wno-error=incompatible-function-pointer-types" - "-Wno-error=format" - "-Wno-format" - "-I${supabase-groonga}/include/groonga" - "-I${xxHash}/include" - "-DPGRN_VERSION=\"${version}\"" - ]); + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ( + builtins.concatStringsSep " " [ + "-Wno-error=incompatible-function-pointer-types" + "-Wno-error=format" + "-Wno-format" + "-I${supabase-groonga}/include/groonga" + "-I${xxHash}/include" + "-DPGRN_VERSION=\"${version}\"" + ] + ); preConfigure = '' export GROONGA_LIBS="-L${supabase-groonga}/lib -lgroonga" diff --git a/nix/ext/pgrouting.nix b/nix/ext/pgrouting.nix index 3e898022f..e51b8bada 100644 --- a/nix/ext/pgrouting.nix +++ b/nix/ext/pgrouting.nix @@ -1,30 +1,45 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, perl, cmake, boost }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + perl, + cmake, + boost, +}: stdenv.mkDerivation rec { pname = "pgrouting"; version = "3.4.1"; - nativeBuildInputs = [ cmake perl ]; - buildInputs = [ postgresql boost ]; + nativeBuildInputs = [ + cmake + perl + ]; + buildInputs = [ + postgresql + boost + ]; src = fetchFromGitHub { - owner = "pgRouting"; - repo = pname; - rev = "v${version}"; + owner = "pgRouting"; + repo = pname; + rev = "v${version}"; hash = "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="; }; #disable compile time warnings for incompatible pointer types only on macos and pg16 - NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") - "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types"; - - cmakeFlags = [ - "-DPOSTGRESQL_VERSION=${postgresql.version}" - ] ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [ - "-DCMAKE_MACOSX_RPATH=ON" - "-DCMAKE_SHARED_MODULE_SUFFIX=.dylib" - "-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib" - ]; + NIX_CFLAGS_COMPILE = lib.optionalString ( + stdenv.isDarwin && lib.versionAtLeast postgresql.version "16" + ) "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types"; + + cmakeFlags = + [ "-DPOSTGRESQL_VERSION=${postgresql.version}" ] + ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [ + "-DCMAKE_MACOSX_RPATH=ON" + "-DCMAKE_SHARED_MODULE_SUFFIX=.dylib" + "-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib" + ]; preConfigure = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' export DLSUFFIX=.dylib @@ -51,9 +66,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A PostgreSQL/PostGIS extension that provides geospatial routing functionality"; - homepage = "https://pgrouting.org/"; - changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v$%7Bversion%7D"; - platforms = postgresql.meta.platforms; - license = licenses.gpl2Plus; + homepage = "https://pgrouting.org/"; + changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v$%7Bversion%7D"; + platforms = postgresql.meta.platforms; + license = licenses.gpl2Plus; }; } diff --git a/nix/ext/pgsodium.nix b/nix/ext/pgsodium.nix index ec2979499..d843d434f 100644 --- a/nix/ext/pgsodium.nix +++ b/nix/ext/pgsodium.nix @@ -1,10 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, libsodium, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + libsodium, + postgresql, +}: stdenv.mkDerivation rec { pname = "pgsodium"; version = "3.1.8"; - buildInputs = [ libsodium postgresql ]; + buildInputs = [ + libsodium + postgresql + ]; src = fetchFromGitHub { owner = "michelp"; diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index 8b74f191b..9f4bae789 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -1,10 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, curl, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + curl, + postgresql, +}: stdenv.mkDerivation rec { pname = "pgsql-http"; version = "1.6.1"; - buildInputs = [ curl postgresql ]; + buildInputs = [ + curl + postgresql + ]; src = fetchFromGitHub { owner = "pramsey"; diff --git a/nix/ext/pgtap.nix b/nix/ext/pgtap.nix index 159fec433..47d211556 100644 --- a/nix/ext/pgtap.nix +++ b/nix/ext/pgtap.nix @@ -1,4 +1,12 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, perl, perlPackages, which }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + perl, + perlPackages, + which, +}: stdenv.mkDerivation rec { pname = "pgtap"; @@ -11,7 +19,12 @@ stdenv.mkDerivation rec { hash = "sha256-lb0PRffwo6J5a6Hqw1ggvn0cW7gPZ02OEcLPi9ineI8="; }; - nativeBuildInputs = [ postgresql perl perlPackages.TAPParserSourceHandlerpgTAP which ]; + nativeBuildInputs = [ + postgresql + perl + perlPackages.TAPParserSourceHandlerpgTAP + which + ]; installPhase = '' install -D {sql/pgtap--${version}.sql,pgtap.control} -t $out/share/postgresql/extension diff --git a/nix/ext/pgvector.nix b/nix/ext/pgvector.nix index a7d58ec61..60a8efea3 100644 --- a/nix/ext/pgvector.nix +++ b/nix/ext/pgvector.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "pgvector"; diff --git a/nix/ext/pljava.nix b/nix/ext/pljava.nix index 51c5e1317..bac5a6646 100644 --- a/nix/ext/pljava.nix +++ b/nix/ext/pljava.nix @@ -1,23 +1,48 @@ -{ stdenv, lib, fetchFromGitHub, openssl, openjdk, maven, postgresql, libkrb5, makeWrapper, gcc, pkg-config, which }: +{ + stdenv, + lib, + fetchFromGitHub, + openssl, + openjdk, + maven, + postgresql, + libkrb5, + makeWrapper, + gcc, + pkg-config, + which, +}: maven.buildMavenPackage rec { pname = "pljava"; - version = "1.6.7"; + version = "1.6.7"; src = fetchFromGitHub { owner = "tada"; repo = "pljava"; - rev = "V1_6_7"; - sha256 = "sha256-M17adSLsw47KZ2BoUwxyWkXKRD8TcexDAy61Yfw4fNU="; - + rev = "V1_6_7"; + sha256 = "sha256-M17adSLsw47KZ2BoUwxyWkXKRD8TcexDAy61Yfw4fNU="; }; - mvnParameters = "clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true"; + mvnParameters = "clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true"; mvnHash = "sha256-lcxRduh/nKcPL6YQIVTsNH0L4ga0LgJpQKgX5IPkRzs="; - - nativeBuildInputs = [ makeWrapper maven openjdk postgresql openssl postgresql gcc libkrb5 pkg-config ]; - buildInputs = [ stdenv.cc.cc.lib which]; + + nativeBuildInputs = [ + makeWrapper + maven + openjdk + postgresql + openssl + postgresql + gcc + libkrb5 + pkg-config + ]; + buildInputs = [ + stdenv.cc.cc.lib + which + ]; buildPhase = '' export PATH=$(lib.makeBinPath [ postgresql ]):$PATH @@ -44,7 +69,7 @@ maven.buildMavenPackage rec { meta = with lib; { description = "PL/Java extension for PostgreSQL"; - homepage = https://github.com/tada/pljava; + homepage = "https://github.com/tada/pljava"; license = licenses.bsd3; }; } diff --git a/nix/ext/plpgsql-check.nix b/nix/ext/plpgsql-check.nix index 7be2aac2a..41312b1c7 100644 --- a/nix/ext/plpgsql-check.nix +++ b/nix/ext/plpgsql-check.nix @@ -1,4 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, postgresql, postgresqlTestHook }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + postgresqlTestHook, +}: stdenv.mkDerivation rec { pname = "plpgsql-check"; diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index b3fd03e07..9eaa40459 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -1,19 +1,17 @@ -{ stdenv -, lib -, fetchFromGitHub -, v8 -, perl -, postgresql -# For passthru test on various systems, and local development on macos -# not we are not currently using passthru tests but retaining for possible contrib -# to nixpkgs -, runCommand -, coreutils -, gnugrep -, clang -, xcbuild -, darwin -, patchelf +{ + stdenv, + lib, + fetchFromGitHub, + v8, + perl, + postgresql, + # For passthru test on various systems, and local development on macos + # not we are not currently using passthru tests but retaining for possible contrib + # to nixpkgs + clang, + xcbuild, + darwin, + patchelf, }: stdenv.mkDerivation (finalAttrs: { @@ -33,50 +31,58 @@ stdenv.mkDerivation (finalAttrs: { ./0001-build-Allow-using-V8-from-system.patch ]; - nativeBuildInputs = [ - perl - ] ++ lib.optionals stdenv.isDarwin [ - clang - xcbuild - ]; - - buildInputs = [ - v8 - postgresql - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.Kerberos - ]; + nativeBuildInputs = + [ perl ] + ++ lib.optionals stdenv.isDarwin [ + clang + xcbuild + ]; + + buildInputs = + [ + v8 + postgresql + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreFoundation + darwin.apple_sdk.frameworks.Kerberos + ]; buildFlags = [ "all" ]; - makeFlags = [ - # Nixpkgs build a v8 monolith instead of separate v8_libplatform. - "USE_SYSTEM_V8=1" - "V8_OUTDIR=${v8}/lib" - "PG_CONFIG=${postgresql}/bin/pg_config" - ] ++ lib.optionals stdenv.isDarwin [ - "CC=${clang}/bin/clang" - "CXX=${clang}/bin/clang++" - "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib" - ] ++ lib.optionals (!stdenv.isDarwin) [ - "SHLIB_LINK=-lv8" - ]; - - NIX_LDFLAGS = (lib.optionals stdenv.isDarwin [ - "-L${postgresql}/lib" - "-L${v8}/lib" - "-lv8_monolith" - "-lpq" - "-lpgcommon" - "-lpgport" - "-F${darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks" - "-framework" "CoreFoundation" - "-F${darwin.apple_sdk.frameworks.Kerberos}/Library/Frameworks" - "-framework" "Kerberos" - "-undefined" "dynamic_lookup" - "-flat_namespace" - ]); + makeFlags = + [ + # Nixpkgs build a v8 monolith instead of separate v8_libplatform. + "USE_SYSTEM_V8=1" + "V8_OUTDIR=${v8}/lib" + "PG_CONFIG=${postgresql}/bin/pg_config" + ] + ++ lib.optionals stdenv.isDarwin [ + "CC=${clang}/bin/clang" + "CXX=${clang}/bin/clang++" + "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib" + ] + ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; + + NIX_LDFLAGS = ( + lib.optionals stdenv.isDarwin [ + "-L${postgresql}/lib" + "-L${v8}/lib" + "-lv8_monolith" + "-lpq" + "-lpgcommon" + "-lpgport" + "-F${darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks" + "-framework" + "CoreFoundation" + "-F${darwin.apple_sdk.frameworks.Kerberos}/Library/Frameworks" + "-framework" + "Kerberos" + "-undefined" + "dynamic_lookup" + "-flat_namespace" + ] + ); installFlags = [ # PGXS only supports installing to postgresql prefix so we need to redirect this @@ -97,7 +103,7 @@ stdenv.mkDerivation (finalAttrs: { ''} ''; - postInstall = '' + postInstall = '' # Move the redirected to proper directory. # There appear to be no references to the install directories # so changing them does not cause issues. @@ -119,9 +125,11 @@ stdenv.mkDerivation (finalAttrs: { install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8.so ''} - ${lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so - ''} + ${ + lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so + '' + } else ${lib.optionalString stdenv.isDarwin '' install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} @@ -130,16 +138,23 @@ stdenv.mkDerivation (finalAttrs: { install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} ''} - ${lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - ''} + ${ + lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + '' + } fi ''; meta = with lib; { description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; homepage = "https://plv8.github.io/"; - platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; license = licenses.postgresql; }; }) diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index e5ccda443..27a449210 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -1,18 +1,20 @@ -{ fetchurl -, lib, stdenv -, perl -, libxml2 -, postgresql -, geos -, proj -, json_c -, pkg-config -, file -, protobufc -, libiconv -, pcre2 -, nixosTests -, callPackage +{ + fetchurl, + lib, + stdenv, + perl, + libxml2, + postgresql, + geos, + proj, + json_c, + pkg-config, + file, + protobufc, + libiconv, + pcre2, + nixosTests, + callPackage, }: let @@ -23,19 +25,33 @@ stdenv.mkDerivation rec { pname = "postgis"; version = "3.3.7"; - outputs = [ "out" "doc" ]; + outputs = [ + "out" + "doc" + ]; src = fetchurl { url = "https://download.osgeo.org/postgis/source/postgis-$%7Bversion%7D.tar.gz"; sha256 = "sha256-UHJKDd5JrcJT5Z4CTYsY/va+ToU0GUPG1eHhuXTkP84="; }; - buildInputs = [ libxml2 postgresql geos proj gdal json_c protobufc pcre2.dev sfcgal ] - ++ lib.optional stdenv.isDarwin libiconv; - nativeBuildInputs = [ perl pkg-config ]; + buildInputs = [ + libxml2 + postgresql + geos + proj + gdal + json_c + protobufc + pcre2.dev + sfcgal + ] ++ lib.optional stdenv.isDarwin libiconv; + nativeBuildInputs = [ + perl + pkg-config + ]; dontDisableStatic = true; - env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib"; preConfigure = '' @@ -57,22 +73,22 @@ stdenv.mkDerivation rec { ln -s ${postgresql}/bin/postgres $out/bin/postgres ''; -postInstall = '' - rm $out/bin/postgres - for prog in $out/bin/*; do # */ - ln -s $prog $prog-${version} - done - # Add function definition and usage to tiger geocoder files - for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do - sed -i "/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');" "$file" - done - # Original topology patching - for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do - sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" - done - mkdir -p $doc/share/doc/postgis - mv doc/* $doc/share/doc/postgis/ -''; + postInstall = '' + rm $out/bin/postgres + for prog in $out/bin/*; do # */ + ln -s $prog $prog-${version} + done + # Add function definition and usage to tiger geocoder files + for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do + sed -i "/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');" "$file" + done + # Original topology patching + for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do + sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" + done + mkdir -p $doc/share/doc/postgis + mv doc/* $doc/share/doc/postgis/ + ''; passthru.tests.postgis = nixosTests.postgis; diff --git a/nix/ext/rum.nix b/nix/ext/rum.nix index 574ef3d3a..9dc5d9525 100644 --- a/nix/ext/rum.nix +++ b/nix/ext/rum.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "rum"; diff --git a/nix/ext/sfcgal/sfcgal.nix b/nix/ext/sfcgal/sfcgal.nix index b1d5842f8..da962cbf8 100644 --- a/nix/ext/sfcgal/sfcgal.nix +++ b/nix/ext/sfcgal/sfcgal.nix @@ -1,4 +1,14 @@ -{ lib, stdenv, fetchFromGitLab, cgal, cmake, pkg-config, gmp, mpfr, boost }: +{ + lib, + stdenv, + fetchFromGitLab, + cgal, + cmake, + pkg-config, + gmp, + mpfr, + boost, +}: stdenv.mkDerivation rec { pname = "sfcgal"; @@ -11,10 +21,19 @@ stdenv.mkDerivation rec { hash = "sha256-nKSqiFyMkZAYptIeShb1zFg9lYSny3kcGJfxdeTFqxw="; }; - nativeBuildInputs = [ cmake pkg-config cgal gmp mpfr boost ]; - - cmakeFlags = [ "-DCGAL_DIR=${cgal}" "-DCMAKE_PREFIX_PATH=${cgal}" ]; + nativeBuildInputs = [ + cmake + pkg-config + cgal + gmp + mpfr + boost + ]; + cmakeFlags = [ + "-DCGAL_DIR=${cgal}" + "-DCMAKE_PREFIX_PATH=${cgal}" + ]; postPatch = '' substituteInPlace sfcgal.pc.in \ @@ -24,7 +43,10 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A wrapper around CGAL that intents to implement 2D and 3D operations on OGC standards models"; homepage = "https://sfcgal.gitlab.io/SFCGAL/"; - license = with licenses; [ gpl3Plus lgpl3Plus]; + license = with licenses; [ + gpl3Plus + lgpl3Plus + ]; platforms = platforms.all; }; } diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index bb01bac55..75c5c029b 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "supautils"; diff --git a/nix/ext/timescaledb-2.9.1.nix b/nix/ext/timescaledb-2.9.1.nix index 92d5d73fe..0df743671 100644 --- a/nix/ext/timescaledb-2.9.1.nix +++ b/nix/ext/timescaledb-2.9.1.nix @@ -1,11 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + postgresql, + openssl, + libkrb5, +}: stdenv.mkDerivation rec { pname = "timescaledb-apache"; version = "2.9.1"; nativeBuildInputs = [ cmake ]; - buildInputs = [ postgresql openssl libkrb5 ]; + buildInputs = [ + postgresql + openssl + libkrb5 + ]; src = fetchFromGitHub { owner = "timescale"; @@ -14,8 +26,12 @@ stdenv.mkDerivation rec { hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8="; }; - cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" "-DAPACHE_ONLY=1" ] - ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; + cmakeFlags = [ + "-DSEND_TELEMETRY_DEFAULT=OFF" + "-DREGRESS_CHECKS=OFF" + "-DTAP_CHECKS=OFF" + "-DAPACHE_ONLY=1" + ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; # Fix the install phase which tries to install into the pgsql extension dir, # and cannot be manually overridden. This is rather fragile but works OK. @@ -31,7 +47,6 @@ stdenv.mkDerivation rec { done ''; - # timescaledb-2.9.1.so already exists in the lib directory # we have no need for the timescaledb.so or control file postInstall = '' diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 1d7360762..6f5681546 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -1,11 +1,23 @@ -{ lib, stdenv, fetchFromGitHub, cmake, postgresql, openssl, libkrb5 }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + postgresql, + openssl, + libkrb5, +}: stdenv.mkDerivation rec { pname = "timescaledb-apache"; version = "2.16.1"; nativeBuildInputs = [ cmake ]; - buildInputs = [ postgresql openssl libkrb5 ]; + buildInputs = [ + postgresql + openssl + libkrb5 + ]; src = fetchFromGitHub { owner = "timescale"; @@ -14,8 +26,12 @@ stdenv.mkDerivation rec { hash = "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w="; }; - cmakeFlags = [ "-DSEND_TELEMETRY_DEFAULT=OFF" "-DREGRESS_CHECKS=OFF" "-DTAP_CHECKS=OFF" "-DAPACHE_ONLY=1" ] - ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; + cmakeFlags = [ + "-DSEND_TELEMETRY_DEFAULT=OFF" + "-DREGRESS_CHECKS=OFF" + "-DTAP_CHECKS=OFF" + "-DAPACHE_ONLY=1" + ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; # Fix the install phase which tries to install into the pgsql extension dir, # and cannot be manually overridden. This is rather fragile but works OK. diff --git a/nix/ext/vault.nix b/nix/ext/vault.nix index fcc1a9129..275d6967c 100644 --- a/nix/ext/vault.nix +++ b/nix/ext/vault.nix @@ -1,10 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, libsodium, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + libsodium, + postgresql, +}: stdenv.mkDerivation rec { pname = "vault"; version = "0.3.1"; - buildInputs = [ libsodium postgresql ]; + buildInputs = [ + libsodium + postgresql + ]; src = fetchFromGitHub { owner = "supabase"; diff --git a/nix/ext/wal2json.nix b/nix/ext/wal2json.nix index b1f532dcf..deba7f1c6 100644 --- a/nix/ext/wal2json.nix +++ b/nix/ext/wal2json.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, postgresql }: +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, +}: stdenv.mkDerivation rec { pname = "wal2json"; @@ -7,7 +12,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "eulerto"; repo = "wal2json"; - rev = "wal2json_${builtins.replaceStrings ["."] ["_"] version}"; + rev = "wal2json_${builtins.replaceStrings [ "." ] [ "_" ] version}"; hash = "sha256-+QoACPCKiFfuT2lJfSUmgfzC5MXf75KpSoc2PzPxKyM="; }; diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 2bd424942..fe8074189 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -1,15 +1,14 @@ -{ lib -, stdenv -, fetchFromGitHub -, openssl -, pkg-config -, postgresql -, buildPgrxExtension_0_12_9 -, cargo -, darwin -, jq -, rust-bin -, git +{ + lib, + stdenv, + fetchFromGitHub, + openssl, + pkg-config, + postgresql, + buildPgrxExtension_0_12_9, + darwin, + rust-bin, + git, }: let rustVersion = "1.84.0"; @@ -20,7 +19,35 @@ buildPgrxExtension_0_12_9 rec { version = "0.5.0"; # update the following array when the wrappers version is updated # required to ensure that extensions update scripts from previous versions are generated - previousVersions = ["0.4.6" "0.4.5" "0.4.4" "0.4.3" "0.4.2" "0.4.1" "0.4.0" "0.3.1" "0.3.0" "0.2.0" "0.1.19" "0.1.18" "0.1.17" "0.1.16" "0.1.15" "0.1.14" "0.1.12" "0.1.11" "0.1.10" "0.1.9" "0.1.8" "0.1.7" "0.1.6" "0.1.5" "0.1.4" "0.1.1" "0.1.0"]; + previousVersions = [ + "0.4.6" + "0.4.5" + "0.4.4" + "0.4.3" + "0.4.2" + "0.4.1" + "0.4.0" + "0.3.1" + "0.3.0" + "0.2.0" + "0.1.19" + "0.1.18" + "0.1.17" + "0.1.16" + "0.1.15" + "0.1.14" + "0.1.12" + "0.1.11" + "0.1.10" + "0.1.9" + "0.1.8" + "0.1.7" + "0.1.6" + "0.1.5" + "0.1.4" + "0.1.1" + "0.1.0" + ]; inherit postgresql; src = fetchFromGitHub { owner = "supabase"; @@ -28,13 +55,22 @@ buildPgrxExtension_0_12_9 rec { rev = "v${version}"; hash = "sha256-FbRTUcpEHBa5DI6dutvBeahYM0RZVAXIzIAZWIaxvn0"; }; - - nativeBuildInputs = [ pkg-config cargo git ]; - buildInputs = [ openssl postgresql ] ++ lib.optionals (stdenv.isDarwin) [ - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration + + nativeBuildInputs = [ + pkg-config + cargo + git ]; + buildInputs = + [ + openssl + postgresql + ] + ++ lib.optionals (stdenv.isDarwin) [ + darwin.apple_sdk.frameworks.CoreFoundation + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.SystemConfiguration + ]; NIX_LDFLAGS = "-L${postgresql}/lib -lpq"; @@ -50,16 +86,19 @@ buildPgrxExtension_0_12_9 rec { # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435 # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440 # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439 - PGPORT = toString (5534 + - (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB - ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2); # +2 for each major version + PGPORT = toString ( + 5534 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 + ); # +2 for each major version }; OPENSSL_NO_VENDOR = 1; #need to set this to 2 to avoid cpu starvation CARGO_BUILD_JOBS = "2"; - CARGO="${cargo}/bin/cargo"; - + CARGO = "${cargo}/bin/cargo"; + #CARGO_NET_GIT_FETCH_WITH_CLI = "true"; cargoLock = { lockFile = "${src}/Cargo.lock"; @@ -69,9 +108,9 @@ buildPgrxExtension_0_12_9 rec { }; }; - preConfigure = '' + preConfigure = '' cd wrappers - + # update the clickhouse-rs dependency # append the branch name to the git URL to help cargo locate the commit # while maintaining the rev for reproducibility @@ -93,17 +132,17 @@ buildPgrxExtension_0_12_9 rec { } { print } ' Cargo.toml - + # Verify the file is still valid TOML, break build with this error # if it is not if ! cargo verify-project 2>/dev/null; then echo "Failed to maintain valid TOML syntax" exit 1 fi - + cd .. ''; - + buildAndTestSubdir = "wrappers"; buildFeatures = [ "helloworld_fdw" @@ -116,53 +155,53 @@ buildPgrxExtension_0_12_9 rec { echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt ''; - postInstall = '' - echo "Modifying main SQL file to use unversioned library name..." - current_version="${version}" - main_sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql" - if [ -f "$main_sql_file" ]; then - sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$main_sql_file" - echo "Modified $main_sql_file" - else - echo "Warning: $main_sql_file not found" - fi - echo "Creating and modifying SQL files for previous versions..." - - if [ -f "$main_sql_file" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql" - echo "Creating $new_file" - cp "$main_sql_file" "$new_file" - sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$new_file" - echo "Modified $new_file" - fi - done < git_tags.txt - else - echo "Warning: $main_sql_file not found" - fi - mv $out/lib/wrappers-${version}${postgresql.dlSuffix} $out/lib/wrappers${postgresql.dlSuffix} - ln -s $out/lib/wrappers${postgresql.dlSuffix} $out/lib/wrappers-${version}${postgresql.dlSuffix} + postInstall = '' + echo "Modifying main SQL file to use unversioned library name..." + current_version="${version}" + main_sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql" + if [ -f "$main_sql_file" ]; then + sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$main_sql_file" + echo "Modified $main_sql_file" + else + echo "Warning: $main_sql_file not found" + fi + echo "Creating and modifying SQL files for previous versions..." + + if [ -f "$main_sql_file" ]; then + while read -r previous_version; do + if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then + new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql" + echo "Creating $new_file" + cp "$main_sql_file" "$new_file" + sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$new_file" + echo "Modified $new_file" + fi + done < git_tags.txt + else + echo "Warning: $main_sql_file not found" + fi + mv $out/lib/wrappers-${version}${postgresql.dlSuffix} $out/lib/wrappers${postgresql.dlSuffix} + ln -s $out/lib/wrappers${postgresql.dlSuffix} $out/lib/wrappers-${version}${postgresql.dlSuffix} - echo "Creating wrappers.so symlinks to support pg_upgrade..." - if [ -f "$out/lib/wrappers.so" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/lib/wrappers-$previous_version.so" - echo "Creating $new_file" - ln -s "$out/lib/wrappers.so" "$new_file" - fi - done < git_tags.txt - else - echo "Warning: $out/lib/wrappers.so not found" - fi + echo "Creating wrappers.so symlinks to support pg_upgrade..." + if [ -f "$out/lib/wrappers.so" ]; then + while read -r previous_version; do + if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then + new_file="$out/lib/wrappers-$previous_version.so" + echo "Creating $new_file" + ln -s "$out/lib/wrappers.so" "$new_file" + fi + done < git_tags.txt + else + echo "Warning: $out/lib/wrappers.so not found" + fi - rm git_tags.txt - echo "Contents of updated wrappers.control:" - cat "$out/share/postgresql/extension/wrappers.control" - echo "List of generated SQL files:" - ls -l $out/share/postgresql/extension/wrappers--*.sql - ''; + rm git_tags.txt + echo "Contents of updated wrappers.control:" + cat "$out/share/postgresql/extension/wrappers.control" + echo "List of generated SQL files:" + ls -l $out/share/postgresql/extension/wrappers--*.sql + ''; meta = with lib; { description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; diff --git a/nix/fmt.nix b/nix/fmt.nix new file mode 100644 index 000000000..760cb5930 --- /dev/null +++ b/nix/fmt.nix @@ -0,0 +1,12 @@ +{ inputs, ... }: +{ + imports = [ inputs.treefmt-nix.flakeModule ]; + perSystem = + { pkgs, ... }: + { + treefmt.programs.deadnix.enable = true; + + treefmt.programs.nixfmt.enable = true; + treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style; + }; +} diff --git a/nix/hooks.nix b/nix/hooks.nix new file mode 100644 index 000000000..896c262ba --- /dev/null +++ b/nix/hooks.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: +{ + imports = [ inputs.git-hooks.flakeModule ]; + perSystem = + { config, ... }: + { + pre-commit = { + check.enable = true; + settings = { + hooks = { + treefmt = { + enable = true; + package = config.treefmt.build.wrapper; + }; + }; + }; + }; + }; +} diff --git a/nix/mkdocs.yml b/nix/mkdocs.yml new file mode 100644 index 000000000..f472b51c4 --- /dev/null +++ b/nix/mkdocs.yml @@ -0,0 +1,132 @@ +# Project info +site_name: Postgres by Supabase +site_description: >- + Provide some of the most common Postgres extensions with a one-click install. + +# Repository +repo_name: supabase/postgres +repo_url: https://github.com/supabase/postgres + +nav: + - Home: README.md + - Development: + - Getting Started: start-here.md + - Nix tree structure: nix-directory-structure.md + - Workflow: development-workflow.md + - Build PostgreSQL: build-postgres.md + - Start Client/Server: start-client-server.md + - Docker: docker.md + - Use direnv: use-direnv.md + - Code Formatter: nix-formatter.md + - Pre-commit Hooks: pre-commit-hooks.md + - Documentation: documentation.md + - Package Management: + - Adding New Packages: adding-new-package.md + - Update Extensions: update-extension.md + - New Major PostgreSQL: new-major-postgres.md + - Nix Overlays: nix-overlays.md + - Testing: + - Adding Tests: adding-tests.md + - Migration Tests: migration-tests.md + - Testing PG Upgrade Scripts: testing-pg-upgrade-scripts.md + - References: references.md + +validation: + omitted_files: warn + absolute_links: warn + unrecognized_links: warn + +# Configuration + +docs_dir: docs +site_dir: out + +theme: + name: material + + logo: assets/images/logo.png + favicon: assets/images/logo.png + + features: + - content.code.annotate + - content.code.copy + - navigation.footer + - navigation.indexes + - navigation.path + - navigation.sections + - navigation.tabs + - navigation.tracking + - search.highlight + - search.share + - search.suggest + + font: + text: Inter + mono: Noto Sans Mono + palette: + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference + +extra: + version: + provider: mike + social: + - icon: fontawesome/brands/github + link: https://github.com/supabase/postgres + +extra_css: + - stylesheets/extra.css + +markdown_extensions: + - tables + - admonition + - attr_list + - footnotes + - md_in_html + - def_list + - meta + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + - pymdownx.details + - pymdownx.highlight: + use_pygments: true + linenums: true + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets: + base_path: ../. + - pymdownx.keys + - pymdownx.superfences: + # make exceptions to highlighting of code: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:mermaid2.fence_mermaid_custom + +plugins: + - mike + - search + - mermaid2 diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix new file mode 100644 index 000000000..005dd80aa --- /dev/null +++ b/nix/nixpkgs.nix @@ -0,0 +1,16 @@ +{ self, inputs, ... }: +{ + perSystem = + { system, ... }: + { + _module.args.pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + permittedInsecurePackages = [ "v8-9.7.106.18" ]; + overlays = [ + (import inputs.rust-overlay) + self.overlays.default + ]; + }; + }; +} diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix new file mode 100644 index 000000000..f6eda4243 --- /dev/null +++ b/nix/overlays/default.nix @@ -0,0 +1,55 @@ +{ self, ... }: +{ + flake.overlays.default = final: prev: { + # NOTE: add any needed overlays here. in theory we could + # pull them from the overlays/ directory automatically, but we don't + # want to have an arbitrary order, since it might matter. being + # explicit is better. + + inherit (self.packages.${final.system}) + postgresql_15 + postgresql_17 + postgresql_orioledb-17 + supabase-groonga + ; + + xmrig = throw "The xmrig package has been explicitly disabled in this flake."; + + cargo-pgrx = final.callPackage ../cargo-pgrx/default.nix { + inherit (final) lib; + inherit (final) darwin; + inherit (final) fetchCrate; + inherit (final) openssl; + inherit (final) pkg-config; + inherit (final) makeRustPlatform; + inherit (final) stdenv; + inherit (final) rust-bin; + }; + + buildPgrxExtension = final.callPackage ../cargo-pgrx/buildPgrxExtension.nix { + inherit (final) cargo-pgrx; + inherit (final) lib; + inherit (final) Security; + inherit (final) pkg-config; + inherit (final) makeRustPlatform; + inherit (final) stdenv; + inherit (final) writeShellScriptBin; + }; + + buildPgrxExtension_0_11_3 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_3; + }; + + buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6; + }; + + buildPgrxExtension_0_12_9 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9; + }; + + buildPgrxExtension_0_14_3 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3; + }; + }; +} diff --git a/nix/packages/build-test-ami.nix b/nix/packages/build-test-ami.nix new file mode 100644 index 000000000..115ea793d --- /dev/null +++ b/nix/packages/build-test-ami.nix @@ -0,0 +1,158 @@ +{ pkgs, runCommand }: +runCommand "build-test-ami" + { + buildInputs = with pkgs; [ + packer + awscli2 + yq + jq + openssl + git + coreutils + aws-vault + ]; + } + '' + mkdir -p $out/bin + cat > $out/bin/build-test-ami << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: build-test-ami [--help] + + Build AMI images for PostgreSQL testing. + + This script will: + 1. Check for required tools and AWS authentication + 2. Build two AMI stages using Packer + 3. Clean up any temporary instances + 4. Output the final AMI name for use with run-testinfra + + Arguments: + postgres-version PostgreSQL major version to build (required) + + Options: + --help Show this help message and exit + + Requirements: + - AWS Vault profile must be set in AWS_VAULT environment variable + - Packer, AWS CLI, yq, jq, and OpenSSL must be installed + - Must be run from a git repository + + Example: + aws-vault exec -- nix run .#build-test-ami 15 + EOF + } + + # Handle help flag + if [[ "$#" -gt 0 && "$1" == "--help" ]]; then + show_help + exit 0 + fi + + export PATH="${ + pkgs.lib.makeBinPath ( + with pkgs; + [ + packer + awscli2 + yq + jq + openssl + git + coreutils + aws-vault + ] + ) + }:$PATH" + + # Check for required tools + for cmd in packer aws-vault yq jq openssl; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check AWS Vault profile + if [ -z "''${AWS_VAULT:-}" ]; then + echo "Error: AWS_VAULT environment variable must be set with the profile name" + echo "Usage: aws-vault exec -- nix run .#build-test-ami " + exit 1 + fi + + # Set values + REGION="ap-southeast-1" + POSTGRES_VERSION="$1" + RANDOM_STRING=$(openssl rand -hex 8) + GIT_SHA=$(git rev-parse HEAD) + RUN_ID=$(date +%s) + + # Generate common-nix.vars.pkr.hcl + PG_VERSION=$(yq -r ".postgres_release[\"postgres$POSTGRES_VERSION\"]" ansible/vars.yml) + echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl + + # Build AMI Stage 1 + packer init amazon-arm64-nix.pkr.hcl + packer build \ + -var "git-head-version=$GIT_SHA" \ + -var "packer-execution-id=$RUN_ID" \ + -var-file="development-arm.vars.pkr.hcl" \ + -var-file="common-nix.vars.pkr.hcl" \ + -var "ansible_arguments=" \ + -var "postgres-version=$RANDOM_STRING" \ + -var "region=$REGION" \ + -var 'ami_regions=["'"$REGION"'"]' \ + -var "force-deregister=true" \ + -var "ansible_arguments=-e postgresql_major=$POSTGRES_VERSION" \ + amazon-arm64-nix.pkr.hcl + + # Build AMI Stage 2 + packer init stage2-nix-psql.pkr.hcl + packer build \ + -var "git-head-version=$GIT_SHA" \ + -var "packer-execution-id=$RUN_ID" \ + -var "postgres_major_version=$POSTGRES_VERSION" \ + -var-file="development-arm.vars.pkr.hcl" \ + -var-file="common-nix.vars.pkr.hcl" \ + -var "postgres-version=$RANDOM_STRING" \ + -var "region=$REGION" \ + -var 'ami_regions=["'"$REGION"'"]' \ + -var "force-deregister=true" \ + -var "git_sha=$GIT_SHA" \ + stage2-nix-psql.pkr.hcl + + # Cleanup instances from AMI builds + cleanup_instances() { + echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." + aws ec2 --region $REGION describe-instances \ + --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ + --query "Reservations[].Instances[].InstanceId" \ + --output text | xargs -r aws ec2 terminate-instances \ + --region $REGION --instance-ids || true + } + + # Set up traps for various signals to ensure cleanup + trap cleanup_instances EXIT HUP INT QUIT TERM + + # Create and activate virtual environment + VENV_DIR=$(mktemp -d) + trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM + python3 -m venv "$VENV_DIR" + source "$VENV_DIR/bin/activate" + + # Install required Python packages + echo "Installing required Python packages..." + pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests + + # Run the tests with aws-vault + echo "Running tests for AMI: $RANDOM_STRING using AWS Vault profile: $AWS_VAULT_PROFILE" + aws-vault exec $AWS_VAULT_PROFILE -- pytest -vv -s testinfra/test_ami_nix.py + + # Deactivate virtual environment (cleanup is handled by trap) + deactivate + EOL + chmod +x $out/bin/build-test-ami + '' diff --git a/nix/packages/cleanup-ami.nix b/nix/packages/cleanup-ami.nix new file mode 100644 index 000000000..f1f9cde27 --- /dev/null +++ b/nix/packages/cleanup-ami.nix @@ -0,0 +1,61 @@ +{ pkgs, runCommand }: +runCommand "cleanup-ami" + { + buildInputs = with pkgs; [ + awscli2 + aws-vault + ]; + } + '' + mkdir -p $out/bin + cat > $out/bin/cleanup-ami << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + export PATH="${ + pkgs.lib.makeBinPath ( + with pkgs; + [ + awscli2 + aws-vault + ] + ) + }:$PATH" + + # Check for required tools + for cmd in aws-vault; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check AWS Vault profile + if [ -z "''${AWS_VAULT:-}" ]; then + echo "Error: AWS_VAULT environment variable must be set with the profile name" + echo "Usage: aws-vault exec -- nix run .#cleanup-ami " + exit 1 + fi + + # Check for AMI name argument + if [ -z "''${1:-}" ]; then + echo "Error: AMI name must be provided" + echo "Usage: aws-vault exec -- nix run .#cleanup-ami " + exit 1 + fi + + AMI_NAME="$1" + REGION="ap-southeast-1" + + # Deregister AMIs + for AMI_PATTERN in "supabase-postgres-ci-ami-test-stage-1" "$AMI_NAME"; do + aws ec2 describe-images --region $REGION --owners self \ + --filters "Name=name,Values=$AMI_PATTERN" \ + --query 'Images[*].ImageId' --output text | while read -r ami_id; do + echo "Deregistering AMI: $ami_id" + aws ec2 deregister-image --region $REGION --image-id "$ami_id" || true + done + done + EOL + chmod +x $out/bin/cleanup-ami + '' diff --git a/nix/packages/dbmate-tool.nix b/nix/packages/dbmate-tool.nix new file mode 100644 index 000000000..7ce2c5031 --- /dev/null +++ b/nix/packages/dbmate-tool.nix @@ -0,0 +1,45 @@ +{ + pkgs, + system, + defaults, +}: +let + migrationsDir = ../../migrations/db; + ansibleVars = ../../ansible/vars.yml; + pgbouncerAuthSchemaSql = ../../ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ../../ansible/files/stat_extension.sql; +in +pkgs.runCommand "dbmate-tool" + { + buildInputs = with pkgs; [ + overmind + dbmate + nix + jq + yq + ]; + nativeBuildInputs = with pkgs; [ makeWrapper ]; + } + '' + mkdir -p $out/bin $out/migrations + cp -r ${migrationsDir}/* $out + substitute ${../tools/dbmate-tool.sh.in} $out/bin/dbmate-tool \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${defaults.port}' \ + --subst-var-by 'MIGRATIONS_DIR' $out \ + --subst-var-by 'PGSQL_SUPERUSER' '${defaults.superuser}' \ + --subst-var-by 'ANSIBLE_VARS' ${ansibleVars} \ + --subst-var-by 'CURRENT_SYSTEM' '${system}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/dbmate-tool + wrapProgram $out/bin/dbmate-tool \ + --prefix PATH : ${ + pkgs.lib.makeBinPath [ + pkgs.overmind + pkgs.dbmate + pkgs.nix + pkgs.jq + pkgs.yq + ] + } + '' diff --git a/nix/packages/default.nix b/nix/packages/default.nix new file mode 100644 index 000000000..cd6d6a1d0 --- /dev/null +++ b/nix/packages/default.nix @@ -0,0 +1,78 @@ +{ self, ... }: +{ + imports = [ ./postgres.nix ]; + perSystem = + { + inputs', + lib, + pkgs, + self', + ... + }: + let + activeVersion = "15"; + # Function to create the pg_regress package + makePgRegress = + version: + let + postgresqlPackage = self'.packages."postgresql_${version}"; + in + pkgs.callPackage ../ext/pg_regress.nix { postgresql = postgresqlPackage; }; + pgsqlSuperuser = "supabase_admin"; + pkgs-lib = pkgs.callPackage ./lib.nix { + psql_15 = self'.packages."psql_15/bin"; + psql_17 = self'.packages."psql_17/bin"; + psql_orioledb-17 = self'.packages."psql_orioledb-17/bin"; + pgroonga = self'.packages."psql_15/exts/pgroonga"; + inherit (self.supabase) defaults; + }; + in + { + packages = ( + { + build-test-ami = pkgs.callPackage ./build-test-ami.nix { }; + cleanup-ami = pkgs.callPackage ./cleanup-ami.nix { }; + dbmate-tool = pkgs.callPackage ./dbmate-tool.nix { inherit (self.supabase) defaults; }; + docs = pkgs.callPackage ./docs.nix { }; + supabase-groonga = pkgs.callPackage ./groonga { }; + local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { }; + migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; }; + pg-restore = pkgs.callPackage ./pg-restore.nix { psql_15 = self'.packages."psql_15/bin"; }; + pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; + pg_regress = makePgRegress activeVersion; + run-testinfra = pkgs.callPackage ./run-testinfra.nix { }; + show-commands = pkgs.callPackage ./show-commands.nix { }; + start-client = pkgs.callPackage ./start-client.nix { + psql_15 = self'.packages."psql_15/bin"; + psql_17 = self'.packages."psql_17/bin"; + psql_orioledb-17 = self'.packages."psql_orioledb-17/bin"; + inherit (self.supabase) defaults; + }; + start-replica = pkgs.callPackage ./start-replica.nix { + psql_15 = self'.packages."psql_15/bin"; + inherit pgsqlSuperuser; + }; + start-server = pkgs-lib.makePostgresDevSetup { + inherit pkgs; + name = "start-postgres-server"; + }; + sync-exts-versions = pkgs.callPackage ./sync-exts-versions.nix { inherit (inputs') nix-editor; }; + trigger-nix-build = pkgs.callPackage ./trigger-nix-build.nix { }; + update-readme = pkgs.callPackage ./update-readme.nix { }; + inherit (pkgs.callPackage ./wal-g.nix { }) wal-g-2 wal-g-3; + inherit (pkgs.cargo-pgrx) + cargo-pgrx_0_11_3 + cargo-pgrx_0_12_6 + cargo-pgrx_0_12_9 + cargo-pgrx_0_14_3 + ; + } + // lib.filterAttrs (n: _v: n != "override" && n != "overrideAttrs" && n != "overrideDerivation") ( + pkgs.callPackage ../postgresql/default.nix { + inherit self'; + inherit (self.supabase) supportedPostgresVersions; + } + ) + ); + }; +} diff --git a/nix/packages/docs.nix b/nix/packages/docs.nix new file mode 100644 index 000000000..822661368 --- /dev/null +++ b/nix/packages/docs.nix @@ -0,0 +1,22 @@ +{ stdenvNoCC, python3Packages, ... }: +stdenvNoCC.mkDerivation { + name = "docs"; + + src = ../.; + + nativeBuildInputs = with python3Packages; [ + mike + mkdocs + mkdocs-material + mkdocs-linkcheck + mkdocs-mermaid2-plugin + ]; + + buildPhase = '' + mkdocs build + ''; + + installPhase = '' + mv out $out + ''; +} diff --git a/nix/supabase-groonga.nix b/nix/packages/groonga/default.nix similarity index 65% rename from nix/supabase-groonga.nix rename to nix/packages/groonga/default.nix index 5035f369f..3fcd4b691 100644 --- a/nix/supabase-groonga.nix +++ b/nix/packages/groonga/default.nix @@ -1,22 +1,59 @@ -{ lib, stdenv, cmake, fetchurl, kytea, msgpack-c, mecab, pkg-config, rapidjson -, testers, xxHash, zstd, postgresqlPackages, makeWrapper, suggestSupport ? false -, zeromq, libevent, openssl, lz4Support ? false, lz4, zlibSupport ? true, zlib -, writeShellScriptBin, callPackage }: -let mecab-naist-jdic = callPackage ./ext/mecab-naist-jdic { }; -in stdenv.mkDerivation (finalAttrs: { +{ + lib, + stdenv, + cmake, + fetchurl, + kytea, + msgpack-c, + mecab, + pkg-config, + rapidjson, + xxHash, + zstd, + makeWrapper, + suggestSupport ? false, + zeromq, + libevent, + lz4Support ? false, + lz4, + zlibSupport ? true, + zlib, + callPackage, +}: +let + mecab-naist-jdic = callPackage ../../ext/mecab-naist-jdic { }; +in +stdenv.mkDerivation (finalAttrs: { pname = "supabase-groonga"; version = "14.0.5"; src = fetchurl { - url = - "https://packages.groonga.org/source/groonga/groonga-$%7BfinalAttrs.version%7D.tar.gz"; + url = "https://packages.groonga.org/source/groonga/groonga-$%7BfinalAttrs.version%7D.tar.gz"; hash = "sha256-y4UGnv8kK0z+br8wXpPf57NMXkdEJHcLCuTvYiubnIc="; }; - patches = - [ ./fix-cmake-install-path.patch ./do-not-use-vendored-libraries.patch ]; - nativeBuildInputs = [ cmake pkg-config makeWrapper ]; - buildInputs = [ rapidjson xxHash zstd mecab kytea msgpack-c ] - ++ lib.optionals lz4Support [ lz4 ] ++ lib.optional zlibSupport [ zlib ] - ++ lib.optionals suggestSupport [ zeromq libevent ]; + patches = [ + ./fix-cmake-install-path.patch + ./do-not-use-vendored-libraries.patch + ]; + nativeBuildInputs = [ + cmake + pkg-config + makeWrapper + ]; + buildInputs = + [ + rapidjson + xxHash + zstd + mecab + kytea + msgpack-c + ] + ++ lib.optionals lz4Support [ lz4 ] + ++ lib.optional zlibSupport [ zlib ] + ++ lib.optionals suggestSupport [ + zeromq + libevent + ]; cmakeFlags = [ "-DWITH_MECAB=ON" "-DMECAB_DICDIR=${mecab-naist-jdic}/lib/mecab/dic/naist-jdic" @@ -58,8 +95,7 @@ in stdenv.mkDerivation (finalAttrs: { --set GRN_PLUGINS_DIR $out/lib/groonga/plugins ''; - env.NIX_CFLAGS_COMPILE = - lib.optionalString zlibSupport "-I${zlib.dev}/include"; + env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include"; meta = with lib; { homepage = "https://groonga.org/"; diff --git a/nix/do-not-use-vendored-libraries.patch b/nix/packages/groonga/do-not-use-vendored-libraries.patch similarity index 100% rename from nix/do-not-use-vendored-libraries.patch rename to nix/packages/groonga/do-not-use-vendored-libraries.patch diff --git a/nix/fix-cmake-install-path.patch b/nix/packages/groonga/fix-cmake-install-path.patch similarity index 100% rename from nix/fix-cmake-install-path.patch rename to nix/packages/groonga/fix-cmake-install-path.patch diff --git a/nix/packages/lib.nix b/nix/packages/lib.nix new file mode 100644 index 000000000..971909162 --- /dev/null +++ b/nix/packages/lib.nix @@ -0,0 +1,137 @@ +{ + psql_17, + psql_15, + psql_orioledb-17, + defaults, + supabase-groonga, + system, + pgroonga, +}: +{ + makePostgresDevSetup = + { + pkgs, + name, + extraSubstitutions ? { }, + }: + let + paths = { + migrationsDir = builtins.path { + name = "migrations"; + path = ../../migrations/db; + }; + postgresqlSchemaSql = builtins.path { + name = "postgresql-schema"; + path = ../tools/postgresql_schema.sql; + }; + pgbouncerAuthSchemaSql = builtins.path { + name = "pgbouncer-auth-schema"; + path = ../../ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + }; + statExtensionSql = builtins.path { + name = "stat-extension"; + path = ../../ansible/files/stat_extension.sql; + }; + pgconfigFile = builtins.path { + name = "postgresql.conf"; + path = ../../ansible/files/postgresql_config/postgresql.conf.j2; + }; + supautilsConfigFile = builtins.path { + name = "supautils.conf"; + path = ../../ansible/files/postgresql_config/supautils.conf.j2; + }; + loggingConfigFile = builtins.path { + name = "logging.conf"; + path = ../../ansible/files/postgresql_config/postgresql-csvlog.conf; + }; + readReplicaConfigFile = builtins.path { + name = "readreplica.conf"; + path = ../../ansible/files/postgresql_config/custom_read_replica.conf.j2; + }; + pgHbaConfigFile = builtins.path { + name = "pg_hba.conf"; + path = ../../ansible/files/postgresql_config/pg_hba.conf.j2; + }; + pgIdentConfigFile = builtins.path { + name = "pg_ident.conf"; + path = ../../ansible/files/postgresql_config/pg_ident.conf.j2; + }; + postgresqlExtensionCustomScriptsPath = builtins.path { + name = "extension-custom-scripts"; + path = ../../ansible/files/postgresql_extension_custom_scripts; + }; + getkeyScript = builtins.path { + name = "pgsodium_getkey.sh"; + path = ../tests/util/pgsodium_getkey.sh; + }; + }; + + localeArchive = + if pkgs.stdenv.isDarwin then + "${pkgs.darwin.locale}/share/locale" + else + "${pkgs.glibcLocales}/lib/locale/locale-archive"; + + substitutions = { + SHELL_PATH = "${pkgs.bash}/bin/bash"; + PGSQL_DEFAULT_PORT = "${defaults.port}"; + PGSQL_SUPERUSER = "${defaults.superuser}"; + PSQL15_BINDIR = "${psql_15}"; + PSQL17_BINDIR = "${psql_17}"; + PSQL_CONF_FILE = "${paths.pgconfigFile}"; + PSQLORIOLEDB17_BINDIR = "${psql_orioledb-17}"; + PGSODIUM_GETKEY = "${paths.getkeyScript}"; + READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; + LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; + SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; + PG_HBA = "${paths.pgHbaConfigFile}"; + PG_IDENT = "${paths.pgIdentConfigFile}"; + LOCALES = "${localeArchive}"; + EXTENSION_CUSTOM_SCRIPTS_DIR = "${paths.postgresqlExtensionCustomScriptsPath}"; + MECAB_LIB = "${pgroonga}/lib/groonga/plugins/tokenizers/tokenizer_mecab.so"; + GROONGA_DIR = "${supabase-groonga}"; + MIGRATIONS_DIR = "${paths.migrationsDir}"; + POSTGRESQL_SCHEMA_SQL = "${paths.postgresqlSchemaSql}"; + PGBOUNCER_AUTH_SCHEMA_SQL = "${paths.pgbouncerAuthSchemaSql}"; + STAT_EXTENSION_SQL = "${paths.statExtensionSql}"; + CURRENT_SYSTEM = "${system}"; + } // extraSubstitutions; # Merge in any extra substitutions + in + pkgs.runCommand name + { + inherit (paths) + migrationsDir + postgresqlSchemaSql + pgbouncerAuthSchemaSql + statExtensionSql + ; + } + '' + mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts + + # Copy config files with error handling + cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } + cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } + cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } + cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } + cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } + cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } + cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } + + echo "Copy operation completed" + chmod 644 $out/etc/postgresql-custom/supautils.conf + chmod 644 $out/etc/postgresql/postgresql.conf + chmod 644 $out/etc/postgresql-custom/logging.conf + chmod 644 $out/etc/postgresql/pg_hba.conf + + substitute ${../tools/run-server.sh.in} $out/bin/start-postgres-server \ + ${ + builtins.concatStringsSep " " ( + builtins.attrValues ( + builtins.mapAttrs (name: value: "--subst-var-by '${name}' '${value}'") substitutions + ) + ) + } + chmod +x $out/bin/start-postgres-server + ''; +} diff --git a/nix/packages/local-infra-bootstrap.nix b/nix/packages/local-infra-bootstrap.nix new file mode 100644 index 000000000..82e15de37 --- /dev/null +++ b/nix/packages/local-infra-bootstrap.nix @@ -0,0 +1,6 @@ +{ runCommand }: +runCommand "local-infra-bootstrap" { } '' + mkdir -p $out/bin + substitute ${./local-infra-bootstrap.sh.in} $out/bin/local-infra-bootstrap + chmod +x $out/bin/local-infra-bootstrap +'' diff --git a/nix/tools/local-infra-bootstrap.sh.in b/nix/packages/local-infra-bootstrap.sh.in similarity index 100% rename from nix/tools/local-infra-bootstrap.sh.in rename to nix/packages/local-infra-bootstrap.sh.in diff --git a/nix/packages/migrate-tool.nix b/nix/packages/migrate-tool.nix new file mode 100644 index 000000000..57f218a63 --- /dev/null +++ b/nix/packages/migrate-tool.nix @@ -0,0 +1,18 @@ +{ runCommand, psql_15 }: +let + configFile = ../tests/postgresql.conf.in; + getkeyScript = ../tests/util/pgsodium_getkey.sh; + primingScript = ../tests/prime.sql; + migrationData = ../tests/migrations/data.sql; +in +runCommand "migrate-postgres" { } '' + mkdir -p $out/bin + substitute ${../tools/migrate-tool.sh.in} $out/bin/migrate-postgres \ + --subst-var-by 'PSQL15_BINDIR' '${psql_15}' \ + --subst-var-by 'PSQL_CONF_FILE' '${configFile}' \ + --subst-var-by 'PGSODIUM_GETKEY' '${getkeyScript}' \ + --subst-var-by 'PRIMING_SCRIPT' '${primingScript}' \ + --subst-var-by 'MIGRATION_DATA' '${migrationData}' + + chmod +x $out/bin/migrate-postgres +'' diff --git a/nix/packages/pg-restore.nix b/nix/packages/pg-restore.nix new file mode 100644 index 000000000..aa01e7a7e --- /dev/null +++ b/nix/packages/pg-restore.nix @@ -0,0 +1,7 @@ +{ runCommand, psql_15 }: +runCommand "run-pg-restore" { } '' + mkdir -p $out/bin + substitute ${./run-restore.sh.in} $out/bin/pg-restore \ + --subst-var-by PSQL15_BINDIR '${psql_15}' + chmod +x $out/bin/pg-restore +'' diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix new file mode 100644 index 000000000..bf8710b4d --- /dev/null +++ b/nix/packages/postgres.nix @@ -0,0 +1,176 @@ +{ self, inputs, ... }: +{ + perSystem = + { pkgs, ... }: + let + gitRev = "vcs=${self.shortRev or "dirty"}+${ + builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101") + }"; + + # Custom extensions that exist in our repository. These aren't upstream + # either because nobody has done the work, maintaining them here is + # easier and more expedient, or because they may not be suitable, or are + # too niche/one-off. + # + # Ideally, most of these should have copies upstream for third party + # use, but even if they did, keeping our own copies means that we can + # rollout new versions of these critical things easier without having to + # go through the upstream release engineering process. + ourExtensions = [ + ../ext/rum.nix + ../ext/timescaledb.nix + ../ext/timescaledb-2.9.1.nix + ../ext/pgroonga.nix + ../ext/index_advisor.nix + ../ext/wal2json.nix + ../ext/pgmq.nix + ../ext/pg_repack.nix + ../ext/pg-safeupdate.nix + ../ext/plpgsql-check.nix + ../ext/pgjwt.nix + ../ext/pgaudit.nix + ../ext/postgis.nix + ../ext/pgrouting.nix + ../ext/pgtap.nix + ../ext/pg_cron.nix + ../ext/pgsql-http.nix + ../ext/pg_plan_filter.nix + ../ext/pg_net.nix + ../ext/pg_hashids.nix + ../ext/pgsodium.nix + ../ext/pg_graphql.nix + ../ext/pg_stat_monitor.nix + ../ext/pg_jsonschema.nix + ../ext/pgvector.nix + ../ext/vault.nix + ../ext/hypopg.nix + ../ext/pg_tle.nix + ../ext/wrappers/default.nix + ../ext/supautils.nix + ../ext/plv8.nix + ]; + + #Where we import and build the orioledb extension, we add on our custom extensions + # plus the orioledb option + #we're not using timescaledb or plv8 in the orioledb-17 version or pg 17 of supabase extensions + orioleFilteredExtensions = builtins.filter ( + x: x != ../ext/timescaledb.nix && x != ../ext/timescaledb-2.9.1.nix && x != ../ext/plv8.nix + ) ourExtensions; + + orioledbExtensions = orioleFilteredExtensions ++ [ ../ext/orioledb.nix ]; + dbExtensions17 = orioleFilteredExtensions; + getPostgresqlPackage = version: pkgs."postgresql_${version}"; + # Create a 'receipt' file for a given postgresql package. This is a way + # of adding a bit of metadata to the package, which can be used by other + # tools to inspect what the contents of the install are: the PSQL + # version, the installed extensions, et cetera. + # + # This takes two arguments: + # - pgbin: the postgresql package we are building on top of + # not a list of packages, but an attrset containing extension names + # mapped to versions. + # - ourExts: the list of extensions from upstream nixpkgs. This is not + # a list of packages, but an attrset containing extension names + # mapped to versions. + # + # The output is a package containing the receipt.json file, which can be + # merged with the PostgreSQL installation using 'symlinkJoin'. + makeReceipt = + pgbin: ourExts: + pkgs.writeTextFile { + name = "receipt"; + destination = "/receipt.json"; + text = builtins.toJSON { + revision = gitRev; + psql-version = pgbin.version; + nixpkgs = { + revision = inputs.nixpkgs.rev; + }; + extensions = ourExts; + + # NOTE this field can be used to do cache busting (e.g. + # force a rebuild of the psql packages) but also to helpfully inform + # tools what version of the schema is being used, for forwards and + # backwards compatibility + receipt-version = "1"; + }; + }; + + makeOurPostgresPkgs = + version: + let + postgresql = getPostgresqlPackage version; + extensionsToUse = + if (builtins.elem version [ "orioledb-17" ]) then + orioledbExtensions + else if (builtins.elem version [ "17" ]) then + dbExtensions17 + else + ourExtensions; + in + map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse; + + # Create an attrset that contains all the extensions included in a server. + makeOurPostgresPkgsSet = + version: + (builtins.listToAttrs ( + map (drv: { + name = drv.pname; + value = drv; + }) (makeOurPostgresPkgs version) + )) + // { + recurseForDerivations = true; + }; + + # Create a binary distribution of PostgreSQL, given a version. + # + # NOTE: The version here does NOT refer to the exact PostgreSQL version; + # it refers to the *major number only*, which is used to select the + # correct version of the package from nixpkgs. This is because we want + # to be able to do so in an open ended way. As an example, the version + # "15" passed in will use the nixpkgs package "postgresql_15" as the + # basis for building extensions, etc. + makePostgresBin = + version: + let + postgresql = getPostgresqlPackage version; + ourExts = map (ext: { + name = ext.pname; + version = ext.version; + }) (makeOurPostgresPkgs version); + + pgbin = postgresql.withPackages (_ps: makeOurPostgresPkgs version); + in + pkgs.symlinkJoin { + inherit (pgbin) name version; + paths = [ + pgbin + (makeReceipt pgbin ourExts) + ]; + }; + + # Create an attribute set, containing all the relevant packages for a + # PostgreSQL install, wrapped up with a bow on top. There are three + # packages: + # + # - bin: the postgresql package itself, with all the extensions + # installed, and a receipt.json file containing metadata about the + # install. + # - exts: an attrset containing all the extensions, mapped to their + # package names. + makePostgres = version: { + bin = makePostgresBin version; + exts = makeOurPostgresPkgsSet version; + recurseForDerivations = true; + }; + basePackages = { + psql_15 = makePostgres "15"; + psql_17 = makePostgres "17"; + psql_orioledb-17 = makePostgres "orioledb-17"; + }; + in + { + packages = inputs.flake-utils.lib.flattenTree basePackages; + }; +} diff --git a/nix/tools/run-restore.sh.in b/nix/packages/run-restore.sh.in similarity index 100% rename from nix/tools/run-restore.sh.in rename to nix/packages/run-restore.sh.in diff --git a/nix/packages/run-testinfra.nix b/nix/packages/run-testinfra.nix new file mode 100644 index 000000000..92f9d0a4a --- /dev/null +++ b/nix/packages/run-testinfra.nix @@ -0,0 +1,146 @@ +{ + runCommand, + aws-vault, + python3, + python3Packages, + coreutils, +}: +runCommand "run-testinfra" + { + buildInputs = [ + aws-vault + python3 + python3Packages.pip + coreutils + ]; + } + '' + mkdir -p $out/bin + cat > $out/bin/run-testinfra << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: run-testinfra --ami-name NAME [--aws-vault-profile PROFILE] + + Run the testinfra tests locally against a specific AMI. + + This script will: + 1. Check if aws-vault is installed and configured + 2. Set up the required environment variables + 3. Create and activate a virtual environment + 4. Install required Python packages from pip + 5. Run the tests with aws-vault credentials + 6. Clean up the virtual environment + + Required flags: + --ami-name NAME The name of the AMI to test + + Optional flags: + --aws-vault-profile PROFILE AWS Vault profile to use (default: staging) + --help Show this help message and exit + + Requirements: + - aws-vault installed and configured + - Python 3 with pip + - Must be run from the repository root + + Examples: + run-testinfra --ami-name supabase-postgres-abc123 + run-testinfra --ami-name supabase-postgres-abc123 --aws-vault-profile production + EOF + } + + # Default values + AWS_VAULT_PROFILE="staging" + AMI_NAME="" + + # Parse arguments + while [[ $# -gt 0 ]]; do + case $1 in + --aws-vault-profile) + AWS_VAULT_PROFILE="$2" + shift 2 + ;; + --ami-name) + AMI_NAME="$2" + shift 2 + ;; + --help) + show_help + exit 0 + ;; + *) + echo "Error: Unexpected argument: $1" + show_help + exit 1 + ;; + esac + done + + # Check for required tools + if ! command -v aws-vault &> /dev/null; then + echo "Error: aws-vault is required but not found" + exit 1 + fi + + # Check for AMI name argument + if [ -z "$AMI_NAME" ]; then + echo "Error: --ami-name is required" + show_help + exit 1 + fi + + # Set environment variables + export AWS_REGION="ap-southeast-1" + export AWS_DEFAULT_REGION="ap-southeast-1" + export AMI_NAME="$AMI_NAME" # Export AMI_NAME for pytest + export RUN_ID="local-$(date +%s)" # Generate a unique RUN_ID + + # Function to terminate EC2 instances + terminate_instances() { + echo "Terminating EC2 instances with tag testinfra-run-id=$RUN_ID..." + aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 --region ap-southeast-1 describe-instances \ + --filters "Name=tag:testinfra-run-id,Values=$RUN_ID" \ + --query "Reservations[].Instances[].InstanceId" \ + --output text | xargs -r aws-vault exec $AWS_VAULT_PROFILE -- aws ec2 terminate-instances \ + --region ap-southeast-1 --instance-ids || true + } + + # Set up traps for various signals to ensure cleanup + trap terminate_instances EXIT HUP INT QUIT TERM + + # Create and activate virtual environment + VENV_DIR=$(mktemp -d) + trap 'rm -rf "$VENV_DIR"' EXIT HUP INT QUIT TERM + python3 -m venv "$VENV_DIR" + source "$VENV_DIR/bin/activate" + + # Install required Python packages + echo "Installing required Python packages..." + pip install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest paramiko requests + + # Function to run tests and ensure cleanup + run_tests() { + local exit_code=0 + echo "Running tests for AMI: $AMI_NAME using AWS Vault profile: $AWS_VAULT_PROFILE" + aws-vault exec "$AWS_VAULT_PROFILE" -- pytest -vv -s testinfra/test_ami_nix.py || exit_code=$? + return $exit_code + } + + # Run tests and capture exit code + run_tests + test_exit_code=$? + + # Deactivate virtual environment + deactivate + + # Explicitly call cleanup + terminate_instances + + # Exit with the test exit code + exit $test_exit_code + EOL + chmod +x $out/bin/run-testinfra + '' diff --git a/nix/packages/show-commands.nix b/nix/packages/show-commands.nix new file mode 100644 index 000000000..b0733761e --- /dev/null +++ b/nix/packages/show-commands.nix @@ -0,0 +1,23 @@ +{ + runCommand, + makeWrapper, + nushell, + system ? builtins.currentSystem, +}: +runCommand "show-commands" + { + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ nushell ]; + } + '' + mkdir -p $out/bin + cat > $out/bin/show-commands << 'EOF' + #!${nushell}/bin/nu + let json_output = (nix flake show --json --quiet --all-systems | from json) + let apps = ($json_output | get apps.${system}) + $apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" } + EOF + chmod +x $out/bin/show-commands + wrapProgram $out/bin/show-commands \ + --prefix PATH : ${nushell}/bin + '' diff --git a/nix/packages/start-client.nix b/nix/packages/start-client.nix new file mode 100644 index 000000000..84ab06209 --- /dev/null +++ b/nix/packages/start-client.nix @@ -0,0 +1,27 @@ +{ + runCommand, + psql_15, + psql_17, + psql_orioledb-17, + defaults, +}: +let + migrationsDir = ../../migrations/db; + postgresqlSchemaSql = ../tools/postgresql_schema.sql; + pgbouncerAuthSchemaSql = ../../ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql; + statExtensionSql = ../../ansible/files/stat_extension.sql; +in +runCommand "start-postgres-client" { } '' + mkdir -p $out/bin + substitute ${../tools/run-client.sh.in} $out/bin/start-postgres-client \ + --subst-var-by 'PGSQL_DEFAULT_PORT' '${defaults.port}' \ + --subst-var-by 'PGSQL_SUPERUSER' '${defaults.superuser}' \ + --subst-var-by 'PSQL15_BINDIR' '${psql_15}' \ + --subst-var-by 'PSQL17_BINDIR' '${psql_17}' \ + --subst-var-by 'PSQLORIOLEDB17_BINDIR' '${psql_orioledb-17}' \ + --subst-var-by 'MIGRATIONS_DIR' '${migrationsDir}' \ + --subst-var-by 'POSTGRESQL_SCHEMA_SQL' '${postgresqlSchemaSql}' \ + --subst-var-by 'PGBOUNCER_AUTH_SCHEMA_SQL' '${pgbouncerAuthSchemaSql}' \ + --subst-var-by 'STAT_EXTENSION_SQL' '${statExtensionSql}' + chmod +x $out/bin/start-postgres-client +'' diff --git a/nix/packages/start-replica.nix b/nix/packages/start-replica.nix new file mode 100644 index 000000000..129ccd9cc --- /dev/null +++ b/nix/packages/start-replica.nix @@ -0,0 +1,12 @@ +{ + runCommand, + pgsqlSuperuser, + psql_15, +}: +runCommand "start-postgres-replica" { } '' + mkdir -p $out/bin + substitute ${./start-replica.sh.in} $out/bin/start-postgres-replica \ + --subst-var-by 'PGSQL_SUPERUSER' '${pgsqlSuperuser}' \ + --subst-var-by 'PSQL15_BINDIR' '${psql_15}' + chmod +x $out/bin/start-postgres-replica +'' diff --git a/nix/tools/run-replica.sh.in b/nix/packages/start-replica.sh.in similarity index 100% rename from nix/tools/run-replica.sh.in rename to nix/packages/start-replica.sh.in diff --git a/nix/packages/sync-exts-versions.nix b/nix/packages/sync-exts-versions.nix new file mode 100644 index 000000000..d76e66553 --- /dev/null +++ b/nix/packages/sync-exts-versions.nix @@ -0,0 +1,17 @@ +{ + runCommand, + jq, + yq, + nix-editor, + nixVersions, +}: +runCommand "sync-exts-versions" { } '' + mkdir -p $out/bin + substitute ${../tools/sync-exts-versions.sh.in} $out/bin/sync-exts-versions \ + --subst-var-by 'YQ' '${yq}/bin/yq' \ + --subst-var-by 'JQ' '${jq}/bin/jq' \ + --subst-var-by 'NIX_EDITOR' '${nix-editor.packages.nix-editor}/bin/nix-editor' \ + --subst-var-by 'NIXPREFETCHURL' '${nixVersions.nix_2_20}/bin/nix-prefetch-url' \ + --subst-var-by 'NIX' '${nixVersions.nix_2_20}/bin/nix' + chmod +x $out/bin/sync-exts-versions +'' diff --git a/nix/packages/trigger-nix-build.nix b/nix/packages/trigger-nix-build.nix new file mode 100644 index 000000000..3c006c028 --- /dev/null +++ b/nix/packages/trigger-nix-build.nix @@ -0,0 +1,125 @@ +{ + runCommand, + gh, + git, + coreutils, + lib, +}: +runCommand "trigger-nix-build" + { + buildInputs = [ + gh + git + coreutils + ]; + } + '' + mkdir -p $out/bin + cat > $out/bin/trigger-nix-build << 'EOL' + #!/usr/bin/env bash + set -euo pipefail + + show_help() { + cat << EOF + Usage: trigger-nix-build [--help] + + Trigger the nix-build workflow for the current branch and watch its progress. + + This script will: + 1. Check if you're authenticated with GitHub + 2. Get the current branch and commit + 3. Verify you're on a standard branch (develop or release/*) or prompt for confirmation + 4. Trigger the nix-build workflow + 5. Watch the workflow progress until completion + + Options: + --help Show this help message and exit + + Requirements: + - GitHub CLI (gh) installed and authenticated + - Git installed + - Must be run from a git repository + + Example: + trigger-nix-build + EOF + } + + # Handle help flag + if [[ "$#" -gt 0 && "$1" == "--help" ]]; then + show_help + exit 0 + fi + + export PATH="${ + lib.makeBinPath ([ + gh + git + coreutils + ]) + }:$PATH" + + # Check for required tools + for cmd in gh git; do + if ! command -v $cmd &> /dev/null; then + echo "Error: $cmd is required but not found" + exit 1 + fi + done + + # Check if user is authenticated with GitHub + if ! gh auth status &>/dev/null; then + echo "Error: Not authenticated with GitHub. Please run 'gh auth login' first." + exit 1 + fi + + # Get current branch and commit + BRANCH=$(git rev-parse --abbrev-ref HEAD) + COMMIT=$(git rev-parse HEAD) + + # Check if we're on a standard branch + if [[ "$BRANCH" != "develop" && ! "$BRANCH" =~ ^release/ ]]; then + echo "Warning: Running workflow from non-standard branch: $BRANCH" + echo "This is supported for testing purposes." + read -p "Continue? [y/N] " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Aborted." + exit 1 + fi + fi + + # Trigger the workflow + echo "Triggering nix-build workflow for branch $BRANCH (commit: $COMMIT)" + gh workflow run nix-build.yml --ref "$BRANCH" + + # Wait for workflow to start and get the run ID + echo "Waiting for workflow to start..." + sleep 5 + + # Get the latest run ID for this workflow + RUN_ID=$(gh run list --workflow=nix-build.yml --limit 1 --json databaseId --jq '.[0].databaseId') + + if [ -z "$RUN_ID" ]; then + echo "Error: Could not find workflow run ID" + exit 1 + fi + + echo "Watching workflow run $RUN_ID..." + echo "The script will automatically exit when the workflow completes." + echo "Press Ctrl+C to stop watching (workflow will continue running)" + echo "----------------------------------------" + + # Try to watch the run, but handle network errors gracefully + while true; do + if gh run watch "$RUN_ID" --exit-status; then + break + else + echo "Network error while watching workflow. Retrying in 5 seconds..." + echo "You can also check the status manually with: gh run view $RUN_ID" + sleep 5 + fi + done + EOL + chmod +x $out/bin/trigger-nix-build + '' diff --git a/nix/packages/update-readme.nix b/nix/packages/update-readme.nix new file mode 100644 index 000000000..40fd1e6e5 --- /dev/null +++ b/nix/packages/update-readme.nix @@ -0,0 +1,17 @@ +{ + runCommand, + makeWrapper, + nushell, +}: +runCommand "update-readme" + { + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ nushell ]; + } + '' + mkdir -p $out/bin + cp ${../tools/update_readme.nu} $out/bin/update-readme + chmod +x $out/bin/update-readme + wrapProgram $out/bin/update-readme \ + --prefix PATH : ${nushell}/bin + '' diff --git a/nix/wal-g.nix b/nix/packages/wal-g.nix similarity index 90% rename from nix/wal-g.nix rename to nix/packages/wal-g.nix index 0e29fd272..37f4addb7 100644 --- a/nix/wal-g.nix +++ b/nix/packages/wal-g.nix @@ -1,14 +1,20 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, brotli -, libsodium -, installShellFiles -, +{ + lib, + buildGoModule, + fetchFromGitHub, + brotli, + libsodium, + installShellFiles, }: let - walGCommon = { version, vendorHash, sha256, majorVersion }: + walGCommon = + { + version, + vendorHash, + sha256, + majorVersion, + }: buildGoModule rec { pname = "wal-g-${majorVersion}"; inherit version; @@ -45,14 +51,14 @@ let postInstall = '' mv $out/bin/pg $out/bin/wal-g-${majorVersion} - + # Create version-specific completions mkdir -p $out/share/bash-completion/completions $out/bin/wal-g-${majorVersion} completion bash > $out/share/bash-completion/completions/wal-g-${majorVersion} - + mkdir -p $out/share/zsh/site-functions $out/bin/wal-g-${majorVersion} completion zsh > $out/share/zsh/site-functions/_wal-g-${majorVersion} - + ''; meta = with lib; { diff --git a/nix/postgresql/15.nix b/nix/postgresql/15.nix deleted file mode 100644 index 63f492840..000000000 --- a/nix/postgresql/15.nix +++ /dev/null @@ -1,4 +0,0 @@ -import ./generic.nix { - version = "15.8"; - hash = "sha256-RANRX5pp7rPv68mPMLjGlhIr/fiV6Ss7I/W452nty2o="; -} diff --git a/nix/postgresql/17.nix b/nix/postgresql/17.nix deleted file mode 100644 index 32102fdb6..000000000 --- a/nix/postgresql/17.nix +++ /dev/null @@ -1,4 +0,0 @@ -import ./generic.nix { - version = "17.4"; - hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c="; -} diff --git a/nix/postgresql/default.nix b/nix/postgresql/default.nix index f7b3c5583..272dc4f35 100644 --- a/nix/postgresql/default.nix +++ b/nix/postgresql/default.nix @@ -1,19 +1,85 @@ -self: +{ + self', + pkgs, + supportedPostgresVersions, +}: let - versions = { - postgresql_15 = ./15.nix; - postgresql_17 = ./17.nix; - postgresql_orioledb-17 = ./orioledb-17.nix; - }; - mkAttributes = jitSupport: - self.lib.mapAttrs' (version: path: + # Creates Postgres packages for a specific flavor (standard or orioledb) + mkPostgresqlPackages = + { + namePrefix, + jitSupport, + supportedVersions, + }: + pkgs.lib.mapAttrs' ( + version: config: let - attrName = if jitSupport then "${version}_jit" else version; + versionSuffix = if jitSupport then "${version}_jit" else version; in - self.lib.nameValuePair attrName (import path { - inherit jitSupport self; + pkgs.lib.nameValuePair "${namePrefix}${versionSuffix}" ( + pkgs.callPackage ./generic.nix { + inherit (config) version hash; + jitSupport = jitSupport; + self = pkgs; + } + ) + ) supportedVersions; + + # Define Postgres flavors with their configuration + postgresFlavors = [ + { + namePrefix = "postgresql_"; + versions = supportedPostgresVersions.postgres; + } + { + namePrefix = "postgresql_orioledb-"; + versions = supportedPostgresVersions.orioledb; + } + ]; + + # Generate packages for all flavors with both JIT enabled and disabled + mkAllPackages = + flavors: jitSupport: + pkgs.lib.foldl' ( + acc: flavor: + acc + // (mkPostgresqlPackages { + inherit (flavor) namePrefix; + inherit jitSupport; + supportedVersions = flavor.versions; }) - ) versions; + ) { } flavors; + + # Generate source packages dynamically from supported versions + mkSourcePackages = + flavors: + pkgs.lib.foldl' ( + acc: flavor: + acc + // (pkgs.lib.mapAttrs' ( + version: _: + pkgs.lib.nameValuePair "${flavor.namePrefix}${version}_src" ( + pkgs.callPackage ./src.nix { postgresql = self'.packages."${flavor.namePrefix}${version}"; } + ) + ) flavor.versions) + ) { } flavors; + + # Generate debug packages dynamically from supported versions (Linux only) + mkDebugPackages = + flavors: + pkgs.lib.foldl' ( + acc: flavor: + acc + // (pkgs.lib.mapAttrs' ( + version: _: + pkgs.lib.nameValuePair "${flavor.namePrefix}${version}_debug" ( + self'.packages."${flavor.namePrefix}${version}".debug + ) + ) flavor.versions) + ) { } flavors; in -# variations without and with JIT -(mkAttributes false) // (mkAttributes true) +# Combine all PostgreSQL packages: runtime packages + source packages + debug packages +(mkAllPackages postgresFlavors false) +// (mkAllPackages postgresFlavors true) +// (mkSourcePackages postgresFlavors) +// pkgs.lib.optionalAttrs (pkgs.stdenv.isLinux) (mkDebugPackages postgresFlavors) diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index cefd5a61b..d922895fa 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -1,320 +1,411 @@ let generic = - # adapted from the nixpkgs postgresql package - # dependencies - { stdenv, lib, fetchurl, fetchpatch, makeWrapper - , glibc, zlib, readline, openssl, icu, lz4, zstd, systemd, libossp_uuid - , pkg-config, libxml2, tzdata, libkrb5, substituteAll, darwin - , linux-pam + # adapted from the nixpkgs postgresql package + # dependencies + { + stdenv, + lib, + fetchurl, + makeWrapper, + glibc, + zlib, + readline, + openssl, + icu, + lz4, + zstd, + systemd, + libossp_uuid, + pkg-config, + libxml2, + tzdata, + libkrb5, + substituteAll, + darwin, + linux-pam, #orioledb specific - , perl, bison, flex, docbook_xsl, docbook_xml_dtd_45, docbook_xsl_ns, libxslt + perl, + bison, + flex, + docbook_xsl, + docbook_xml_dtd_45, + docbook_xsl_ns, + libxslt, # This is important to obtain a version of `libpq` that does not depend on systemd. - , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic - , enableSystemd ? null - , gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic + systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic, + enableSystemd ? null, + gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic, # for postgresql.pkgs - , self, newScope, buildEnv + self, + newScope, + buildEnv, # source specification - , version, hash, muslPatches ? {} + version, + hash, + muslPatches ? { }, # for tests - , testers + testers, # JIT - , jitSupport - , nukeReferences, patchelf, llvmPackages + jitSupport, + nukeReferences, + patchelf, + llvmPackages, # PL/Python - , pythonSupport ? false - , python3 + pythonSupport ? false, + python3, # detection of crypt fails when using llvm stdenv, so we add it manually # for <13 (where it got removed: https://github.com/postgres/postgres/commit/c45643d618e35ec2fe91438df15abd4f3c0d85ca) - , libxcrypt - } @args: - let - atLeast = lib.versionAtLeast version; - olderThan = lib.versionOlder version; - lz4Enabled = atLeast "14"; - zstdEnabled = atLeast "15"; - - systemdSupport' = if enableSystemd == null then systemdSupport else (lib.warn "postgresql: argument enableSystemd is deprecated, please use systemdSupport instead." enableSystemd); - - pname = "postgresql"; - - stdenv' = if jitSupport then llvmPackages.stdenv else stdenv; - in stdenv'.mkDerivation (finalAttrs: { - inherit version; - pname = pname + lib.optionalString jitSupport "-jit"; - - src = if (builtins.match "[0-9][0-9]_.*" version != null) then - fetchurl { - url = "https://github.com/orioledb/postgres/archive/refs/tags/patches$%7Bversion%7D.tar.gz"; - inherit hash; - } - else - fetchurl { - url = "mirror://postgresql/source/v${version}/${pname}-${version}.tar.bz2"; - inherit hash; - }; - - hardeningEnable = lib.optionals (!stdenv'.cc.isClang) [ "pie" ]; - - outputs = [ "out" "lib" ]; - setOutputFlags = false; # $out retains configureFlags :-/ - - buildInputs = [ - zlib - readline - openssl - (libxml2.override {python = python3;}) - icu - ] - ++ lib.optionals (olderThan "13") [ libxcrypt ] - ++ lib.optionals jitSupport [ llvmPackages.llvm ] - ++ lib.optionals lz4Enabled [ lz4 ] - ++ lib.optionals zstdEnabled [ zstd ] - ++ lib.optionals systemdSupport' [ systemd ] - ++ lib.optionals pythonSupport [ python3 ] - ++ lib.optionals gssSupport [ libkrb5 ] - ++ lib.optionals stdenv'.isLinux [ linux-pam ] - ++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ] - ++ lib.optionals ((builtins.match "[0-9][0-9]_.*" version != null) || (lib.versionAtLeast version "17")) [ - perl bison flex docbook_xsl docbook_xml_dtd_45 docbook_xsl_ns libxslt + libxcrypt, + }@args: + let + atLeast = lib.versionAtLeast version; + olderThan = lib.versionOlder version; + lz4Enabled = atLeast "14"; + zstdEnabled = atLeast "15"; + + systemdSupport' = + if enableSystemd == null then + systemdSupport + else + (lib.warn "postgresql: argument enableSystemd is deprecated, please use systemdSupport instead." enableSystemd); + + pname = "postgresql"; + + stdenv' = if jitSupport then llvmPackages.stdenv else stdenv; + in + stdenv'.mkDerivation (finalAttrs: { + inherit version; + pname = pname + lib.optionalString jitSupport "-jit"; + + src = + if (builtins.match "[0-9][0-9]_.*" version != null) then + fetchurl { + url = "https://github.com/orioledb/postgres/archive/refs/tags/patches$%7Bversion%7D.tar.gz"; + inherit hash; + } + else + fetchurl { + url = "mirror://postgresql/source/v${version}/${pname}-${version}.tar.bz2"; + inherit hash; + }; + + hardeningEnable = lib.optionals (!stdenv'.cc.isClang) [ "pie" ]; + + outputs = [ + "out" + "lib" ]; - - nativeBuildInputs = [ - makeWrapper - pkg-config - ] - ++ lib.optionals jitSupport [ llvmPackages.llvm.dev nukeReferences patchelf ]; - - enableParallelBuilding = true; - - separateDebugInfo = true; - - buildFlags = [ "world-bin" ]; - - # Makes cross-compiling work when xml2-config can't be executed on the host. - # Fixed upstream in https://github.com/postgres/postgres/commit/0bc8cebdb889368abdf224aeac8bc197fe4c9ae6 - env.NIX_CFLAGS_COMPILE = lib.optionalString (olderThan "13") "-I${libxml2.dev}/include/libxml2"; - - configureFlags = [ - "--with-openssl" - "--with-libxml" - "--with-icu" - "--sysconfdir=/etc" - "--libdir=$(lib)/lib" - "--with-system-tzdata=${tzdata}/share/zoneinfo" - "--enable-debug" - (lib.optionalString systemdSupport' "--with-systemd") - (if stdenv'.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid") - ] ++ lib.optionals lz4Enabled [ "--with-lz4" ] - ++ lib.optionals zstdEnabled [ "--with-zstd" ] - ++ lib.optionals gssSupport [ "--with-gssapi" ] - ++ lib.optionals pythonSupport [ "--with-python" ] - ++ lib.optionals jitSupport [ "--with-llvm" ] - ++ lib.optionals stdenv'.isLinux [ "--with-pam" ]; - - patches = [ - (if atLeast "16" then ./patches/relative-to-symlinks-16+.patch else ./patches/relative-to-symlinks.patch) - ./patches/less-is-more.patch - ./patches/paths-for-split-outputs.patch - ./patches/specify_pkglibdir_at_runtime.patch - ./patches/paths-with-postgresql-suffix.patch - - (substituteAll { - src = ./patches/locale-binary-path.patch; - locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale"; - }) - ] ++ lib.optionals stdenv'.hostPlatform.isMusl ( - # Using fetchurl instead of fetchpatch on purpose: https://github.com/NixOS/nixpkgs/issues/240141 - map fetchurl (lib.attrValues muslPatches) - ) ++ lib.optionals stdenv'.isLinux [ - (if atLeast "13" then ./patches/socketdir-in-run-13+.patch else ./patches/socketdir-in-run.patch) - ]; - - installTargets = [ "install-world-bin" ]; - - postPatch = '' - # Hardcode the path to pgxs so pg_config returns the path in $out - substituteInPlace "src/common/config_info.c" --subst-var out - '' + lib.optionalString jitSupport '' - # Force lookup of jit stuff in $out instead of $lib - substituteInPlace src/backend/jit/jit.c --replace pkglib_path \"$out/lib\" - substituteInPlace src/backend/jit/llvm/llvmjit.c --replace pkglib_path \"$out/lib\" - substituteInPlace src/backend/jit/llvm/llvmjit_inline.cpp --replace pkglib_path \"$out/lib\" - ''; - - postInstall = - '' - moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it - moveToOutput "lib/libpgcommon*.a" "$out" - moveToOutput "lib/libpgport*.a" "$out" - moveToOutput "lib/libecpg*" "$out" - - # Prevent a retained dependency on gcc-wrapper. - substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv'.cc}/bin/ld ld - - if [ -z "''${dontDisableStatic:-}" ]; then - # Remove static libraries in case dynamic are available. - for i in $out/lib/*.a $lib/lib/*.a; do - name="$(basename "$i")" - ext="${stdenv'.hostPlatform.extensions.sharedLibrary}" - if [ -e "$lib/lib/''${name%.a}$ext" ] || [ -e "''${i%.a}$ext" ]; then - rm "$i" - fi - done - fi - '' + lib.optionalString jitSupport '' - # Move the bitcode and libllvmjit.so library out of $lib; otherwise, every client that - # depends on libpq.so will also have libLLVM.so in its closure too, bloating it - moveToOutput "lib/bitcode" "$out" - moveToOutput "lib/llvmjit*" "$out" - - # In the case of JIT support, prevent a retained dependency on clang-wrapper - substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv'.cc}/bin/clang clang - nuke-refs $out/lib/llvmjit_types.bc $(find $out/lib/bitcode -type f) - - # Stop out depending on the default output of llvm - substituteInPlace $out/lib/pgxs/src/Makefile.global \ - --replace ${llvmPackages.llvm.out}/bin "" \ - --replace '$(LLVM_BINPATH)/' "" - - # Stop out depending on the -dev output of llvm - substituteInPlace $out/lib/pgxs/src/Makefile.global \ - --replace ${llvmPackages.llvm.dev}/bin/llvm-config llvm-config \ - --replace -I${llvmPackages.llvm.dev}/include "" - - ${lib.optionalString (!stdenv'.isDarwin) '' - # Stop lib depending on the -dev output of llvm - rpath=$(patchelf --print-rpath $out/lib/llvmjit.so) - nuke-refs -e $out $out/lib/llvmjit.so - # Restore the correct rpath - patchelf $out/lib/llvmjit.so --set-rpath "$rpath" - ''} - ''; - - postFixup = lib.optionalString (!stdenv'.isDarwin && stdenv'.hostPlatform.libc == "glibc") - '' + setOutputFlags = false; # $out retains configureFlags :-/ + + buildInputs = + [ + zlib + readline + openssl + (libxml2.override { python = python3; }) + icu + ] + ++ lib.optionals (olderThan "13") [ libxcrypt ] + ++ lib.optionals jitSupport [ llvmPackages.llvm ] + ++ lib.optionals lz4Enabled [ lz4 ] + ++ lib.optionals zstdEnabled [ zstd ] + ++ lib.optionals systemdSupport' [ systemd ] + ++ lib.optionals pythonSupport [ python3 ] + ++ lib.optionals gssSupport [ libkrb5 ] + ++ lib.optionals stdenv'.isLinux [ linux-pam ] + ++ lib.optionals (!stdenv'.isDarwin) [ libossp_uuid ] + ++ + lib.optionals + ((builtins.match "[0-9][0-9]_.*" version != null) || (lib.versionAtLeast version "17")) + [ + perl + bison + flex + docbook_xsl + docbook_xml_dtd_45 + docbook_xsl_ns + libxslt + ]; + + nativeBuildInputs = + [ + makeWrapper + pkg-config + ] + ++ lib.optionals jitSupport [ + llvmPackages.llvm.dev + nukeReferences + patchelf + ]; + + enableParallelBuilding = true; + + separateDebugInfo = true; + + buildFlags = [ "world-bin" ]; + + # Makes cross-compiling work when xml2-config can't be executed on the host. + # Fixed upstream in https://github.com/postgres/postgres/commit/0bc8cebdb889368abdf224aeac8bc197fe4c9ae6 + env.NIX_CFLAGS_COMPILE = lib.optionalString (olderThan "13") "-I${libxml2.dev}/include/libxml2"; + + configureFlags = + [ + "--with-openssl" + "--with-libxml" + "--with-icu" + "--sysconfdir=/etc" + "--libdir=$(lib)/lib" + "--with-system-tzdata=${tzdata}/share/zoneinfo" + "--enable-debug" + (lib.optionalString systemdSupport' "--with-systemd") + (if stdenv'.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid") + ] + ++ lib.optionals lz4Enabled [ "--with-lz4" ] + ++ lib.optionals zstdEnabled [ "--with-zstd" ] + ++ lib.optionals gssSupport [ "--with-gssapi" ] + ++ lib.optionals pythonSupport [ "--with-python" ] + ++ lib.optionals jitSupport [ "--with-llvm" ] + ++ lib.optionals stdenv'.isLinux [ "--with-pam" ]; + + patches = + [ + ( + if atLeast "16" then + ./patches/relative-to-symlinks-16+.patch + else + ./patches/relative-to-symlinks.patch + ) + ./patches/less-is-more.patch + ./patches/paths-for-split-outputs.patch + ./patches/specify_pkglibdir_at_runtime.patch + ./patches/paths-with-postgresql-suffix.patch + + (substituteAll { + src = ./patches/locale-binary-path.patch; + locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale"; + }) + ] + ++ lib.optionals stdenv'.hostPlatform.isMusl ( + # Using fetchurl instead of fetchpatch on purpose: https://github.com/NixOS/nixpkgs/issues/240141 + map fetchurl (lib.attrValues muslPatches) + ) + ++ lib.optionals stdenv'.isLinux [ + (if atLeast "13" then ./patches/socketdir-in-run-13+.patch else ./patches/socketdir-in-run.patch) + ]; + + installTargets = [ "install-world-bin" ]; + + postPatch = + '' + # Hardcode the path to pgxs so pg_config returns the path in $out + substituteInPlace "src/common/config_info.c" --subst-var out + '' + + lib.optionalString jitSupport '' + # Force lookup of jit stuff in $out instead of $lib + substituteInPlace src/backend/jit/jit.c --replace pkglib_path \"$out/lib\" + substituteInPlace src/backend/jit/llvm/llvmjit.c --replace pkglib_path \"$out/lib\" + substituteInPlace src/backend/jit/llvm/llvmjit_inline.cpp --replace pkglib_path \"$out/lib\" + ''; + + postInstall = + '' + moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it + moveToOutput "lib/libpgcommon*.a" "$out" + moveToOutput "lib/libpgport*.a" "$out" + moveToOutput "lib/libecpg*" "$out" + + # Prevent a retained dependency on gcc-wrapper. + substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv'.cc}/bin/ld ld + + if [ -z "''${dontDisableStatic:-}" ]; then + # Remove static libraries in case dynamic are available. + for i in $out/lib/*.a $lib/lib/*.a; do + name="$(basename "$i")" + ext="${stdenv'.hostPlatform.extensions.sharedLibrary}" + if [ -e "$lib/lib/''${name%.a}$ext" ] || [ -e "''${i%.a}$ext" ]; then + rm "$i" + fi + done + fi + '' + + lib.optionalString jitSupport '' + # Move the bitcode and libllvmjit.so library out of $lib; otherwise, every client that + # depends on libpq.so will also have libLLVM.so in its closure too, bloating it + moveToOutput "lib/bitcode" "$out" + moveToOutput "lib/llvmjit*" "$out" + + # In the case of JIT support, prevent a retained dependency on clang-wrapper + substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv'.cc}/bin/clang clang + nuke-refs $out/lib/llvmjit_types.bc $(find $out/lib/bitcode -type f) + + # Stop out depending on the default output of llvm + substituteInPlace $out/lib/pgxs/src/Makefile.global \ + --replace ${llvmPackages.llvm.out}/bin "" \ + --replace '$(LLVM_BINPATH)/' "" + + # Stop out depending on the -dev output of llvm + substituteInPlace $out/lib/pgxs/src/Makefile.global \ + --replace ${llvmPackages.llvm.dev}/bin/llvm-config llvm-config \ + --replace -I${llvmPackages.llvm.dev}/include "" + + ${lib.optionalString (!stdenv'.isDarwin) '' + # Stop lib depending on the -dev output of llvm + rpath=$(patchelf --print-rpath $out/lib/llvmjit.so) + nuke-refs -e $out $out/lib/llvmjit.so + # Restore the correct rpath + patchelf $out/lib/llvmjit.so --set-rpath "$rpath" + ''} + ''; + + postFixup = lib.optionalString (!stdenv'.isDarwin && stdenv'.hostPlatform.libc == "glibc") '' # initdb needs access to "locale" command from glibc. wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin ''; - doCheck = !stdenv'.isDarwin; - # autodetection doesn't seem to able to find this, but it's there. - checkTarget = "check"; - - disallowedReferences = [ stdenv'.cc ]; - - passthru = let - this = self.callPackage generic args; - jitToggle = this.override { - jitSupport = !jitSupport; - }; - in - { - psqlSchema = lib.versions.major version; - - withJIT = if jitSupport then this else jitToggle; - withoutJIT = if jitSupport then jitToggle else this; - - dlSuffix = if olderThan "16" then ".so" else stdenv.hostPlatform.extensions.sharedLibrary; - - pkgs = let - scope = { - inherit jitSupport; - inherit (llvmPackages) llvm; - postgresql = this; - stdenv = stdenv'; + doCheck = !stdenv'.isDarwin; + # autodetection doesn't seem to able to find this, but it's there. + checkTarget = "check"; + + disallowedReferences = [ stdenv'.cc ]; + + passthru = + let + this = self.callPackage generic args; + jitToggle = this.override { jitSupport = !jitSupport; }; + in + { + psqlSchema = lib.versions.major version; + + withJIT = if jitSupport then this else jitToggle; + withoutJIT = if jitSupport then jitToggle else this; + + dlSuffix = if olderThan "16" then ".so" else stdenv.hostPlatform.extensions.sharedLibrary; + + pkgs = + let + scope = { + inherit jitSupport; + inherit (llvmPackages) llvm; + postgresql = this; + stdenv = stdenv'; + }; + newSelf = self // scope; + newSuper = { + callPackage = newScope (scope // this.pkgs); + }; + in + import ./ext newSelf newSuper; + + withPackages = postgresqlWithPackages { + inherit makeWrapper buildEnv; + postgresql = this; + } this.pkgs; + + tests = + { + postgresql-wal-receiver = import ../../../../nixos/tests/postgresql-wal-receiver.nix { + inherit (stdenv) system; + pkgs = self; + package = this; + }; + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + } + // lib.optionalAttrs jitSupport { + postgresql-jit = import ../../../../nixos/tests/postgresql-jit.nix { + inherit (stdenv) system; + pkgs = self; + package = this; + }; + }; }; - newSelf = self // scope; - newSuper = { callPackage = newScope (scope // this.pkgs); }; - in import ./ext newSelf newSuper; - - withPackages = postgresqlWithPackages { - inherit makeWrapper buildEnv; - postgresql = this; - } - this.pkgs; - - tests = { - postgresql-wal-receiver = import ../../../../nixos/tests/postgresql-wal-receiver.nix { - inherit (stdenv) system; - pkgs = self; - package = this; - }; - pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - } // lib.optionalAttrs jitSupport { - postgresql-jit = import ../../../../nixos/tests/postgresql-jit.nix { - inherit (stdenv) system; - pkgs = self; - package = this; - }; - }; - }; - meta = with lib; { - homepage = "https://www.postgresql.org/"; - description = "Powerful, open source object-relational database system"; - license = licenses.postgresql; - changelog = "https://www.postgresql.org/docs/release/$%7BfinalAttrs.version%7D/"; - maintainers = with maintainers; [ thoughtpolice danbst globin ivan ma27 wolfgangwalther ]; - pkgConfigModules = [ "libecpg" "libecpg_compat" "libpgtypes" "libpq" ]; - platforms = platforms.unix; - - # JIT support doesn't work with cross-compilation. It is attempted to build LLVM-bytecode - # (`%.bc` is the corresponding `make(1)`-rule) for each sub-directory in `backend/` for - # the JIT apparently, but with a $(CLANG) that can produce binaries for the build, not the - # host-platform. - # - # I managed to get a cross-build with JIT support working with - # `depsBuildBuild = [ llvmPackages.clang ] ++ buildInputs`, but considering that the - # resulting LLVM IR isn't platform-independent this doesn't give you much. - # In fact, I tried to test the result in a VM-test, but as soon as JIT was used to optimize - # a query, postgres would coredump with `Illegal instruction`. - broken = (jitSupport && stdenv.hostPlatform != stdenv.buildPlatform) - # Allmost all tests fail FATAL errors for v12 and v13 - || (jitSupport && stdenv.hostPlatform.isMusl && olderThan "14"); - }; - }); + meta = with lib; { + homepage = "https://www.postgresql.org/"; + description = "Powerful, open source object-relational database system"; + license = licenses.postgresql; + changelog = "https://www.postgresql.org/docs/release/$%7BfinalAttrs.version%7D/"; + maintainers = with maintainers; [ + thoughtpolice + danbst + globin + ivan + ma27 + wolfgangwalther + ]; + pkgConfigModules = [ + "libecpg" + "libecpg_compat" + "libpgtypes" + "libpq" + ]; + platforms = platforms.unix; + + # JIT support doesn't work with cross-compilation. It is attempted to build LLVM-bytecode + # (`%.bc` is the corresponding `make(1)`-rule) for each sub-directory in `backend/` for + # the JIT apparently, but with a $(CLANG) that can produce binaries for the build, not the + # host-platform. + # + # I managed to get a cross-build with JIT support working with + # `depsBuildBuild = [ llvmPackages.clang ] ++ buildInputs`, but considering that the + # resulting LLVM IR isn't platform-independent this doesn't give you much. + # In fact, I tried to test the result in a VM-test, but as soon as JIT was used to optimize + # a query, postgres would coredump with `Illegal instruction`. + broken = + (jitSupport && stdenv.hostPlatform != stdenv.buildPlatform) + # Allmost all tests fail FATAL errors for v12 and v13 + || (jitSupport && stdenv.hostPlatform.isMusl && olderThan "14"); + }; + }); - postgresqlWithPackages = { postgresql, makeWrapper, buildEnv }: pkgs: f: buildEnv { - name = "postgresql-and-plugins-${postgresql.version}"; - paths = f pkgs ++ [ + postgresqlWithPackages = + { + postgresql, + makeWrapper, + buildEnv, + }: + pkgs: f: + buildEnv { + name = "postgresql-and-plugins-${postgresql.version}"; + paths = f pkgs ++ [ postgresql postgresql.lib #TODO RM postgresql.man # in case user installs this into environment - ]; - nativeBuildInputs = [ makeWrapper ]; - - - # We include /bin to ensure the $out/bin directory is created, which is - # needed because we'll be removing the files from that directory in postBuild - # below. See #22653 - pathsToLink = ["/" "/bin"]; - - # Note: the duplication of executables is about 4MB size. - # So a nicer solution was patching postgresql to allow setting the - # libdir explicitly. - postBuild = '' - mkdir -p $out/bin - rm $out/bin/{pg_config,postgres,pg_ctl} - cp --target-directory=$out/bin ${postgresql}/bin/{postgres,pg_config,pg_ctl} - wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib - ''; + ]; + nativeBuildInputs = [ makeWrapper ]; + + # We include /bin to ensure the $out/bin directory is created, which is + # needed because we'll be removing the files from that directory in postBuild + # below. See #22653 + pathsToLink = [ + "/" + "/bin" + ]; - passthru.version = postgresql.version; - passthru.psqlSchema = postgresql.psqlSchema; - }; + # Note: the duplication of executables is about 4MB size. + # So a nicer solution was patching postgresql to allow setting the + # libdir explicitly. + postBuild = '' + mkdir -p $out/bin + rm $out/bin/{pg_config,postgres,pg_ctl} + cp --target-directory=$out/bin ${postgresql}/bin/{postgres,pg_config,pg_ctl} + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + ''; + passthru.version = postgresql.version; + passthru.psqlSchema = postgresql.psqlSchema; + }; in +generic # passed by .nix -versionArgs: -# passed by default.nix -{ self, ... } @defaultArgs: -self.callPackage generic (defaultArgs // versionArgs) +# versionArgs: +# # passed by default.nix +# { self, ... } @defaultArgs: +# self.callPackage generic (defaultArgs // versionArgs) diff --git a/nix/postgresql/orioledb-17.nix b/nix/postgresql/orioledb-17.nix deleted file mode 100644 index b8e5bc374..000000000 --- a/nix/postgresql/orioledb-17.nix +++ /dev/null @@ -1,4 +0,0 @@ -import ./generic.nix { - version = "17_6"; - hash = "sha256-HbuTcXNanFOl9YfvlSzQJon8CfAhc8TFwo/y7jXy51w="; -} diff --git a/nix/postgresql/src.nix b/nix/postgresql/src.nix new file mode 100644 index 000000000..65ba8b1cb --- /dev/null +++ b/nix/postgresql/src.nix @@ -0,0 +1,31 @@ +{ + stdenv, + postgresql, + lib, + bzip2, +}: +stdenv.mkDerivation { + pname = "postgresql-${postgresql.version}-src"; + version = postgresql.version; + + src = postgresql.src; + + nativeBuildInputs = [ bzip2 ]; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = '' + mkdir -p $out + cp -r . $out + ''; + + meta = with lib; { + description = "PostgreSQL 15 source files"; + homepage = "https://www.postgresql.org/"; + license = licenses.postgresql; + inherit (platforms) all; + }; +} From 990483154743590fc95658ff140d4c950aff8bab Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 3 Jul 2025 10:46:25 -0400 Subject: [PATCH 020/134] docs: update current versions in readme (#1690) --- README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d7b106cf8..edf245bc0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to ## Primary Features - ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html) - ✅ Postgres [postgresql-17.4](https://www.postgresql.org/docs/17/index.html) -- ✅ Postgres [orioledb-postgresql-17_5](https://github.com/orioledb/orioledb) +- ✅ Postgres [orioledb-postgresql-17_6](https://github.com/orioledb/orioledb) - ✅ Ubuntu 20.04 (Focal Fossa). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. - ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images. @@ -39,10 +39,10 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [plv8](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | [3.1.10](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | V8 Engine Javascript Procedural Language add-on for PostgreSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | [0.4.5](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | -| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [timescaledb-apache](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | [2.16.1](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | Scales PostgreSQL for time-series data via automatic partitioning across time and space | -| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | ### PostgreSQL 17 Extensions @@ -51,7 +51,6 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | | [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_backtrace](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | [1.1](https://github.com/pashkinelfe/pg_backtrace/archive/d100bac815a7365e199263f5b3741baf71b14c70.tar.gz) | Updated fork of pg_backtrace | | [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | | [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | @@ -62,6 +61,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | | [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | | [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging | +| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens | | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | @@ -72,9 +72,9 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | [0.4.4](https://github.com/supabase/wrappers/archive/v0.4.4.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | -| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | -| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | ### PostgreSQL orioledb-17 Extensions @@ -82,7 +82,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | ------------- | :-------------: | ------------- | | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | | [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | -| [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta9.tar.gz) | orioledb | +| [orioledb](https://github.com/orioledb/orioledb/archive/beta10.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta10.tar.gz) | orioledb | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | | [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | | [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | @@ -94,6 +94,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | | [pg_tle](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | [1.4.0](https://github.com/aws/pg_tle/archive/refs/tags/v1.4.0.tar.gz) | Framework for 'Trusted Language Extensions' in PostgreSQL | | [pgaudit](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | [17.0](https://github.com/pgaudit/pgaudit/archive/17.0.tar.gz) | Open Source PostgreSQL Audit Logging | +| [pgjwt](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | [9742dab1b2f297ad3811120db7b21451bca2d3c9](https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz) | PostgreSQL implementation of JSON Web Tokens | | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | @@ -104,9 +105,9 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | [0.4.5](https://github.com/supabase/wrappers/archive/v0.4.5.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | -| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | [2.6.0](https://github.com/supabase/supautils/archive/refs/tags/v2.6.0.tar.gz) | PostgreSQL extension for enhanced security | -| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | [0.2.9](https://github.com/supabase/vault/archive/refs/tags/v0.2.9.tar.gz) | Store encrypted secrets in PostgreSQL | +| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | +| [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | +| [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | ## Additional Goodies *This is only available for our AWS EC2* @@ -158,4 +159,4 @@ TODO: find way to automate this We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. -[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) +[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) \ No newline at end of file From 48f22dd2eef5bee8f029e82bcf653a68a166a1ec Mon Sep 17 00:00:00 2001 From: Oliver Rice Date: Mon, 7 Jul 2025 14:22:30 -0500 Subject: [PATCH 021/134] pgmq don't manipulate sequences (#1471) The script being deleted was a hacky solution we put in place to resolve a pg_dump segfault due to its interaction with pgmq tables. It currently introduces errors where sequences become owned by supabase_admin and are inaccessible to users after upgrading. https://supabase.slack.com/archives/C05Q0CVC65B/p1741093731995359 This update mirrors the same code's removal from our on-backup hook here: https://github.com/supabase/infrastructure/pull/21405/files Co-authored-by: Bobbie Soedirgo --- .../pg_upgrade_scripts/complete.sh | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index 31cc7d09d..e170482e8 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -148,73 +148,6 @@ EOF # Patching pgmq ownership as it resets during upgrade HAS_PGMQ=$(run_sql -A -t -c "select count(*) > 0 from pg_extension where extname = 'pgmq';") if [ "$HAS_PGMQ" = "t" ]; then - PATCH_PGMQ_QUERY=$(cat < Date: Mon, 7 Jul 2025 17:52:40 -0400 Subject: [PATCH 022/134] fix: needed a release to rollout fixes that address pgmq issues (#1693) related to https://github.com/supabase/postgres/pull/1471 --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 1d24249ad..de488b9ec 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.099-orioledb" - postgres17: "17.4.1.049" - postgres15: "15.8.1.106" + postgresorioledb-17: "17.0.1.100-orioledb" + postgres17: "17.4.1.050" + postgres15: "15.8.1.107" # Non Postgres Extensions pgbouncer_release: "1.19.0" From b806c071d09a203ac0fac24b09ddcd8957ecd9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 8 Jul 2025 03:46:09 +0200 Subject: [PATCH 023/134] feat: multiple versions for the wrappers extension (#1663) * feat(cargo-pgrx): build extensions with specified Rust version This change allows developers to target specific Rust versions for building extensions. It implements support for building cargo extensions and `cargo-pgrx` using the specified Rust version. * feat: multiple versions for the wrappers extension Build multiple versions of the wrappers extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. Make sure we build cargo extension and cargo-pgrx with the specified Rust version. * Fix darwin build by using unix sockets only Stop using TCP sockets in builds to avoid port conflicts * Support more versions of wrappers extension Update rust overlay to build using more recent rust versions. * Build wrapper 0.3.0 using pgrx 0.11.3 Avoid compilation errors related to bindgen on aarch64-linux * Build wrapper 0.5.2 using pgrx 0.14.3 * Limit the numbers of versions to build * tests: update regress tests for new version of wrappers * Build and cache a single version Current MacOS builder cannot handle multiple versions * Do not run parallel builds on MacOS Current runner doesn't have enough disk space * feat: update wrappers to 0.5.3 * feat: bugfix on same version * fix: free up space in the case of macos builder * fix: also pass in nix.conf max-jobs setting on macos * Revert "fix: also pass in nix.conf max-jobs setting on macos" This reverts commit b67f7cef23fa94b1e73762508aafa2feadc78594. * fix(ci): only build devshell on linux aarch64 darwin has issues building all the postgresql with their extensions in parallel. `devShell` depends on `start-server` which depends on the `makePostgresDevSetup`which depends on all databases. * fix(ci): build each postgresql version separately The `makeCheckHarness` function depends on all postgresql versions. * chore: fix formatting * chore: bump versions to release --------- Co-authored-by: Sam Rose --- .github/workflows/nix-build.yml | 28 +- ansible/vars.yml | 6 +- flake.lock | 6 +- nix/cargo-pgrx/buildPgrxExtension.nix | 16 +- nix/cargo-pgrx/default.nix | 14 +- nix/cargo-pgrx/mkPgrxExtension.nix | 38 + nix/cargo-pgrx/versions.json | 61 + nix/checks.nix | 15 +- nix/ext/tests/wrappers.nix | 157 + nix/ext/versions.json | 14 + .../wrappers/0001-bump-pgrx-to-0.11.3.patch | 164 + nix/ext/wrappers/Cargo.lock-0.3.0 | 5191 +++++++++++++++++ nix/ext/wrappers/default.nix | 381 +- nix/tests/expected/z_15_ext_interface.out | 10 +- nix/tests/expected/z_17_ext_interface.out | 10 +- .../expected/z_orioledb-17_ext_interface.out | 10 +- 16 files changed, 5904 insertions(+), 217 deletions(-) create mode 100644 nix/cargo-pgrx/mkPgrxExtension.nix create mode 100644 nix/cargo-pgrx/versions.json create mode 100644 nix/ext/tests/wrappers.nix create mode 100644 nix/ext/versions.json create mode 100644 nix/ext/wrappers/0001-bump-pgrx-to-0.11.3.patch create mode 100644 nix/ext/wrappers/Cargo.lock-0.3.0 diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 36dc01d05..75f4ae20c 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -57,7 +57,7 @@ jobs: run: | cat << 'EOF' | sudo tee /etc/nix/upload-to-cache.sh > /dev/null #!/usr/bin/env bash - set -eouf + set -euf export IFS=' ' /nix/var/nix/profiles/default/bin/nix copy --to 's3://nix-postgres-artifacts?secret-key=/etc/nix/nix-secret-key' $OUT_PATHS EOF @@ -77,10 +77,34 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Aggressive disk cleanup for DuckDB build + if: matrix.runner == 'macos-latest-xlarge' + run: | + echo "=== BEFORE CLEANUP ===" + df -h + # Remove major space consumers + sudo rm -rf /usr/share/dotnet || true + sudo rm -rf /usr/local/lib/android || true + sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform || true + sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/watchOS.platform || true + sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/tvOS.platform || true + # Clean everything possible + sudo rm -rf /opt/ghc || true + sudo rm -rf /usr/local/share/boost || true + sudo rm -rf /opt/homebrew || true + sudo xcrun simctl delete all 2>/dev/null || true + # Aggressive cache cleanup + sudo rm -rf /System/Library/Caches/* 2>/dev/null || true + sudo rm -rf /Library/Caches/* 2>/dev/null || true + sudo rm -rf ~/Library/Caches/* 2>/dev/null || true + sudo rm -rf /private/var/log/* 2>/dev/null || true + sudo rm -rf /tmp/* 2>/dev/null || true + echo "=== AFTER CLEANUP ===" + df -h - name: Build psql bundle run: > nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48" - -- --skip-cached --no-nom + -- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }} --flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')" env: AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }} diff --git a/ansible/vars.yml b/ansible/vars.yml index de488b9ec..a3d9565e5 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.100-orioledb" - postgres17: "17.4.1.050" - postgres15: "15.8.1.107" + postgresorioledb-17: "17.0.1.101-orioledb" + postgres17: "17.4.1.051" + postgres15: "15.8.1.108" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/flake.lock b/flake.lock index 167905994..8b6d868bf 100644 --- a/flake.lock +++ b/flake.lock @@ -304,11 +304,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1746758179, - "narHash": "sha256-JECUw1YBEsTsVauvupRzE5ykZaJoyhHCpoY87ZZJGas=", + "lastModified": 1749609482, + "narHash": "sha256-R+Y3tXIUAMosrgo/ynhIUPEONZ+cM0ScbgN7KA8OkoE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "4fd00513eac6b6140c5dced3e1b8133e2369a0f8", + "rev": "a17da8deb943e7c8b4151914abbfe33d5a4e5b0d", "type": "github" }, "original": { diff --git a/nix/cargo-pgrx/buildPgrxExtension.nix b/nix/cargo-pgrx/buildPgrxExtension.nix index 0b2b14fb9..d62db6b04 100644 --- a/nix/cargo-pgrx/buildPgrxExtension.nix +++ b/nix/cargo-pgrx/buildPgrxExtension.nix @@ -26,14 +26,13 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. - { lib, cargo-pgrx, pkg-config, rustPlatform, stdenv, - Security, + darwin, writeShellScriptBin, }: @@ -94,7 +93,13 @@ let export PGRX_HOME=$(mktemp -d) export PGDATA="$PGRX_HOME/data-${pgrxPostgresMajor}/" cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config - echo "unix_socket_directories = '$(mktemp -d)'" > "$PGDATA/postgresql.conf" + + # unix sockets work in sandbox, too. + export PGHOST="$(mktemp -d)" + cat > "$PGDATA/postgresql.conf" <&2" + ) + + with subtest("Check ${pname} latest extension version"): + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["17"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + check_upgrade_path("17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json new file mode 100644 index 000000000..e5c4e90b1 --- /dev/null +++ b/nix/ext/versions.json @@ -0,0 +1,14 @@ +{ + "wrappers": { + "0.5.3": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "hash": "sha256-iaJriPEa0iVLpmnuUk9R3HS545Jhz7aH1clYvHEuEvs=", + "pgrx": "0.14.3", + "rust": "1.87.0" + } + } +} diff --git a/nix/ext/wrappers/0001-bump-pgrx-to-0.11.3.patch b/nix/ext/wrappers/0001-bump-pgrx-to-0.11.3.patch new file mode 100644 index 000000000..35006c76a --- /dev/null +++ b/nix/ext/wrappers/0001-bump-pgrx-to-0.11.3.patch @@ -0,0 +1,164 @@ +From 6a14bd4cf44ebfa86404aa3e0b3f12dcac3f160c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= +Date: Thu, 12 Jun 2025 17:26:02 +0200 +Subject: [PATCH] bump pgrx to 0.11.3 + +Backport https://github.com/supabase/wrappers/pull/254 +--- + Cargo.lock | 36 +++++++++++++++--------------------- + supabase-wrappers/Cargo.toml | 4 ++-- + wrappers/Cargo.toml | 4 ++-- + 3 files changed, 19 insertions(+), 25 deletions(-) + +diff --git a/Cargo.lock b/Cargo.lock +index 7c6b6b2..a3ba635 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -759,16 +759,16 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + + [[package]] + name = "bindgen" +-version = "0.68.1" ++version = "0.69.4" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" ++checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" + dependencies = [ + "bitflags 2.4.0", + "cexpr", + "clang-sys", ++ "itertools", + "lazy_static", + "lazycell", +- "peeking_take_while", + "proc-macro2", + "quote", + "regex", +@@ -2815,12 +2815,6 @@ dependencies = [ + "libc", + ] + +-[[package]] +-name = "peeking_take_while" +-version = "0.1.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +- + [[package]] + name = "percent-encoding" + version = "2.3.0" +@@ -2849,9 +2843,9 @@ dependencies = [ + + [[package]] + name = "pgrx" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cb44171122605250e719ca2ae49afb357bdb2fce4b3c876fcf2225165237328a" ++checksum = "2102faa5ef4a7bf096fefcf67692b293583efd18f9236340ad3169807dfc2b73" + dependencies = [ + "atomic-traits", + "bitflags 2.4.0", +@@ -2874,9 +2868,9 @@ dependencies = [ + + [[package]] + name = "pgrx-macros" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "a18ac8628b7de2f29a93d0abdbdcaee95a0e0ef4b59fd4de99cc117e166e843b" ++checksum = "c26810d09910ec987a6708d48d243efb5f879331e01c6fec0893714d0eb12bae" + dependencies = [ + "pgrx-sql-entity-graph", + "proc-macro2", +@@ -2886,9 +2880,9 @@ dependencies = [ + + [[package]] + name = "pgrx-pg-config" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "acd45ac6eb1142c5690df63c4e0bdfb74f27c9f93a7af84f064dc2c0a2c2d6f7" ++checksum = "0b0099ba4b635dfe1e34afc8bca8be43e9577c5d726aaf1dc7dd23a78f6c8a60" + dependencies = [ + "cargo_toml", + "dirs", +@@ -2904,9 +2898,9 @@ dependencies = [ + + [[package]] + name = "pgrx-pg-sys" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "81c6207939582934fc26fceb651cb5338e363c06ddc6b2d50ca71867f7c70ffe" ++checksum = "3f40315259c41fede51eb23b791b48d0a112b0f47d0dcb6862b798d1fa1db6ea" + dependencies = [ + "bindgen", + "clang-sys", +@@ -2928,9 +2922,9 @@ dependencies = [ + + [[package]] + name = "pgrx-sql-entity-graph" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "a50083de83b1fac2484e8f2c2a7da5fed0193904e2578fa6c4ce02262c455c2b" ++checksum = "7d47a4e991c8c66162c5d6b0fc2bd382e43a58fc893ce05a6a15ddcb1bf7eee4" + dependencies = [ + "convert_case", + "eyre", +@@ -2943,9 +2937,9 @@ dependencies = [ + + [[package]] + name = "pgrx-tests" +-version = "0.11.2" ++version = "0.11.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "6ba0115cd80d9e3ca1d5d2a8ab8b7320d6ed614a53d025b86152696a8b3caa75" ++checksum = "ab3abc01e2bb930b072bd660d04c8eaa69a29d4727d5b2a641f946c603c1605e" + dependencies = [ + "clap-cargo", + "eyre", +diff --git a/supabase-wrappers/Cargo.toml b/supabase-wrappers/Cargo.toml +index a825fea..be66f25 100644 +--- a/supabase-wrappers/Cargo.toml ++++ b/supabase-wrappers/Cargo.toml +@@ -19,14 +19,14 @@ pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] + pg_test = [] + + [dependencies] +-pgrx = { version = "=0.11.2", default-features = false } ++pgrx = { version = "=0.11.3", default-features = false } + thiserror = "1.0.48" + tokio = { version = "1.35", features = ["rt", "net"] } + uuid = { version = "1.2.2" } + supabase-wrappers-macros = { version = "0.1", path = "../supabase-wrappers-macros" } + + [dev-dependencies] +-pgrx-tests = "=0.11.2" ++pgrx-tests = "=0.11.3" + + [package.metadata.docs.rs] + features = ["pg15", "cshim"] +diff --git a/wrappers/Cargo.toml b/wrappers/Cargo.toml +index a6dd573..6f63519 100644 +--- a/wrappers/Cargo.toml ++++ b/wrappers/Cargo.toml +@@ -134,7 +134,7 @@ all_fdws = [ + ] + + [dependencies] +-pgrx = { version = "=0.11.2" } ++pgrx = { version = "=0.11.3" } + #supabase-wrappers = "0.1" + supabase-wrappers = { path = "../supabase-wrappers", default-features = false } + +@@ -204,4 +204,4 @@ redis = { version = "0.24.0", features = ["streams"], optional = true } + thiserror = { version = "1.0.48", optional = true } + + [dev-dependencies] +-pgrx-tests = "=0.11.2" ++pgrx-tests = "=0.11.3" +-- +2.49.0 + diff --git a/nix/ext/wrappers/Cargo.lock-0.3.0 b/nix/ext/wrappers/Cargo.lock-0.3.0 new file mode 100644 index 000000000..a3ba6354f --- /dev/null +++ b/nix/ext/wrappers/Cargo.lock-0.3.0 @@ -0,0 +1,5191 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "const-random", + "getrandom 0.2.12", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "arrow-array" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6049e031521c4e7789b7530ea5991112c0a375430094191f3b74bdf37517c9a9" +dependencies = [ + "ahash 0.8.7", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "chrono", + "half 2.3.1", + "hashbrown 0.13.2", + "num", +] + +[[package]] +name = "arrow-buffer" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a83450b94b9fe018b65ba268415aaab78757636f68b7f37b6bc1f2a3888af0a0" +dependencies = [ + "half 2.3.1", + "num", +] + +[[package]] +name = "arrow-cast" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249198411254530414805f77e88e1587b0914735ea180f906506905721f7a44a" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "arrow-select", + "chrono", + "lexical-core", + "num", +] + +[[package]] +name = "arrow-data" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d48dcbed83d741d4af712af17f6d952972b8f6491b24ee2415243a7e37c6438" +dependencies = [ + "arrow-buffer", + "arrow-schema", + "half 2.3.1", + "num", +] + +[[package]] +name = "arrow-ipc" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8d7b138c5414aeef5dd08abacf362f87ed9b1168ea38d60a6f67590c3f7d99" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-cast", + "arrow-data", + "arrow-schema", + "flatbuffers", +] + +[[package]] +name = "arrow-schema" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b71d8d68d0bc2e648e4e395896dc518be8b90c5f0f763c59083187c3d46184b" + +[[package]] +name = "arrow-select" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "470cb8610bdfda56554a436febd4e457e506f3c42e01e545a1ea7ecf2a4c8823" +dependencies = [ + "arrow-array", + "arrow-buffer", + "arrow-data", + "arrow-schema", + "num", +] + +[[package]] +name = "assert-json-diff" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-compression" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +dependencies = [ + "bzip2", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "xz2", +] + +[[package]] +name = "async-native-tls" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d57d4cec3c647232e1094dc013546c0b33ce785d8aeb251e1f20dfaf8a9a13fe" +dependencies = [ + "futures-util", + "native-tls", + "thiserror", + "url", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "atomic-polyfill" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "aws-config" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e64b72d4bdbb41a73d27709c65a25b6e4bfc8321bf70fa3a8b19ce7d4eb81b0" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-sdk-sso", + "aws-sdk-ssooidc", + "aws-sdk-sts", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand 2.0.0", + "hex", + "http", + "hyper", + "ring", + "time", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-credential-types" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a7cb3510b95492bd9014b60e2e3bee3e48bc516e220316f8e6b60df18b47331" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + +[[package]] +name = "aws-http" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a95d41abe4e941399fdb4bc2f54713eac3c839d98151875948bb24e66ab658f2" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "http-body", + "pin-project-lite", + "tracing", +] + +[[package]] +name = "aws-runtime" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233cca219c6705d525ace011d6f9bc51aaf32fce5b4c41661d2d7ff22d9b4d49" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "fastrand 2.0.0", + "http", + "percent-encoding", + "tracing", + "uuid 1.4.1", +] + +[[package]] +name = "aws-sdk-cognitoidentityprovider" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab24eef715050f56365d129fcff98de9e2981066e221cec8fe7b6170b188fcc" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-s3" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634fbe5b6591ee2e281cd2ba8641e9bd752dbf5bf338924d6ad4bd5a3304fe31" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-checksums", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "bytes", + "http", + "http-body", + "once_cell", + "percent-encoding", + "regex-lite", + "tracing", + "url", +] + +[[package]] +name = "aws-sdk-sso" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee41005e0f3a19ae749c7953d9e1f1ef8d2183f76f64966e346fa41c1ba0ed44" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-ssooidc" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa08168f8a27505e7b90f922c32a489feb1f2133878981a15138bebc849ac09c" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sdk-sts" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29102eff04d50ef70f11a48823db33e33c6cc5f027bfb6ff4864efbd5f1f66f3" +dependencies = [ + "aws-credential-types", + "aws-http", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-query", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-smithy-xml", + "aws-types", + "http", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b92384b39aedb258aa734fe0e7b2ffcd13f33e68227251a72cd2635e0acc8f1a" +dependencies = [ + "aws-credential-types", + "aws-smithy-eventstream", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "crypto-bigint 0.5.5", + "form_urlencoded", + "hex", + "hmac", + "http", + "once_cell", + "p256", + "percent-encoding", + "ring", + "sha2", + "subtle", + "time", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-async" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d8e1c0904f78c76846a9dad41c28b41d330d97741c3e70d003d9a747d95e2a" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-checksums" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d59ef74bf94562512e570eeccb81e9b3879f9136b2171ed4bf996ffa609955" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc32c", + "crc32fast", + "hex", + "http", + "http-body", + "md-5", + "pin-project-lite", + "sha1", + "sha2", + "tracing", +] + +[[package]] +name = "aws-smithy-eventstream" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31cf0466890a20988b9b2864250dd907f769bd189af1a51ba67beec86f7669fb" +dependencies = [ + "aws-smithy-types", + "bytes", + "crc32fast", +] + +[[package]] +name = "aws-smithy-http" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a3b159001358dd96143378afd7470e19baffb6918e4b5016abe576e553f9c" +dependencies = [ + "aws-smithy-eventstream", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http", + "http-body", + "once_cell", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f12bfb23370a069f8facbfd53ce78213461b0a8570f6c81488030f5ab6f8cc4e" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-query" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1adc06e0175c175d280267bb8fd028143518013fcb869e1c3199569a2e902a" +dependencies = [ + "aws-smithy-types", + "urlencoding", +] + +[[package]] +name = "aws-smithy-runtime" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cf0f6845d2d97b953cea791b0ee37191c5509f2897ec7eb7580a0e7a594e98b" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "fastrand 2.0.0", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "once_cell", + "pin-project-lite", + "pin-utils", + "rustls 0.21.10", + "tokio", + "tracing", +] + +[[package]] +name = "aws-smithy-runtime-api" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47798ba97a33979c80e837519cf837f18fd6df0adb02dd5286a75d9891c6e671" +dependencies = [ + "aws-smithy-async", + "aws-smithy-types", + "bytes", + "http", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-types" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9a85eafeaf783b2408e35af599e8b96f2c49d9a5d13ad3a887fbdefb6bc744" +dependencies = [ + "base64-simd", + "bytes", + "bytes-utils", + "futures-core", + "http", + "http-body", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time", + "tokio", + "tokio-util", +] + +[[package]] +name = "aws-smithy-xml" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a84bee2b44c22cbba59f12c34b831a97df698f8e43df579b35998652a00dc13" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "aws-types" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8549aa62c5b7db5c57ab915200ee214b4f5d8f19b29a4a8fa0b3ad3bca1380e3" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "http", + "rustc_version 0.4.0", + "tracing", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" + +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.4.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.32", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.32", + "syn_derive", +] + +[[package]] +name = "brotli" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes", + "either", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cargo_toml" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.48.0", +] + +[[package]] +name = "chrono-tz" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c39203181991a7dd4343b8005bd804e7a9a37afb8ac070e43771e8c820bbde" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f509c3a87b33437b05e2458750a0700e5bdd6956176773e6c7d6dd15a283a0c" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap-cargo" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25122ca6ebad5f53578c26638afd9f0160426969970dc37ec6c363ff6b082ebd" +dependencies = [ + "clap", + "doc-comment", +] + +[[package]] +name = "clap_builder" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +dependencies = [ + "anstyle", + "bitflags 1.3.2", + "clap_lex", +] + +[[package]] +name = "clap_derive" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "clickhouse-rs" +version = "1.0.0-alpha.1" +source = "git+https://github.com/suharev7/clickhouse-rs?rev=ecf28f4677#ecf28f46774773f39c74ee5213ad1e3ea240739b" +dependencies = [ + "byteorder", + "chrono", + "chrono-tz", + "clickhouse-rs-cityhash-sys", + "combine", + "crossbeam", + "either", + "futures-core", + "futures-sink", + "futures-util", + "hostname", + "lazy_static", + "log", + "lz4", + "native-tls", + "percent-encoding", + "pin-project", + "thiserror", + "tokio", + "tokio-native-tls", + "url", + "uuid 0.8.2", +] + +[[package]] +name = "clickhouse-rs-cityhash-sys" +version = "0.1.2" +source = "git+https://github.com/suharev7/clickhouse-rs?rev=ecf28f4677#ecf28f46774773f39c74ee5213ad1e3ea240739b" +dependencies = [ + "cc", +] + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "connection-string" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510ca239cf13b7f8d16a2b48f263de7b4f8c566f0af58d901031473c76afb1e3" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32c" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" +dependencies = [ + "rustc_version 0.4.0", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + +[[package]] +name = "deadpool" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +dependencies = [ + "async-trait", + "deadpool-runtime", + "num_cpus", + "retain_mut", + "tokio", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "dyn-clone" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint 0.4.9", + "der", + "digest", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "encoding" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" +dependencies = [ + "encoding-index-japanese", + "encoding-index-korean", + "encoding-index-simpchinese", + "encoding-index-singlebyte", + "encoding-index-tradchinese", +] + +[[package]] +name = "encoding-index-japanese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-korean" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-simpchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-singlebyte" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-tradchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding_index_tests" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-map" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c188012f8542dee7b3996e44dd89461d64aa471b0a7c71a1ae2f595d259e96e5" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04d0b288e3bb1d861c4403c1774a6f7a798781dfc519b3647df2a3dd4ae95f25" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "enumflags2" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + +[[package]] +name = "errno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flatbuffers" +version = "23.5.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dac53e22462d78c16d64a1cd22371b54cc3fe94aa15e7886a2fa6e5d1ab8640" +dependencies = [ + "bitflags 1.3.2", + "rustc_version 0.4.0", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gcp-bigquery-client" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576b349942a1b96327b1b2e50d271d3d54dc9669eb38271c830916168e753820" +dependencies = [ + "async-stream", + "async-trait", + "dyn-clone", + "hyper", + "hyper-rustls", + "log", + "reqwest", + "serde", + "serde_json", + "thiserror", + "time", + "tokio", + "tokio-stream", + "url", + "yup-oauth2", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "half" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", + "num-traits", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heapless" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.0", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-types" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" +dependencies = [ + "anyhow", + "async-channel", + "base64 0.13.1", + "futures-lite", + "http", + "infer", + "pin-project-lite", + "rand 0.7.3", + "serde", + "serde_json", + "serde_qs", + "serde_urlencoded", + "url", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.5", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.10", + "rustls-native-certs", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "infer" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "integer-encoding" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "lexical-core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +dependencies = [ + "lexical-parse-integer", + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-parse-integer" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-util" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "lexical-write-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +dependencies = [ + "lexical-util", + "lexical-write-integer", + "static_assertions", +] + +[[package]] +name = "lexical-write-integer" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "libc" +version = "0.2.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", + "serde", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + +[[package]] +name = "md5" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e6bcd6433cff03a4bfc3d9834d504467db1f1cf6d0ea765d37d330249ed629d" + +[[package]] +name = "memchr" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "openssl" +version = "0.10.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +dependencies = [ + "bitflags 2.4.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "outref" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.7", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "parquet" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6880c32d81884ac4441d9f4b027df8561be23b54f3ac1e62086fa42753dd3faa" +dependencies = [ + "ahash 0.8.7", + "arrow-array", + "arrow-buffer", + "arrow-cast", + "arrow-data", + "arrow-ipc", + "arrow-schema", + "arrow-select", + "base64 0.21.1", + "brotli", + "bytes", + "chrono", + "flate2", + "futures", + "hashbrown 0.13.2", + "lz4", + "num", + "num-bigint", + "paste", + "seq-macro", + "snap", + "thrift", + "tokio", + "twox-hash", + "zstd", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pathsearch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da983bc5e582ab17179c190b4b66c7d76c5943a69c6d34df2a2b6bf8a2977b05" +dependencies = [ + "anyhow", + "libc", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pgrx" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2102faa5ef4a7bf096fefcf67692b293583efd18f9236340ad3169807dfc2b73" +dependencies = [ + "atomic-traits", + "bitflags 2.4.0", + "bitvec", + "enum-map", + "heapless", + "libc", + "once_cell", + "pgrx-macros", + "pgrx-pg-sys", + "pgrx-sql-entity-graph", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror", + "uuid 1.4.1", +] + +[[package]] +name = "pgrx-macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c26810d09910ec987a6708d48d243efb5f879331e01c6fec0893714d0eb12bae" +dependencies = [ + "pgrx-sql-entity-graph", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pgrx-pg-config" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b0099ba4b635dfe1e34afc8bca8be43e9577c5d726aaf1dc7dd23a78f6c8a60" +dependencies = [ + "cargo_toml", + "dirs", + "eyre", + "owo-colors", + "pathsearch", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgrx-pg-sys" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f40315259c41fede51eb23b791b48d0a112b0f47d0dcb6862b798d1fa1db6ea" +dependencies = [ + "bindgen", + "clang-sys", + "eyre", + "libc", + "memoffset", + "once_cell", + "pgrx-macros", + "pgrx-pg-config", + "pgrx-sql-entity-graph", + "proc-macro2", + "quote", + "serde", + "shlex", + "sptr", + "syn 1.0.109", + "walkdir", +] + +[[package]] +name = "pgrx-sql-entity-graph" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d47a4e991c8c66162c5d6b0fc2bd382e43a58fc893ce05a6a15ddcb1bf7eee4" +dependencies = [ + "convert_case", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgrx-tests" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3abc01e2bb930b072bd660d04c8eaa69a29d4727d5b2a641f946c603c1605e" +dependencies = [ + "clap-cargo", + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgrx", + "pgrx-macros", + "pgrx-pg-config", + "postgres", + "proptest", + "rand 0.8.5", + "regex", + "serde", + "serde_json", + "sysinfo", + "thiserror", +] + +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", + "uncased", +] + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" + +[[package]] +name = "postgres" +version = "0.19.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7915b33ed60abc46040cbcaa25ffa1c7ec240668e0477c4f3070786f5916d451" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" +dependencies = [ + "base64 0.21.1", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand 0.8.5", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pretty-hex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5" + +[[package]] +name = "proc-macro-crate" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +dependencies = [ + "bit-set", + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "num-traits", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax 0.6.29", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redis" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd" +dependencies = [ + "combine", + "itoa", + "percent-encoding", + "ryu", + "sha1_smol", + "socket2 0.4.10", + "url", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.12", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rend" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64 0.21.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.10", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "reqwest-middleware" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a3e86aa6053e59030e7ce2d2a3b258dd08fc2d337d52f73f6cb480f5858690" +dependencies = [ + "anyhow", + "async-trait", + "http", + "reqwest", + "serde", + "task-local-extensions", + "thiserror", +] + +[[package]] +name = "reqwest-retry" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6a11c05102e5bec712c0619b8c7b7eda8b21a558a0bd981ceee15c38df8be4" +dependencies = [ + "anyhow", + "async-trait", + "chrono", + "futures", + "getrandom 0.2.12", + "http", + "hyper", + "parking_lot 0.11.2", + "reqwest", + "reqwest-middleware", + "retry-policies", + "task-local-extensions", + "tokio", + "tracing", + "wasm-timer", +] + +[[package]] +name = "retain_mut" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" + +[[package]] +name = "retry-policies" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e09bbcb5003282bcb688f0bae741b278e9c7e8f378f561522c9806c58e075d9b" +dependencies = [ + "anyhow", + "chrono", + "rand 0.8.5", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.12", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "rkyv" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid 1.4.1", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.17", +] + +[[package]] +name = "rustix" +version = "0.38.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.1", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.1", +] + +[[package]] +name = "rustls-pki-types" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc" + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half 1.8.2", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_qs" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" +dependencies = [ + "percent-encoding", + "serde", + "thiserror", +] + +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "supabase-wrappers" +version = "0.1.17" +dependencies = [ + "pgrx", + "pgrx-tests", + "supabase-wrappers-macros", + "thiserror", + "tokio", + "uuid 1.4.1", +] + +[[package]] +name = "supabase-wrappers-macros" +version = "0.1.15" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "sysinfo" +version = "0.29.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a18d114d420ada3a891e6bc8e96a2023402203296a47cdd65083377dad18ba5" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "task-local-extensions" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8" +dependencies = [ + "pin-utils", +] + +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "thrift" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e54bc85fc7faa8bc175c4bab5b92ba8d9a3ce893d0e9f42cc455c8ab16a9e09" +dependencies = [ + "byteorder", + "integer-encoding", + "ordered-float", +] + +[[package]] +name = "tiberius" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6e2bf3e4b5be181a2a2ceff4b9b12e2684010d436a6958bd564fbc8094d44d" +dependencies = [ + "async-native-tls", + "async-trait", + "asynchronous-codec", + "byteorder", + "bytes", + "chrono", + "connection-string", + "encoding", + "enumflags2", + "futures-util", + "num-traits", + "once_cell", + "pin-project-lite", + "pretty-hex", + "rust_decimal", + "thiserror", + "tracing", + "uuid 1.4.1", + "winauth", +] + +[[package]] +name = "time" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "libc", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d340244b32d920260ae7448cb72b6e238bddc3d4f7603394e7dd46ed8e48f5b8" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot 0.12.1", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand 0.8.5", + "socket2 0.5.5", + "tokio", + "tokio-util", + "whoami", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "futures-util", + "hashbrown 0.12.3", + "pin-project-lite", + "slab", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "uncased" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" +dependencies = [ + "version_check", +] + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.32", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" + +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winauth" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f820cd208ce9c6b050812dc2d724ba98c6c1e9db5ce9b3f58d925ae5723a5e6" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "md5", + "rand 0.7.3", + "winapi", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wiremock" +version = "0.5.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13a3a53eaf34f390dd30d7b1b078287dd05df2aa2e21a589ccb80f5c7253c2e9" +dependencies = [ + "assert-json-diff", + "async-trait", + "base64 0.21.1", + "deadpool", + "futures", + "futures-timer", + "http-types", + "hyper", + "log", + "once_cell", + "regex", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "wrappers" +version = "0.3.0" +dependencies = [ + "arrow-array", + "async-compression", + "aws-config", + "aws-sdk-cognitoidentityprovider", + "aws-sdk-s3", + "aws-smithy-http", + "aws-smithy-runtime-api", + "chrono", + "chrono-tz", + "clickhouse-rs", + "csv", + "futures", + "gcp-bigquery-client", + "http", + "num-traits", + "parquet", + "pgrx", + "pgrx-tests", + "redis", + "regex", + "reqwest", + "reqwest-middleware", + "reqwest-retry", + "serde", + "serde_json", + "supabase-wrappers", + "thiserror", + "tiberius", + "tokio", + "tokio-util", + "url", + "wiremock", + "yup-oauth2", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xmlparser" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yup-oauth2" +version = "8.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b61da40aeb0907a65f7fb5c1de83c5a224d6a9ebb83bf918588a2bb744d636b8" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.1", + "futures", + "http", + "hyper", + "hyper-rustls", + "itertools", + "log", + "percent-encoding", + "rustls 0.22.2", + "rustls-pemfile", + "seahash", + "serde", + "serde_json", + "time", + "tokio", + "tower-service", + "url", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index fe8074189..218c65e77 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -1,212 +1,217 @@ { lib, stdenv, + callPackages, fetchFromGitHub, openssl, pkg-config, postgresql, - buildPgrxExtension_0_12_9, + buildEnv, darwin, rust-bin, git, }: let - rustVersion = "1.84.0"; - cargo = rust-bin.stable.${rustVersion}.default; -in -buildPgrxExtension_0_12_9 rec { - pname = "supabase-wrappers"; - version = "0.5.0"; - # update the following array when the wrappers version is updated - # required to ensure that extensions update scripts from previous versions are generated - previousVersions = [ - "0.4.6" - "0.4.5" - "0.4.4" - "0.4.3" - "0.4.2" - "0.4.1" - "0.4.0" - "0.3.1" - "0.3.0" - "0.2.0" - "0.1.19" - "0.1.18" - "0.1.17" - "0.1.16" - "0.1.15" - "0.1.14" - "0.1.12" - "0.1.11" - "0.1.10" - "0.1.9" - "0.1.8" - "0.1.7" - "0.1.6" - "0.1.5" - "0.1.4" - "0.1.1" - "0.1.0" - ]; - inherit postgresql; - src = fetchFromGitHub { - owner = "supabase"; - repo = "wrappers"; - rev = "v${version}"; - hash = "sha256-FbRTUcpEHBa5DI6dutvBeahYM0RZVAXIzIAZWIaxvn0"; - }; + pname = "wrappers"; + build = + version: hash: rustVersion: pgrxVersion: + let + cargo = rust-bin.stable.${rustVersion}.default; + #previousVersions = lib.filter (v: v != version) versions; # FIXME + mkPgrxExtension = callPackages ../../cargo-pgrx/mkPgrxExtension.nix { + inherit rustVersion pgrxVersion; + }; + in + mkPgrxExtension ( + rec { + inherit pname version postgresql; - nativeBuildInputs = [ - pkg-config - cargo - git - ]; - buildInputs = - [ - openssl - postgresql - ] - ++ lib.optionals (stdenv.isDarwin) [ - darwin.apple_sdk.frameworks.CoreFoundation - darwin.apple_sdk.frameworks.Security - darwin.apple_sdk.frameworks.SystemConfiguration - ]; - - NIX_LDFLAGS = "-L${postgresql}/lib -lpq"; - - # Set necessary environment variables for pgrx in darwin only - env = lib.optionalAttrs stdenv.isDarwin { - POSTGRES_LIB = "${postgresql}/lib"; - RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - # Calculate unique port for each PostgreSQL version: - # - Check if version contains underscore (indicating OrioleDB) - # - Add 1 to port if it's OrioleDB - # - Add 2 for each major version above 15 - # Examples: - # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435 - # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440 - # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439 - PGPORT = toString ( - 5534 - + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) - # +1 for OrioleDB - + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 - ); # +2 for each major version - }; + src = fetchFromGitHub { + owner = "supabase"; + repo = "wrappers"; + rev = "v${version}"; + inherit hash; + }; - OPENSSL_NO_VENDOR = 1; - #need to set this to 2 to avoid cpu starvation - CARGO_BUILD_JOBS = "2"; - CARGO = "${cargo}/bin/cargo"; - - #CARGO_NET_GIT_FETCH_WITH_CLI = "true"; - cargoLock = { - lockFile = "${src}/Cargo.lock"; - allowBuiltinFetchGit = false; - outputHashes = { - "clickhouse-rs-1.1.0-alpha.1" = "sha256-G+v4lNP5eK2U45D1fL90Dq24pUSlpIysNCxuZ17eac0="; - }; - }; + nativeBuildInputs = [ + pkg-config + cargo + git + ]; + buildInputs = + [ + openssl + postgresql + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreFoundation + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.SystemConfiguration + ]; - preConfigure = '' - cd wrappers - - # update the clickhouse-rs dependency - # append the branch name to the git URL to help cargo locate the commit - # while maintaining the rev for reproducibility - awk -i inplace ' - /\[dependencies.clickhouse-rs\]/ { - print - getline - if ($0 ~ /git =/) { - print "git = \"https://github.com/suharev7/clickhouse-rs/async-await/"" - } else { - print - } - while ($0 !~ /^\[/ && NF > 0) { - getline - if ($0 ~ /rev =/) print - if ($0 ~ /^\[/) print - } - next - } - { print } - ' Cargo.toml + NIX_LDFLAGS = "-L${postgresql}/lib -lpq"; - # Verify the file is still valid TOML, break build with this error - # if it is not - if ! cargo verify-project 2>/dev/null; then - echo "Failed to maintain valid TOML syntax" - exit 1 - fi + # Set necessary environment variables for pgrx in darwin only + env = lib.optionalAttrs stdenv.isDarwin { + POSTGRES_LIB = "${postgresql}/lib"; + RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; + }; - cd .. - ''; + OPENSSL_NO_VENDOR = 1; + #need to set this to 2 to avoid cpu starvation + CARGO_BUILD_JOBS = "2"; + CARGO = "${cargo}/bin/cargo"; - buildAndTestSubdir = "wrappers"; - buildFeatures = [ - "helloworld_fdw" - "all_fdws" - ]; - doCheck = false; + cargoLock = { + lockFile = "${src}/Cargo.lock"; + outputHashes = + if builtins.compareVersions "0.4.2" version >= 0 then + { "clickhouse-rs-1.0.0-alpha.1" = "sha256-0zmoUo/GLyCKDLkpBsnLAyGs1xz6cubJhn+eVqMEMaw="; } + else if builtins.compareVersions "0.5.0" version >= 0 then + { "clickhouse-rs-1.1.0-alpha.1" = "sha256-G+v4lNP5eK2U45D1fL90Dq24pUSlpIysNCxuZ17eac0="; } + else if builtins.compareVersions "0.5.2" version == 0 then + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; + } + else if builtins.compareVersions "0.5.3" version == 0 then + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; + } + else + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-0.5.0" = "sha256-dYPZdpP7kcp49UxsCZrZi3xMJ4rJiB8H65dMMR9Z1Yk="; + }; + }; - preBuild = '' - echo "Processing git tags..." - echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt - ''; + preConfigure = '' + cd wrappers + + # update the clickhouse-rs dependency + # append the branch name to the git URL to help cargo locate the commit + # while maintaining the rev for reproducibility + awk -i inplace ' + /\[dependencies.clickhouse-rs\]/ { + print + getline + if ($0 ~ /git =/) { + print "git = \"https://github.com/burmecia/clickhouse-rs/supabase-patch/"" + } else { + print + } + while ($0 !~ /^\[/ && NF > 0) { + getline + if ($0 ~ /rev =/) print + if ($0 ~ /^\[/) print + } + next + } + { print } + ' Cargo.toml + + # Verify the file is still valid TOML, break build with this erroru + # if it is not + if ! cargo verify-project 2>/dev/null; then + echo "Failed to maintain valid TOML syntax" + exit 1 + fi - postInstall = '' - echo "Modifying main SQL file to use unversioned library name..." - current_version="${version}" - main_sql_file="$out/share/postgresql/extension/wrappers--$current_version.sql" - if [ -f "$main_sql_file" ]; then - sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$main_sql_file" - echo "Modified $main_sql_file" - else - echo "Warning: $main_sql_file not found" - fi - echo "Creating and modifying SQL files for previous versions..." - - if [ -f "$main_sql_file" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/share/postgresql/extension/wrappers--$previous_version--$current_version.sql" - echo "Creating $new_file" - cp "$main_sql_file" "$new_file" - sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$new_file" - echo "Modified $new_file" - fi - done < git_tags.txt - else - echo "Warning: $main_sql_file not found" - fi - mv $out/lib/wrappers-${version}${postgresql.dlSuffix} $out/lib/wrappers${postgresql.dlSuffix} - ln -s $out/lib/wrappers${postgresql.dlSuffix} $out/lib/wrappers-${version}${postgresql.dlSuffix} - - echo "Creating wrappers.so symlinks to support pg_upgrade..." - if [ -f "$out/lib/wrappers.so" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/lib/wrappers-$previous_version.so" - echo "Creating $new_file" - ln -s "$out/lib/wrappers.so" "$new_file" + cd .. + ''; + + buildAndTestSubdir = "wrappers"; + buildFeatures = [ + "helloworld_fdw" + "all_fdws" + ]; + doCheck = false; + + postInstall = '' + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + $out/share/postgresql/extension/${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + rm $out/share/postgresql/extension/${pname}.control + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi + } + + create_control_files + ''; + + meta = with lib; { + description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; + homepage = "https://github.com/supabase/wrappers"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + } + // lib.optionalAttrs (version == "0.3.0") { + patches = [ ./0001-bump-pgrx-to-0.11.3.patch ]; + + cargoLock = { + lockFile = ./Cargo.lock-0.3.0; + outputHashes = { + "clickhouse-rs-1.0.0-alpha.1" = "sha256-0zmoUo/GLyCKDLkpBsnLAyGs1xz6cubJhn+eVqMEMaw="; + }; + }; + } + ); + allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).wrappers; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) supportedVersions + ); +in +buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) + + create_sql_files() { + PREVIOUS_VERSION="" + while IFS= read -r i; do + FILENAME=$(basename "$i") + DIRNAME=$(dirname "$i") + VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)" + if [[ "$PREVIOUS_VERSION" != "" ]]; then + echo "Processing $i" + MIGRATION_FILENAME="$DIRNAME/''${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}" + cp "$i" "$MIGRATION_FILENAME" fi - done < git_tags.txt - else - echo "Warning: $out/lib/wrappers.so not found" - fi - - rm git_tags.txt - echo "Contents of updated wrappers.control:" - cat "$out/share/postgresql/extension/wrappers.control" - echo "List of generated SQL files:" - ls -l $out/share/postgresql/extension/wrappers--*.sql - ''; + PREVIOUS_VERSION="$VERSION" + done < <(find $out -name '*.sql' | sort -V) + } - meta = with lib; { - description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; - homepage = "https://github.com/supabase/wrappers"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + create_sql_files + ''; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index 540bee2e8..c652a95eb 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -126,7 +126,7 @@ order by unaccent | t uuid-ossp | t vector | t - wrappers | f + wrappers | t xml2 | f (79 rows) @@ -5184,12 +5184,18 @@ order by wrappers | public | cognito_fdw_handler | | fdw_handler wrappers | public | cognito_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | cognito_fdw_validator | options text[], catalog oid | void + wrappers | public | duckdb_fdw_handler | | fdw_handler + wrappers | public | duckdb_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | duckdb_fdw_validator | options text[], catalog oid | void wrappers | public | firebase_fdw_handler | | fdw_handler wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | firebase_fdw_validator | options text[], catalog oid | void wrappers | public | hello_world_fdw_handler | | fdw_handler wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void + wrappers | public | iceberg_fdw_handler | | fdw_handler + wrappers | public | iceberg_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | iceberg_fdw_validator | options text[], catalog oid | void wrappers | public | logflare_fdw_handler | | fdw_handler wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | logflare_fdw_validator | options text[], catalog oid | void @@ -5221,7 +5227,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5051 rows) +(5057 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index f7750f849..d31894bc3 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -113,7 +113,7 @@ order by unaccent | t uuid-ossp | t vector | t - wrappers | f + wrappers | t xml2 | f (72 rows) @@ -4828,12 +4828,18 @@ order by wrappers | public | cognito_fdw_handler | | fdw_handler wrappers | public | cognito_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | cognito_fdw_validator | options text[], catalog oid | void + wrappers | public | duckdb_fdw_handler | | fdw_handler + wrappers | public | duckdb_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | duckdb_fdw_validator | options text[], catalog oid | void wrappers | public | firebase_fdw_handler | | fdw_handler wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | firebase_fdw_validator | options text[], catalog oid | void wrappers | public | hello_world_fdw_handler | | fdw_handler wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void + wrappers | public | iceberg_fdw_handler | | fdw_handler + wrappers | public | iceberg_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | iceberg_fdw_validator | options text[], catalog oid | void wrappers | public | logflare_fdw_handler | | fdw_handler wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | logflare_fdw_validator | options text[], catalog oid | void @@ -4865,7 +4871,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4708 rows) +(4714 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index f7750f849..d31894bc3 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -113,7 +113,7 @@ order by unaccent | t uuid-ossp | t vector | t - wrappers | f + wrappers | t xml2 | f (72 rows) @@ -4828,12 +4828,18 @@ order by wrappers | public | cognito_fdw_handler | | fdw_handler wrappers | public | cognito_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | cognito_fdw_validator | options text[], catalog oid | void + wrappers | public | duckdb_fdw_handler | | fdw_handler + wrappers | public | duckdb_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | duckdb_fdw_validator | options text[], catalog oid | void wrappers | public | firebase_fdw_handler | | fdw_handler wrappers | public | firebase_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | firebase_fdw_validator | options text[], catalog oid | void wrappers | public | hello_world_fdw_handler | | fdw_handler wrappers | public | hello_world_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | hello_world_fdw_validator | options text[], catalog oid | void + wrappers | public | iceberg_fdw_handler | | fdw_handler + wrappers | public | iceberg_fdw_meta | | TABLE(name text, version text, author text, website text) + wrappers | public | iceberg_fdw_validator | options text[], catalog oid | void wrappers | public | logflare_fdw_handler | | fdw_handler wrappers | public | logflare_fdw_meta | | TABLE(name text, version text, author text, website text) wrappers | public | logflare_fdw_validator | options text[], catalog oid | void @@ -4865,7 +4871,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4708 rows) +(4714 rows) /* From d314e8f6638e900f5f74f9e369ec3a0763b2cd77 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Tue, 8 Jul 2025 22:31:36 +0200 Subject: [PATCH 024/134] feat: bump auth to v2.177.0 (#1694) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index a3d9565e5..06522a8d1 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.101-orioledb" - postgres17: "17.4.1.051" - postgres15: "15.8.1.108" + postgresorioledb-17: "17.0.1.102-orioledb" + postgres17: "17.4.1.052" + postgres15: "15.8.1.109" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "12.2.3" postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 -gotrue_release: 2.176.1 -gotrue_release_checksum: sha1:3b392d2e332d5b5114e571c0d62ab9f827fd5b76 +gotrue_release: 2.177.0 +gotrue_release_checksum: sha1:664a26237618c4bfb1e33e4f03a540c3cef3e3c8 aws_cli_release: "2.23.11" From f0a2fc11b04000dda5560723409538733359082e Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 9 Jul 2025 14:14:24 -0400 Subject: [PATCH 025/134] fix: an errant rebase lost these changes that run funs for tests (#1696) --- nix/checks.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/checks.nix b/nix/checks.nix index d01518dc9..13be10f23 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -287,9 +287,9 @@ ''; in { - psql_15 = self'.packages."psql_15/bin"; - psql_17 = self'.packages."psql_17/bin"; - psql_orioledb-17 = self'.packages."psql_orioledb-17/bin"; + psql_15 = makeCheckHarness self'.packages."psql_15/bin"; + psql_17 = makeCheckHarness self'.packages."psql_17/bin"; + psql_orioledb-17 = makeCheckHarness self'.packages."psql_orioledb-17/bin"; inherit (self'.packages) wal-g-2 wal-g-3 From f1050d4cc361809bf2ffe54137d4faa86b149a07 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 9 Jul 2025 22:30:57 +0800 Subject: [PATCH 026/134] fix: grant storage schema to postgres with grant option --- ...250_grant_storage_schema_to_postgres_with_grant_option.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 migrations/db/migrations/20250709135250_grant_storage_schema_to_postgres_with_grant_option.sql diff --git a/migrations/db/migrations/20250709135250_grant_storage_schema_to_postgres_with_grant_option.sql b/migrations/db/migrations/20250709135250_grant_storage_schema_to_postgres_with_grant_option.sql new file mode 100644 index 000000000..604ff998e --- /dev/null +++ b/migrations/db/migrations/20250709135250_grant_storage_schema_to_postgres_with_grant_option.sql @@ -0,0 +1,4 @@ +-- migrate:up +grant usage on schema storage to postgres with grant option; + +-- migrate:down From e404b56d9ca81bd38d4443afcd3ab0dde241e111 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 10 Jul 2025 00:04:58 +0800 Subject: [PATCH 027/134] chore: bump versions --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 06522a8d1..2f749e143 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.102-orioledb" - postgres17: "17.4.1.052" - postgres15: "15.8.1.109" + postgresorioledb-17: "17.0.1.103-orioledb" + postgres17: "17.4.1.053" + postgres15: "15.8.1.110" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 6ac8fca78f5e69d1273dc1c07b546a68b5ff0f39 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Thu, 10 Jul 2025 00:23:35 +0800 Subject: [PATCH 028/134] test: postgres storage privs --- nix/tests/expected/storage.out | 21 +++++++++++++++++++++ nix/tests/sql/storage.sql | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/nix/tests/expected/storage.out b/nix/tests/expected/storage.out index fc1882923..c6edf49e1 100644 --- a/nix/tests/expected/storage.out +++ b/nix/tests/expected/storage.out @@ -206,3 +206,24 @@ select * from storage.migrations ; ----+------+------+------------- (0 rows) +-- postgres can grant storage privileges to custom roles +create role r; +grant r to postgres with admin option; +set role r; +select * from storage.buckets; +ERROR: permission denied for schema storage +LINE 1: select * from storage.buckets; + ^ +set role postgres; +grant usage on schema storage to r; +grant select on storage.buckets to r; +set role r; +select * from storage.buckets; + id | name | owner | created_at | updated_at +----+------+-------+------------+------------ +(0 rows) + +set role postgres; +drop owned by r cascade; +drop role r; +reset role; diff --git a/nix/tests/sql/storage.sql b/nix/tests/sql/storage.sql index b9d80820f..770741844 100644 --- a/nix/tests/sql/storage.sql +++ b/nix/tests/sql/storage.sql @@ -95,3 +95,22 @@ order by -- storage service migrations select * from storage.migrations ; + +-- postgres can grant storage privileges to custom roles +create role r; +grant r to postgres with admin option; + +set role r; +select * from storage.buckets; + +set role postgres; +grant usage on schema storage to r; +grant select on storage.buckets to r; + +set role r; +select * from storage.buckets; + +set role postgres; +drop owned by r cascade; +drop role r; +reset role; From a991d3f2d322d96595fbd50cc33b7ee65cfbf630 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Thu, 10 Jul 2025 00:44:53 +0100 Subject: [PATCH 029/134] fix: hardcode the salt gpg keys path as it never changes (#1697) --- .../supabase-admin-agent.sudoers.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf b/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf index 6896e2f0c..df65f1137 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf @@ -1,2 +1,2 @@ %supabase-admin-agent ALL= NOPASSWD: /usr/bin/salt-call -%supabase-admin-agent ALL= NOPASSWD: /usr/bin/gpg --homedir {{ gpgdir }} --import, /usr/bin/gpg --homedir {{ gpgdir }} --list-secret-keys * +%supabase-admin-agent ALL= NOPASSWD: /usr/bin/gpg --homedir /etc/salt/gpgkeys --import, /usr/bin/gpg --homedir /etc/salt/gpgkeys --list-secret-keys * From 438def297a3f97eca795258a370d85caac3644b8 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Thu, 10 Jul 2025 13:57:34 +0800 Subject: [PATCH 030/134] fix: bump ami (#1698) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 2f749e143..d82a06a65 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.103-orioledb" - postgres17: "17.4.1.053" - postgres15: "15.8.1.110" + postgresorioledb-17: "17.0.1.104-orioledb" + postgres17: "17.4.1.054" + postgres15: "15.8.1.111" # Non Postgres Extensions pgbouncer_release: "1.19.0" From a67e2e1cd373acd93e65615cdc3bf8dac6068d73 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 11 Jul 2025 12:34:01 -0400 Subject: [PATCH 031/134] fix: user cachix nix installer with pinned nix version (#1700) --- .github/workflows/nix-build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 75f4ae20c..077c525dd 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -63,18 +63,20 @@ jobs: EOF sudo chmod +x /etc/nix/upload-to-cache.sh - name: Install nix - uses: DeterminateSystems/nix-installer-action@main + uses: cachix/install-nix-action@v27 if: ${{ github.secret_source == 'Actions' }} with: - extra-conf: | + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= post-build-hook = /etc/nix/upload-to-cache.sh - name: Install nix - uses: DeterminateSystems/nix-installer-action@main + uses: cachix/install-nix-action@v27 if: ${{ github.secret_source == 'None' }} with: - extra-conf: | + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Aggressive disk cleanup for DuckDB build From 9b278d51e20748dbce2a54f4753848d4ae545c5c Mon Sep 17 00:00:00 2001 From: Laurence Isla Date: Fri, 11 Jul 2025 19:52:35 +0000 Subject: [PATCH 032/134] chore: bump to PostgREST v12.2.12 (#1699) --- ansible/manifest-playbook.yml | 2 +- ansible/tasks/setup-postgrest.yml | 4 ++-- ansible/vars.yml | 17 ++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 5c1c65053..37c02d2c2 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -24,7 +24,7 @@ - name: PostgREST - download ubuntu binary archive (arm) get_url: - url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-aarch64.tar.xz" + url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-20.04-aarch64.tar.xz" dest: /tmp/postgrest-{{ postgrest_release }}-arm64.tar.xz checksum: "{{ postgrest_arm_release_checksum }}" timeout: 60 diff --git a/ansible/tasks/setup-postgrest.yml b/ansible/tasks/setup-postgrest.yml index b6e0f951c..b786ff3c9 100644 --- a/ansible/tasks/setup-postgrest.yml +++ b/ansible/tasks/setup-postgrest.yml @@ -48,7 +48,7 @@ - name: PostgREST - download ubuntu binary archive (arm) get_url: - url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-aarch64.tar.xz" + url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-20.04-aarch64.tar.xz" dest: /tmp/postgrest.tar.xz checksum: "{{ postgrest_arm_release_checksum }}" timeout: 60 @@ -56,7 +56,7 @@ - name: PostgREST - download ubuntu binary archive (x86) get_url: - url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-linux-static-x64.tar.xz" + url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-linux-static-x86-64.tar.xz" dest: /tmp/postgrest.tar.xz checksum: "{{ postgrest_x86_release_checksum }}" timeout: 60 diff --git a/ansible/vars.yml b/ansible/vars.yml index d82a06a65..c2c7aed87 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,20 +9,19 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.104-orioledb" - postgres17: "17.4.1.054" - postgres15: "15.8.1.111" + postgresorioledb-17: "17.0.1.105-orioledb" + postgres17: "17.4.1.055" + postgres15: "15.8.1.112" # Non Postgres Extensions pgbouncer_release: "1.19.0" pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682 -# to get these use -# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-ubuntu-aarch64.tar.xz -q -O- | sha1sum -# wget https://github.com/PostgREST/postgrest/releases/download/v12.2.3/postgrest-v12.2.3-linux-static-x64.tar.xz -q -O- | sha1sum -postgrest_release: "12.2.3" -postgrest_arm_release_checksum: sha1:fbfd6613d711ce1afa25c42d5df8f1b017f396f9 -postgrest_x86_release_checksum: sha1:61c513f91a8931be4062587b9d4a18b42acf5c05 +# The checksum can be found under "Assets", in the GitHub release page for each version: +# https://github.com/PostgREST/postgrest/releases +postgrest_release: "12.2.12" +postgrest_arm_release_checksum: sha256:6b2eaa5759329e024df76f79d93f6bb3d87a93de11433acc5d66aa6c96f81f90 +postgrest_x86_release_checksum: sha256:5de4092f1719da3353c40bf96c8dec6913f2254a7cd0b61cc05f233153b557d5 gotrue_release: 2.177.0 gotrue_release_checksum: sha1:664a26237618c4bfb1e33e4f03a540c3cef3e3c8 From 198cf691a1b5dbf2cd1b0576d9546b5b007ed133 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Tue, 15 Jul 2025 23:28:30 +0800 Subject: [PATCH 033/134] chore!: upgrade Vector to latest release (#1689) In preliminary testing, shows ~15% lower memory consumption at idle. Marked as a breaking change as the config needs to be updated in advance of the new release. --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index c2c7aed87..885a9bde5 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.105-orioledb" - postgres17: "17.4.1.055" - postgres15: "15.8.1.112" + postgresorioledb-17: "17.0.1.106-orioledb" + postgres17: "17.4.1.056" + postgres15: "15.8.1.113" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -55,5 +55,5 @@ adminapi_release: 0.84.1 adminmgr_release: 0.25.1 supabase_admin_agent_release: 1.4.36 -vector_x86_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_amd64.deb" -vector_arm_deb: "https://packages.timber.io/vector/0.22.3/vector_0.22.3-1_arm64.deb" +vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" +vector_arm_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb" From c27f2450be8159df57a852aebec628c17eaf650b Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Wed, 16 Jul 2025 12:07:01 +0100 Subject: [PATCH 034/134] chore: version bump supabase-admin-agent (#1705) * chore: version bump supabase-admin-agent * chore: bump image versions --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 885a9bde5..cae51b58d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.106-orioledb" - postgres17: "17.4.1.056" - postgres15: "15.8.1.113" + postgresorioledb-17: "17.0.1.107-orioledb" + postgres17: "17.4.1.057" + postgres15: "15.8.1.114" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -53,7 +53,7 @@ postgres_exporter_release_checksum: adminapi_release: 0.84.1 adminmgr_release: 0.25.1 -supabase_admin_agent_release: 1.4.36 +supabase_admin_agent_release: 1.4.37 vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb" From 2442765bf0453bf337e08632ff6cd09ce8e83696 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 15 Jul 2025 14:49:27 -0500 Subject: [PATCH 035/134] chore: bump to pg_net 0.19.3 --- nix/ext/pg_net.nix | 6 ++---- nix/tests/expected/z_15_ext_interface.out | 6 ++++-- nix/tests/expected/z_17_ext_interface.out | 6 ++++-- nix/tests/expected/z_orioledb-17_ext_interface.out | 6 ++++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 02d673297..23715fba7 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { pname = "pg_net"; - version = "0.14.0"; + version = "0.19.3"; buildInputs = [ curl @@ -19,11 +19,9 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-c1pxhTyrE5j6dY+M5eKAboQNofIORS+Dccz+7HKEKQI="; + hash = "sha256-PZYIwkXp1rOzRCDZivJFMuEQBYJaaibUN/WkL+6crSg="; }; - env.NIX_CFLAGS_COMPILE = "-Wno-error"; - installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index c652a95eb..d3d9f7c4f 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1161,9 +1161,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -5227,7 +5229,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5057 rows) +(5059 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index d31894bc3..46792e48f 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1146,9 +1146,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4871,7 +4873,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4714 rows) +(4716 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index d31894bc3..46792e48f 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -1146,9 +1146,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4871,7 +4873,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4714 rows) +(4716 rows) /* From 922a11aa9218fdb41af2e73d7664e6ec8f7bcbc4 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 16 Jul 2025 22:36:18 -0400 Subject: [PATCH 036/134] feat: oriole beta12 (#1707) * feat: oriole beta12 * fix: update testing schema * chore: bump versions to release --- ansible/vars.yml | 6 +++--- migrations/schema-orioledb-17.sql | 4 ++-- nix/config.nix | 4 ++-- nix/ext/orioledb.nix | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index cae51b58d..830c94fb2 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.0.1.107-orioledb" - postgres17: "17.4.1.057" - postgres15: "15.8.1.114" + postgresorioledb-17: "17.5.1.001-orioledb" + postgres17: "17.4.1.058" + postgres15: "15.8.1.115" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/schema-orioledb-17.sql b/migrations/schema-orioledb-17.sql index 8c5d32c39..5cfda417c 100644 --- a/migrations/schema-orioledb-17.sql +++ b/migrations/schema-orioledb-17.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 17.0 --- Dumped by pg_dump version 17.0 +-- Dumped from database version 17.5 +-- Dumped by pg_dump version 17.5 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/nix/config.nix b/nix/config.nix index b1ebe3fd7..267ec18a8 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -52,8 +52,8 @@ in }; orioledb = { "17" = { - version = "17_6"; - hash = "sha256-HbuTcXNanFOl9YfvlSzQJon8CfAhc8TFwo/y7jXy51w="; + version = "17_11"; + hash = "sha256-RZYU955PmGZExfX2JKw1dIQMMuuswtAXpXjZ9CLbOsw="; }; }; }; diff --git a/nix/ext/orioledb.nix b/nix/ext/orioledb.nix index 96976f83d..549aa2ab1 100644 --- a/nix/ext/orioledb.nix +++ b/nix/ext/orioledb.nix @@ -15,10 +15,10 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "orioledb"; repo = "orioledb"; - rev = "beta10"; - sha256 = "sha256-O4OTi8ickylVXE9FURm5R++A+l15Z22YLna7OVzVMjc="; + rev = "beta12"; + sha256 = "sha256-5dyVdKD1PzW+F5OPW3TR3OKBaJxxR3OhLbzK+o9Wf+Q="; }; - version = "beta10"; + version = "beta12"; buildInputs = [ curl libkrb5 @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { python3 openssl ]; - buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=6"; + buildPhase = "make USE_PGXS=1 ORIOLEDB_PATCHSET_VERSION=11"; installPhase = '' runHook preInstall From 5547a4f5de9dc9c01a4142c5d9489d27dd16c5d6 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 17 Jul 2025 18:28:07 +0800 Subject: [PATCH 037/134] feat: disable default database collector for postgres_exporter The database collector emits a metric for the size of each database by default. We emit a metric that represents the sum of all database, which suffices for our purposes. This change removes the redundant per-database metric. In order to avoid a change in the AMI metrics, the change is only made for the QEMU artifact. --- ansible/files/postgres_exporter.service.j2 | 2 +- ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/files/postgres_exporter.service.j2 b/ansible/files/postgres_exporter.service.j2 index 0066a76b2..fd8b2a897 100644 --- a/ansible/files/postgres_exporter.service.j2 +++ b/ansible/files/postgres_exporter.service.j2 @@ -3,7 +3,7 @@ Description=Postgres Exporter [Service] Type=simple -ExecStart=/opt/postgres_exporter/postgres_exporter --disable-settings-metrics --extend.query-path="/opt/postgres_exporter/queries.yml" --disable-default-metrics --no-collector.locks --no-collector.replication --no-collector.replication_slot --no-collector.stat_bgwriter --no-collector.stat_database --no-collector.stat_user_tables --no-collector.statio_user_tables --no-collector.wal +ExecStart=/opt/postgres_exporter/postgres_exporter --disable-settings-metrics --extend.query-path="/opt/postgres_exporter/queries.yml" --disable-default-metrics --no-collector.locks --no-collector.replication --no-collector.replication_slot --no-collector.stat_bgwriter --no-collector.stat_database --no-collector.stat_user_tables --no-collector.statio_user_tables --no-collector.wal {% if qemu_mode is defined and qemu_mode %}--no-collector.database {% endif %} User=postgres Group=postgres Restart=always diff --git a/ansible/vars.yml b/ansible/vars.yml index 830c94fb2..d3c1594b1 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.001-orioledb" - postgres17: "17.4.1.058" - postgres15: "15.8.1.115" + postgresorioledb-17: "17.5.1.002-orioledb" + postgres17: "17.4.1.059" + postgres15: "15.8.1.116" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 77bb5434f084e03b9832c97423bce5e0cec56288 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Thu, 17 Jul 2025 15:10:18 +0100 Subject: [PATCH 038/134] chore: repack admin-agent to public artifacts bucket (#1710) --- ansible/manifest-playbook.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 37c02d2c2..9a1636d0d 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -61,6 +61,22 @@ shell: | cd /tmp && tar -cJf admin-mgr-{{ adminmgr_release }}-arm64.tar.xz admin-mgr + - name: Download supabase-admin-agent archive + get_url: + url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/supabase-admin-agent/v%7B%7B%20supabase_admin_agent_release%20%7D%7D/supabase-admin-agent-%7B%7B%20supabase_admin_agent_release%20%7D%7D-linux-arm64.tar.gz" + dest: "/tmp/supabase-admin-agent.tar.gz" + timeout: 90 + + - name: supabase-admin-agent - unpack archive in /tmp + unarchive: + remote_src: yes + src: /tmp/supabase-admin-agent.tar.gz + dest: /tmp + + - name: supabase-admin-agent - pack archive + shell: | + cd /tmp && tar -cJf supabase-admin-agent-{{ supabase_admin_agent_release }}-arm64.tar.xz supabase-admin-agent + - name: upload archives shell: | aws s3 cp /tmp/{{ item.file }} s3://{{ internal_artifacts_bucket }}/upgrades/{{ item.service }}/{{ item.file }} @@ -73,3 +89,5 @@ file: supabase-admin-api-{{ adminapi_release }}-arm64.tar.xz - service: admin-mgr file: admin-mgr-{{ adminmgr_release }}-arm64.tar.xz + - service: supabase-admin-agent + file: supabase-admin-agent-{{ supabase_admin_agent_release }}-arm64.tar.xz From a43cbe0f27add2be2d5ac1673df8db69b5ddaaea Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Wed, 16 Jul 2025 16:36:38 +0800 Subject: [PATCH 039/134] test: alter API roles timeout --- nix/tests/expected/roles.out | 5 +++++ nix/tests/sql/roles.sql | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index aef247b35..3832b0f00 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -521,3 +521,8 @@ order by schema_order, schema_name, privilege_type, grantee, default_for; vault | USAGE | supabase_admin | supabase_admin (389 rows) +-- postgres can alter API roles' timeout +set role postgres; +alter role anon set statement_timeout = '10min'; +alter role anon reset statement_timeout; +reset role; diff --git a/nix/tests/sql/roles.sql b/nix/tests/sql/roles.sql index 34fd5db7e..5753d34de 100644 --- a/nix/tests/sql/roles.sql +++ b/nix/tests/sql/roles.sql @@ -65,3 +65,10 @@ from ( a.privilege_type in ('CREATE', 'USAGE') ) sub order by schema_order, schema_name, privilege_type, grantee, default_for; + +-- postgres can alter API roles' timeout +set role postgres; +alter role anon set statement_timeout = '10min'; + +alter role anon reset statement_timeout; +reset role; From e14b4979ef2a7c032da33debbb182d87dd33dca0 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Mon, 21 Jul 2025 17:55:46 +0800 Subject: [PATCH 040/134] Revert "chore: bump to pg_net 0.19.3" This reverts commit 2442765bf0453bf337e08632ff6cd09ce8e83696. --- nix/ext/pg_net.nix | 6 ++++-- nix/tests/expected/z_15_ext_interface.out | 6 ++---- nix/tests/expected/z_17_ext_interface.out | 6 ++---- nix/tests/expected/z_orioledb-17_ext_interface.out | 6 ++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 23715fba7..02d673297 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { pname = "pg_net"; - version = "0.19.3"; + version = "0.14.0"; buildInputs = [ curl @@ -19,9 +19,11 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-PZYIwkXp1rOzRCDZivJFMuEQBYJaaibUN/WkL+6crSg="; + hash = "sha256-c1pxhTyrE5j6dY+M5eKAboQNofIORS+Dccz+7HKEKQI="; }; + env.NIX_CFLAGS_COMPILE = "-Wno-error"; + installPhase = '' mkdir -p $out/{lib,share/postgresql/extension} diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index d3d9f7c4f..c652a95eb 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1161,11 +1161,9 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint - pg_net | net | wait_until_running | | void - pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -5229,7 +5227,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5059 rows) +(5057 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 46792e48f..d31894bc3 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1146,11 +1146,9 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint - pg_net | net | wait_until_running | | void - pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4873,7 +4871,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4716 rows) +(4714 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index 46792e48f..d31894bc3 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -1146,11 +1146,9 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint - pg_net | net | wait_until_running | | void - pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4873,7 +4871,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4716 rows) +(4714 rows) /* From 17ee0f50e058c8ef7bed887d8b033c58d6c614c8 Mon Sep 17 00:00:00 2001 From: divit <27228526+delgado3d@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:48:50 +0530 Subject: [PATCH 041/134] bump ami version --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index d3c1594b1..acd40a2de 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.002-orioledb" - postgres17: "17.4.1.059" - postgres15: "15.8.1.116" + postgresorioledb-17: "17.5.1.003-orioledb" + postgres17: "17.4.1.060" + postgres15: "15.8.1.117" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 08d00960c1fc5d7fd504663f367279bbf13b8356 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Fri, 18 Jul 2025 02:09:25 +0800 Subject: [PATCH 042/134] feat: supautils grants for auth.mfa_factors --- ansible/files/postgresql_config/supautils.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index 321343bbf..f8c4aa0a2 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -1,6 +1,6 @@ supautils.extensions_parameter_overrides = '{"pg_cron":{"schema":"pg_catalog"}}' -supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' -supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' +supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.mfa_factors","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' +supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.mfa_factors","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' # full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 From 8526618ef323c188410267f7f3c3a5777f031e72 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:16:50 +0800 Subject: [PATCH 043/134] fix: set default_txn_read_only on supabase_read_only_user --- ansible/vars.yml | 6 +++--- ...upabase_read_only_user_default_transaction_read_only.sql | 4 ++++ nix/tests/expected/roles.out | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 migrations/db/migrations/20250710151649_supabase_read_only_user_default_transaction_read_only.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index acd40a2de..d909120c5 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.003-orioledb" - postgres17: "17.4.1.060" - postgres15: "15.8.1.117" + postgresorioledb-17: "17.5.1.004-orioledb" + postgres17: "17.4.1.061" + postgres15: "15.8.1.118" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/migrations/20250710151649_supabase_read_only_user_default_transaction_read_only.sql b/migrations/db/migrations/20250710151649_supabase_read_only_user_default_transaction_read_only.sql new file mode 100644 index 000000000..b60d7ec16 --- /dev/null +++ b/migrations/db/migrations/20250710151649_supabase_read_only_user_default_transaction_read_only.sql @@ -0,0 +1,4 @@ +-- migrate:up +alter role supabase_read_only_user set default_transaction_read_only = on; + +-- migrate:down diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index 3832b0f00..69446110c 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -86,7 +86,7 @@ order by rolname; supabase_admin | {"search_path=\"$user\", public, auth, extensions",log_statement=none} supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} supabase_functions_admin | - supabase_read_only_user | + supabase_read_only_user | {default_transaction_read_only=on} supabase_replication_admin | supabase_storage_admin | {search_path=storage,log_statement=none} (29 rows) From cb6184834af249abe72fa0ff06a8f5d6c87ddc67 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:59:54 +0800 Subject: [PATCH 044/134] fix(ci): supabase-admin-agent naming (#1715) --- ansible/manifest-playbook.yml | 2 +- ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index 9a1636d0d..d297e6ceb 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -75,7 +75,7 @@ - name: supabase-admin-agent - pack archive shell: | - cd /tmp && tar -cJf supabase-admin-agent-{{ supabase_admin_agent_release }}-arm64.tar.xz supabase-admin-agent + cd /tmp && tar -cJf supabase-admin-agent-{{ supabase_admin_agent_release }}-arm64.tar.xz supabase-admin-agent-{{ supabase_admin_agent_release }}-linux-arm64 - name: upload archives shell: | diff --git a/ansible/vars.yml b/ansible/vars.yml index d909120c5..8beb4ea2a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.004-orioledb" - postgres17: "17.4.1.061" - postgres15: "15.8.1.118" + postgresorioledb-17: "17.5.1.005-orioledb" + postgres17: "17.4.1.062" + postgres15: "15.8.1.119" # Non Postgres Extensions pgbouncer_release: "1.19.0" From e2a13f60e76919663618135f7ec618874a44fc31 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Wed, 23 Jul 2025 16:23:11 +0100 Subject: [PATCH 045/134] fix: missing whitespace after jinja condition (#1718) --- ansible/files/postgres_exporter.service.j2 | 1 + ansible/vars.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible/files/postgres_exporter.service.j2 b/ansible/files/postgres_exporter.service.j2 index fd8b2a897..6baa18c0d 100644 --- a/ansible/files/postgres_exporter.service.j2 +++ b/ansible/files/postgres_exporter.service.j2 @@ -4,6 +4,7 @@ Description=Postgres Exporter [Service] Type=simple ExecStart=/opt/postgres_exporter/postgres_exporter --disable-settings-metrics --extend.query-path="/opt/postgres_exporter/queries.yml" --disable-default-metrics --no-collector.locks --no-collector.replication --no-collector.replication_slot --no-collector.stat_bgwriter --no-collector.stat_database --no-collector.stat_user_tables --no-collector.statio_user_tables --no-collector.wal {% if qemu_mode is defined and qemu_mode %}--no-collector.database {% endif %} + User=postgres Group=postgres Restart=always diff --git a/ansible/vars.yml b/ansible/vars.yml index 8beb4ea2a..8ea05d022 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.005-orioledb" - postgres17: "17.4.1.062" - postgres15: "15.8.1.119" + postgresorioledb-17: "17.5.1.006-orioledb" + postgres17: "17.4.1.063" + postgres15: "15.8.1.120" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 01471804edcff4130e2549d1279aa561a89f5b39 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Wed, 23 Jul 2025 17:39:17 +0100 Subject: [PATCH 046/134] fix: admin-agent timer file is a template (#1717) * fix: admin-agent timer file is a template * fix: create a template and issue variable * chore: version bump AMIs --- ...agent_salt.timer => supabase-admin-agent_salt.timer.j2} | 4 ++-- ansible/tasks/internal/supabase-admin-agent.yml | 4 ++-- ansible/vars.yml | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) rename ansible/files/supabase_admin_agent_config/{supabase-admin-agent_salt.timer => supabase-admin-agent_salt.timer.j2} (63%) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 similarity index 63% rename from ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer rename to ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 index 8044c2e1a..1c59cdc7c 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 @@ -4,8 +4,8 @@ Requires=supabase-admin-agent_salt.service [Timer] OnCalendar=*:0/10 -# Random delay up to {{ splay }} seconds splay -RandomizedDelaySec={{ splay }} +# Random delay up to {{ supabase_admin_agent_splay }} seconds splay +RandomizedDelaySec={{ supabase_admin_agent_splay }} AccuracySec=1s Persistent=true diff --git a/ansible/tasks/internal/supabase-admin-agent.yml b/ansible/tasks/internal/supabase-admin-agent.yml index 4e5f87e5e..ef5c948b5 100644 --- a/ansible/tasks/internal/supabase-admin-agent.yml +++ b/ansible/tasks/internal/supabase-admin-agent.yml @@ -66,8 +66,8 @@ force: yes - name: supabase-admin-agent - create salt systemd timer file - copy: - src: files/supabase_admin_agent_config/supabase-admin-agent_salt.timer + template: + src: files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 dest: /etc/systemd/system/supabase-admin-agent_salt.timer - name: supabase-admin-agent - create salt service file diff --git a/ansible/vars.yml b/ansible/vars.yml index 8ea05d022..927e81b0e 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.006-orioledb" - postgres17: "17.4.1.063" - postgres15: "15.8.1.120" + postgresorioledb-17: "17.5.1.007-orioledb" + postgres17: "17.4.1.064" + postgres15: "15.8.1.121" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -54,6 +54,7 @@ postgres_exporter_release_checksum: adminapi_release: 0.84.1 adminmgr_release: 0.25.1 supabase_admin_agent_release: 1.4.37 +supabase_admin_agent_splay: 30 vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb" From 02ec87fdad94cd62f7391357b022ffd650ff6608 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 24 Jul 2025 14:17:14 -0400 Subject: [PATCH 047/134] feat: advance to ubuntu 24.04 (#1416) * feat: wip advance to ubuntu 24.04 * fix; missing gp3 on image string * chore: non-interactive * chore: set hostname in dhcp client * chore: conform to new networking approach * ore: reverse he sha values * chore: fix kong address * ore: typo in url * chore: drop old removals * chore: remove defunct package * chore: restore wal-g build approach * chore: permission check and restore kong original version * chore: log output to debug * chore: increase wait time before health checks. * chore: post rebase cleanup * Update README.md Co-authored-by: Div Arora * chore: restore function * chore: remove unused file * chore: make command non-interactive * chore: readme script * chore: ubuntu 24.04 has moved to use networkd and netplan by default, ... rather than the traditional dhclient.conf approach. * chore: update README * chore: bump versions for staging release/testing * chore: keep kong pinned to this version, was not meant to change * fix: tmp use 20.04 untl worker scripts can be rewritten * feat: netplan security and apply * fix: netplan apply after upgrade * fix: transitional file name structure * feat: netplan apply * feat: Remove Requisite to prevent being killed when restarting networkd * fix: fix_ipv6 timer not needed in ubuntu 24-04 * feat: restore check and fix but disabled * chore: update qemu artifact to noble base Also makes the VM artifact release agnostic. * fix: restore stage for wal-g tasks to stage 2 * fix: removing arbitrary netplan apply * fix: file path * feat: postgrest 13.0.4 (#1685) * fix: url of postgrest download * Update ansible/vars.yml Co-authored-by: Laurence Isla * fix: correct URL for release * fix: correct url here too * chore: bump version for release --------- Co-authored-by: Div Arora Co-authored-by: Div Arora Co-authored-by: Laurence Isla --- .github/workflows/ami-release-nix-single.yml | 4 ++++ .github/workflows/ami-release-nix.yml | 4 ++++ ...ublish-nix-pgupgrade-bin-flake-version.yml | 8 +++++-- .github/workflows/testinfra-ami-build.yml | 4 ++-- Dockerfile-15 | 2 +- Dockerfile-kubernetes | 2 +- Dockerfile-orioledb-17 | 2 +- Makefile | 4 ---- README.md | 4 ++-- amazon-arm64-nix.pkr.hcl | 4 ++-- .../pg_upgrade_scripts/complete.sh | 1 + ansible/files/adminapi.sudoers.conf | 1 + ansible/files/permission_check.py | 2 -- .../systemd-networkd-check-and-fix.service | 1 + ansible/manifest-playbook.yml | 2 +- ansible/playbook.yml | 4 ++-- ...{fix_ipv6_ndisc.yml => fix-ipv6-ndisc.yml} | 6 ++--- ansible/tasks/setup-postgres.yml | 2 +- ansible/tasks/setup-postgrest.yml | 6 ++--- ansible/vars.yml | 23 ++++++++++--------- docker/Dockerfile | 4 ++-- ebssurrogate/files/sources-arm64.cfg | 20 ++++++++-------- ebssurrogate/files/sources.cfg | 20 ++++++++-------- ebssurrogate/scripts/chroot-bootstrap-nix.sh | 19 ++++++++++++--- .../scripts/surrogate-bootstrap-nix.sh | 2 +- nix/tools/update_readme.nu | 2 +- qemu-arm64-nix.pkr.hcl | 4 ++-- scripts/90-cleanup-qemu.sh | 6 ----- scripts/90-cleanup.sh | 6 +---- scripts/99-img_check.sh | 2 +- testinfra/README.md | 4 ++-- testinfra/test_ami_nix.py | 3 +++ tests/pg_upgrade/debug.sh | 2 +- 33 files changed, 98 insertions(+), 82 deletions(-) rename ansible/tasks/{fix_ipv6_ndisc.yml => fix-ipv6-ndisc.yml} (87%) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index d99939f1d..500bf26d5 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -103,6 +103,8 @@ jobs: - name: Upload nix flake revision to s3 staging run: | aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: configure aws credentials - prod uses: aws-actions/configure-aws-credentials@v4 @@ -122,6 +124,8 @@ jobs: - name: Upload nix flake revision to s3 prod run: | aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: Create release uses: softprops/action-gh-release@v2 diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index bf2df0c96..0c97d8374 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -125,6 +125,8 @@ jobs: - name: Upload nix flake revision to s3 staging run: | aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: configure aws credentials - prod uses: aws-actions/configure-aws-credentials@v4 @@ -144,6 +146,8 @@ jobs: - name: Upload nix flake revision to s3 prod run: | aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: Create release uses: softprops/action-gh-release@v2 diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index f816415b3..c8b3abe46 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -66,7 +66,9 @@ jobs: - name: Upload pg_upgrade scripts to s3 staging run: | - aws s3 cp /tmp/pg_upgrade_bin.tar.gz "s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz" + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: Slack Notification on Failure if: ${{ failure() }} @@ -113,7 +115,9 @@ jobs: - name: Upload pg_upgrade scripts to s3 prod run: | - aws s3 cp /tmp/pg_upgrade_bin.tar.gz "s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz" + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/24.04.tar.gz + aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/upgrade_bundle.tar.gz - name: Slack Notification on Failure if: ${{ failure() }} diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 321430c86..5636a34c3 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -34,8 +34,8 @@ jobs: include: - runner: arm-runner arch: arm64 - ubuntu_release: focal - ubuntu_version: 20.04 + ubuntu_release: noble + ubuntu_version: 24.04 mcpu: neoverse-n1 runs-on: ${{ matrix.runner }} timeout-minutes: 150 diff --git a/Dockerfile-15 b/Dockerfile-15 index 6acf86037..68e9f4e59 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -38,7 +38,7 @@ ARG index_advisor_release=0.2.0 ARG supautils_release=2.2.0 ARG wal_g_release=2.0.1 -FROM ubuntu:focal as base +FROM ubuntu:noble as base RUN apt update -y && apt install -y \ curl \ diff --git a/Dockerfile-kubernetes b/Dockerfile-kubernetes index 2a5e1ca1e..7337ee152 100644 --- a/Dockerfile-kubernetes +++ b/Dockerfile-kubernetes @@ -1,6 +1,6 @@ FROM alpine:3.22 -ADD ./output-cloudimg/packer-cloudimg /disk/focal.qcow2 +ADD ./output-cloudimg/packer-cloudimg /disk/image.qcow2 RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client aavmf virtiofsd \ && truncate -s 64M /root/varstore.img \ diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 4a0413cb0..41254e4f7 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -39,7 +39,7 @@ ARG index_advisor_release=0.2.0 ARG supautils_release=2.2.0 ARG wal_g_release=3.0.5 -FROM ubuntu:focal as base +FROM ubuntu:noble as base RUN apt update -y && apt install -y \ curl \ diff --git a/Makefile b/Makefile index 5bef8a430..96a4925ef 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,6 @@ init: qemu-arm64-nix.pkr.hcl output-cloudimg/packer-cloudimg: ansible qemu-arm64-nix.pkr.hcl packer build -var "git_sha=$(UPSTREAM_NIX_GIT_SHA)" qemu-arm64-nix.pkr.hcl -disk/focal-raw.img: output-cloudimg/packer-cloudimg - mkdir -p disk - sudo qemu-img convert -O raw output-cloudimg/packer-cloudimg disk/focal-raw.img - alpine-image: output-cloudimg/packer-cloudimg sudo nerdctl build . -t supabase-postgres-test:$(GIT_SHA) -f ./Dockerfile-kubernetes diff --git a/README.md b/README.md index edf245bc0..a176ccec5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to - ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html) - ✅ Postgres [postgresql-17.4](https://www.postgresql.org/docs/17/index.html) - ✅ Postgres [orioledb-postgresql-17_6](https://github.com/orioledb/orioledb) -- ✅ Ubuntu 20.04 (Focal Fossa). +- ✅ Ubuntu 24.04 (Noble Numbat). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. - ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images. ## Extensions @@ -115,7 +115,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | Goodie | Version | Description | | ------------- | :-------------: | ------------- | | [PgBouncer](https://www.pgbouncer.org/) | [1.19.0](http://www.pgbouncer.org/changelog.html#pgbouncer-119x) | Set up Connection Pooling. | -| [PostgREST](https://postgrest.org/en/stable/) | [v12.2.3](https://github.com/PostgREST/postgrest/releases/tag/v12.2.3) | Instantly transform your database into an RESTful API. | +| [PostgREST](https://postgrest.org/en/stable/) | [v13.0.4](https://github.com/PostgREST/postgrest/releases/tag/v13.0.4) | Instantly transform your database into an RESTful API. | | [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | --> ## Install diff --git a/amazon-arm64-nix.pkr.hcl b/amazon-arm64-nix.pkr.hcl index e460dfc72..f625ac4af 100644 --- a/amazon-arm64-nix.pkr.hcl +++ b/amazon-arm64-nix.pkr.hcl @@ -1,6 +1,6 @@ variable "ami" { type = string - default = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-*" + default = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-*" } variable "profile" { @@ -115,7 +115,7 @@ source "amazon-ebssurrogate" "source" { #secret_key = "${var.aws_secret_key}" force_deregister = var.force-deregister - # Use latest official ubuntu focal ami owned by Canonical. + # Use latest official ubuntu noble ami owned by Canonical. source_ami_filter { filters = { virtualization-type = "hvm" diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh index e170482e8..3f6f8d3d9 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/complete.sh @@ -266,6 +266,7 @@ function complete_pg_upgrade { echo "5.1. Restarting gotrue and postgrest" retry 3 service gotrue restart retry 3 service postgrest restart + else retry 3 CI_stop_postgres || true retry 3 CI_start_postgres diff --git a/ansible/files/adminapi.sudoers.conf b/ansible/files/adminapi.sudoers.conf index ae5537715..531d47ca1 100644 --- a/ansible/files/adminapi.sudoers.conf +++ b/ansible/files/adminapi.sudoers.conf @@ -23,6 +23,7 @@ Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl st %adminapi ALL= NOPASSWD: /bin/systemctl restart services.slice %adminapi ALL= NOPASSWD: /usr/sbin/nft -f /etc/nftables/supabase_managed.conf %adminapi ALL= NOPASSWD: /usr/bin/admin-mgr +%adminapi ALL= NOPASSWD: /usr/sbin/netplan apply %adminapi ALL= NOPASSWD: ENVOY %adminapi ALL= NOPASSWD: KONG %adminapi ALL= NOPASSWD: POSTGREST diff --git a/ansible/files/permission_check.py b/ansible/files/permission_check.py index 46f458f9a..72a1a2fe2 100644 --- a/ansible/files/permission_check.py +++ b/ansible/files/permission_check.py @@ -40,7 +40,6 @@ "backup": [{"groupname": "backup", "username": "backup"}], "list": [{"groupname": "list", "username": "list"}], "irc": [{"groupname": "irc", "username": "irc"}], - "gnats": [{"groupname": "gnats", "username": "gnats"}], "nobody": [{"groupname": "nogroup", "username": "nobody"}], "systemd-network": [ {"groupname": "systemd-network", "username": "systemd-network"} @@ -224,7 +223,6 @@ def main(): "backup", "list", "irc", - "gnats", "nobody", "systemd-network", "systemd-resolve", diff --git a/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.service b/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.service index 5e7094388..939edc9ce 100644 --- a/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.service +++ b/ansible/files/systemd-networkd/systemd-networkd-check-and-fix.service @@ -1,5 +1,6 @@ [Unit] Description=Check if systemd-networkd has broken NDisc routes and fix +# Remove Requisite to prevent being killed when restarting networkd Requisite=systemd-networkd.service After=systemd-networkd.service diff --git a/ansible/manifest-playbook.yml b/ansible/manifest-playbook.yml index d297e6ceb..ce02c805c 100644 --- a/ansible/manifest-playbook.yml +++ b/ansible/manifest-playbook.yml @@ -24,7 +24,7 @@ - name: PostgREST - download ubuntu binary archive (arm) get_url: - url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-20.04-aarch64.tar.xz" + url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-aarch64.tar.xz" dest: /tmp/postgrest-{{ postgrest_release }}-arm64.tar.xz checksum: "{{ postgrest_arm_release_checksum }}" timeout: 60 diff --git a/ansible/playbook.yml b/ansible/playbook.yml index bcd47ac9b..794b69895 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -78,8 +78,8 @@ - install-supabase-internal when: debpkg_mode or nixpkg_mode - - name: Fix IPv6 NDisc issues - import_tasks: tasks/fix_ipv6_ndisc.yml + - name: Fix IPv6 NDisc issues (disabled) + import_tasks: tasks/fix-ipv6-ndisc.yml tags: - install-supabase-internal when: (debpkg_mode or nixpkg_mode) and (qemu_mode is undefined) diff --git a/ansible/tasks/fix_ipv6_ndisc.yml b/ansible/tasks/fix-ipv6-ndisc.yml similarity index 87% rename from ansible/tasks/fix_ipv6_ndisc.yml rename to ansible/tasks/fix-ipv6-ndisc.yml index 7489a2fe1..8953fd880 100644 --- a/ansible/tasks/fix_ipv6_ndisc.yml +++ b/ansible/tasks/fix-ipv6-ndisc.yml @@ -25,9 +25,9 @@ - name: fix Network - reload systemd systemd: - daemon_reload: yes + daemon_reload: false -- name: fix Network - enable systemd timer +- name: fix Network - ensure systemd timer is installed but disabled systemd: name: systemd-networkd-check-and-fix.timer - enabled: true + enabled: false diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index a1b7e6c7f..2fe302488 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -23,7 +23,7 @@ - name: Postgres - install server apt: - name: postgresql-{{ postgresql_major }}={{ postgresql_release }}-1.pgdg20.04+1 + name: postgresql-{{ postgresql_major }}={{ postgresql_release }}-1.pgdg24.04+1 install_recommends: no when: debpkg_mode diff --git a/ansible/tasks/setup-postgrest.yml b/ansible/tasks/setup-postgrest.yml index b786ff3c9..df9fecb32 100644 --- a/ansible/tasks/setup-postgrest.yml +++ b/ansible/tasks/setup-postgrest.yml @@ -8,7 +8,7 @@ - name: PostgREST - add Postgres PPA main apt_repository: - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" + repo: "deb http://apt.postgresql.org/pub/repos/apt/ noble-pgdg {{ postgresql_major }}" state: present filename: postgresql-pgdg @@ -36,7 +36,7 @@ - name: PostgREST - remove Postgres PPA apt_repository: - repo: "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" + repo: "deb http://apt.postgresql.org/pub/repos/apt/ noble-pgdg {{ postgresql_major }}" state: absent - name: postgis - ensure dependencies do not get autoremoved @@ -48,7 +48,7 @@ - name: PostgREST - download ubuntu binary archive (arm) get_url: - url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-20.04-aarch64.tar.xz" + url: "https://github.com/PostgREST/postgrest/releases/download/v%7B%7B%20postgrest_release%20%7D%7D/postgrest-v%7B%7B%20postgrest_release%20%7D%7D-ubuntu-aarch64.tar.xz" dest: /tmp/postgrest.tar.xz checksum: "{{ postgrest_arm_release_checksum }}" timeout: 60 diff --git a/ansible/vars.yml b/ansible/vars.yml index 927e81b0e..b30469bec 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,19 +9,20 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.007-orioledb" - postgres17: "17.4.1.064" - postgres15: "15.8.1.121" + postgresorioledb-17: "17.5.1.008-orioledb" + postgres17: "17.4.1.065" + postgres15: "15.8.1.122" # Non Postgres Extensions pgbouncer_release: "1.19.0" pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682 -# The checksum can be found under "Assets", in the GitHub release page for each version: +# The checksum can be found under "Assets", in the GitHub release page for each version. +# The binaries used are: ubuntu-aarch64 and linux-static. # https://github.com/PostgREST/postgrest/releases -postgrest_release: "12.2.12" -postgrest_arm_release_checksum: sha256:6b2eaa5759329e024df76f79d93f6bb3d87a93de11433acc5d66aa6c96f81f90 -postgrest_x86_release_checksum: sha256:5de4092f1719da3353c40bf96c8dec6913f2254a7cd0b61cc05f233153b557d5 +postgrest_release: "13.0.4" +postgrest_arm_release_checksum: sha256:2b400200fb15eb5849267e4375fbbc516dd727afadd8786815b48074ed8c03e1 +postgrest_x86_release_checksum: sha256:a0052c8d4726f52349e0298f98da51140ef4941855548590ee88331afa617811 gotrue_release: 2.177.0 gotrue_release_checksum: sha1:664a26237618c4bfb1e33e4f03a540c3cef3e3c8 @@ -30,16 +31,16 @@ aws_cli_release: "2.23.11" salt_minion_version: 3007 -golang_version: "1.19.3" +golang_version: "1.22.11" golang_version_checksum: - arm64: sha256:99de2fe112a52ab748fb175edea64b313a0c8d51d6157dba683a6be163fd5eab - amd64: sha256:74b9640724fd4e6bb0ed2a1bc44ae813a03f1e72a4c76253e2d5c015494430ba + arm64: sha256:0fc88d966d33896384fbde56e9a8d80a305dc17a9f48f1832e061724b1719991 + amd64: sha256:9ebfcab26801fa4cf0627c6439db7a4da4d3c6766142a3dd83508240e4f21031 envoy_release: 1.28.0 envoy_release_checksum: sha1:b0a06e9cfb170f1993f369beaa5aa9d7ec679ce5 envoy_hot_restarter_release_checksum: sha1:6d43b89d266fb2427a4b51756b649883b0617eda -kong_release_target: focal # if it works, it works +kong_release_target: focal kong_deb: kong_2.8.1_arm64.deb kong_deb_checksum: sha1:2086f6ccf8454fe64435252fea4d29d736d7ec61 diff --git a/docker/Dockerfile b/docker/Dockerfile index 116377b5d..53a96029e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,8 @@ -ARG ubuntu_release=focal +ARG ubuntu_release=noble FROM ubuntu:${ubuntu_release} as base ARG ubuntu_release=flocal -ARG ubuntu_release_no=20.04 +ARG ubuntu_release_no=24.04 ARG postgresql_major=15 ARG postgresql_release=${postgresql_major}.1 diff --git a/ebssurrogate/files/sources-arm64.cfg b/ebssurrogate/files/sources-arm64.cfg index a2363773e..eed6c0f16 100644 --- a/ebssurrogate/files/sources-arm64.cfg +++ b/ebssurrogate/files/sources-arm64.cfg @@ -1,10 +1,10 @@ -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal main restricted -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal universe -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates universe -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal multiverse -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse -deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse -deb http://ports.ubuntu.com/ubuntu-ports focal-security main restricted -deb http://ports.ubuntu.com/ubuntu-ports focal-security universe -deb http://ports.ubuntu.com/ubuntu-ports focal-security multiverse +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble main restricted +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble universe +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble-updates universe +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble multiverse +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble-updates multiverse +deb http://REGION.clouds.ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted universe multiverse +deb http://ports.ubuntu.com/ubuntu-ports noble-security main restricted +deb http://ports.ubuntu.com/ubuntu-ports noble-security universe +deb http://ports.ubuntu.com/ubuntu-ports noble-security multiverse diff --git a/ebssurrogate/files/sources.cfg b/ebssurrogate/files/sources.cfg index ec3011807..a27be052f 100644 --- a/ebssurrogate/files/sources.cfg +++ b/ebssurrogate/files/sources.cfg @@ -1,10 +1,10 @@ -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal main restricted -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal-updates main restricted -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal universe -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal-updates universe -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal multiverse -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal-updates multiverse -deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse -deb http://security.ubuntu.com/ubuntu focal-security main restricted -deb http://security.ubuntu.com/ubuntu focal-security universe -deb http://security.ubuntu.com/ubuntu focal-security multiverse +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble main restricted +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble-updates main restricted +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble universe +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble-updates universe +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble multiverse +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble-updates multiverse +deb http://REGION.ec2.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu noble-security main restricted +deb http://security.ubuntu.com/ubuntu noble-security universe +deb http://security.ubuntu.com/ubuntu noble-security multiverse diff --git a/ebssurrogate/scripts/chroot-bootstrap-nix.sh b/ebssurrogate/scripts/chroot-bootstrap-nix.sh index cda6bd2aa..9a623eb12 100755 --- a/ebssurrogate/scripts/chroot-bootstrap-nix.sh +++ b/ebssurrogate/scripts/chroot-bootstrap-nix.sh @@ -58,7 +58,7 @@ function update_install_packages { apt-get upgrade -y # Install OpenSSH and other packages - sudo add-apt-repository universe + sudo add-apt-repository --yes universe apt-get update apt-get install -y --no-install-recommends \ openssh-server \ @@ -157,10 +157,21 @@ function disable_fsck { # Don't request hostname during boot but set hostname function setup_hostname { - sed -i 's/gethostname()/ubuntu /g' /etc/dhcp/dhclient.conf - sed -i 's/host-name,//g' /etc/dhcp/dhclient.conf + # Set the static hostname echo "ubuntu" > /etc/hostname chmod 644 /etc/hostname + # Update netplan configuration to not send hostname + cat << EOF > /etc/netplan/01-hostname.yaml +network: + version: 2 + ethernets: + eth0: + dhcp4: true + dhcp4-overrides: + send-hostname: false +EOF + # Set proper permissions for netplan security + chmod 600 /etc/netplan/01-hostname.yaml } # Set options for the default interface @@ -172,6 +183,8 @@ network: eth0: dhcp4: true EOF + # Set proper permissions for netplan security + chmod 600 /etc/netplan/eth0.yaml } function disable_sshd_passwd_auth { diff --git a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh index 39b8f4e82..965b1e07b 100755 --- a/ebssurrogate/scripts/surrogate-bootstrap-nix.sh +++ b/ebssurrogate/scripts/surrogate-bootstrap-nix.sh @@ -148,7 +148,7 @@ EOF } function setup_chroot_environment { - UBUNTU_VERSION=$(lsb_release -cs) # 'focal' for Ubuntu 20.04 + UBUNTU_VERSION=$(lsb_release -cs) # 'noble' for Ubuntu 24.04 # Bootstrap Ubuntu into /mnt debootstrap --arch ${ARCH} --variant=minbase "$UBUNTU_VERSION" /mnt diff --git a/nix/tools/update_readme.nu b/nix/tools/update_readme.nu index bfb46ab0a..b19c266a3 100755 --- a/nix/tools/update_readme.nu +++ b/nix/tools/update_readme.nu @@ -153,7 +153,7 @@ def update_readme [] { # Update Primary Features section let features_content = [ ($pg_versions | each {|version| create_version_link $version} | str join "\n") - "- ✅ Ubuntu 20.04 (Focal Fossa)." + "- ✅ Ubuntu 24.04 (Noble Numbat)." "- ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication." "- ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images." ] diff --git a/qemu-arm64-nix.pkr.hcl b/qemu-arm64-nix.pkr.hcl index 192796205..352ae5c38 100644 --- a/qemu-arm64-nix.pkr.hcl +++ b/qemu-arm64-nix.pkr.hcl @@ -74,8 +74,8 @@ source "qemu" "cloudimg" { format = "qcow2" headless = true http_directory = "http" - iso_checksum = "file:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS" - iso_url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img" + iso_checksum = "file:https://cloud-images.ubuntu.com/noble/current/SHA256SUMS" + iso_url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img" memory = 40000 qemu_binary = "qemu-system-aarch64" qemuargs = [ diff --git a/scripts/90-cleanup-qemu.sh b/scripts/90-cleanup-qemu.sh index 50d8d956f..c70c1d246 100644 --- a/scripts/90-cleanup-qemu.sh +++ b/scripts/90-cleanup-qemu.sh @@ -24,10 +24,8 @@ elif [ -n "$(command -v apt-get)" ]; then autoconf \ autotools-dev \ cmake-data \ - cpp-8 \ cpp-9 \ cpp-10 \ - gcc-8 \ gcc-9 \ gcc-10 \ git \ @@ -44,10 +42,6 @@ elif [ -n "$(command -v apt-get)" ]; then source /etc/os-release - apt-mark manual libevent-2.1-7 # required for pgbouncer - apt-get -y remove --purge ansible-core apport appstream bash-completion bcache-tools bind9-dnsutils bind9-host bind9-libs bolt btrfs-progs byobu command-not-found console-setup distro-info eject fonts-ubuntu-console friendly-recovery ftp fwupd gawk gdisk keyboard-configuration libvolume-key1 libicu66 libssl-dev lvm2 lxd-agent-loader man-db mdadm modemmanager mtd-utils nano netcat-openbsd nfs-common ntfs-3g parted pastebinit screen strace thin-provisioning-tools tmux usb-modeswitch vim vim-runtime wget whiptail xfsprogs - apt remove -y --purge libc6-dev linux-libc-dev libevent-dev libpcre3-dev libsystemd-dev - apt-get -y update apt-get -y upgrade apt-get -y autoremove diff --git a/scripts/90-cleanup.sh b/scripts/90-cleanup.sh index f2e19686d..644e5f7f6 100644 --- a/scripts/90-cleanup.sh +++ b/scripts/90-cleanup.sh @@ -24,10 +24,8 @@ elif [ -n "$(command -v apt-get)" ]; then autoconf \ autotools-dev \ cmake-data \ - cpp-8 \ cpp-9 \ cpp-10 \ - gcc-8 \ gcc-9 \ gcc-10 \ git \ @@ -36,14 +34,12 @@ elif [ -n "$(command -v apt-get)" ]; then libicu-dev \ libcgal-dev \ libgcc-9-dev \ - libgcc-8-dev \ ansible add-apt-repository --yes --remove ppa:ansible/ansible source /etc/os-release - apt-get -y remove --purge linux-headers-5.11.0-1021-aws - + apt-get -y update apt-get -y upgrade apt-get -y autoremove diff --git a/scripts/99-img_check.sh b/scripts/99-img_check.sh index 00b547641..ac958a5fc 100755 --- a/scripts/99-img_check.sh +++ b/scripts/99-img_check.sh @@ -569,7 +569,7 @@ osv=0 if [[ $OS == "Ubuntu" ]]; then ost=1 - if [[ $VER == "20.04" ]]; then + if [[ $VER == "24.04" ]]; then osv=1 elif [[ $VER == "18.04" ]]; then osv=1 diff --git a/testinfra/README.md b/testinfra/README.md index 977043c3b..6ecdeadb5 100644 --- a/testinfra/README.md +++ b/testinfra/README.md @@ -32,8 +32,8 @@ for layer in /tmp/extensions/*/layer.tar; do tar xvf "$layer" -C ansible/files/extensions --strip-components 1 done docker buildx build \ - --build-arg ubuntu_release=focal \ - --build-arg ubuntu_release_no=20.04 \ + --build-arg ubuntu_release=noble \ + --build-arg ubuntu_release_no=24.04 \ --build-arg postgresql_major=15 \ --build-arg postgresql_release=15.1 \ --build-arg CPPFLAGS=-mcpu=neoverse-n1 \ diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 864ab2861..d7b3ecca7 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -293,6 +293,9 @@ def gzip_then_base64_encode(s: str) -> str: )[0] instance.wait_until_running() + # Increase wait time before starting health checks + sleep(30) # Wait for 30 seconds to allow services to start + ec2logger = EC2InstanceConnectLogger(debug=False) temp_key = EC2InstanceConnectKey(ec2logger.get_logger()) ec2ic = boto3.client("ec2-instance-connect", region_name="ap-southeast-1") diff --git a/tests/pg_upgrade/debug.sh b/tests/pg_upgrade/debug.sh index b05d8941d..50fb9facc 100755 --- a/tests/pg_upgrade/debug.sh +++ b/tests/pg_upgrade/debug.sh @@ -24,7 +24,7 @@ if [ ! -f "$LATEST_VERSION_SCRIPTS" ]; then fi if [ ! -f "$LATEST_VERSION_BIN" ]; then - aws s3 cp "s3://${ARTIFACTS_BUCKET_NAME}/upgrades/postgres/supabase-postgres-${LATEST_PG_VERSION}/20.04.tar.gz" "$LATEST_VERSION_BIN" + aws s3 cp "s3://${ARTIFACTS_BUCKET_NAME}/upgrades/postgres/supabase-postgres-${LATEST_PG_VERSION}/24.04.tar.gz" "$LATEST_VERSION_BIN" fi rm -rf scripts/pg_upgrade_scripts From de14ba75e2bc64a8b6b4c9f3877879bdd8fb43ba Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 24 Jul 2025 21:57:37 -0400 Subject: [PATCH 048/134] fix: a few updates slipped by in merge, this PR fixes those (#1719) --- Dockerfile-17 | 2 +- Dockerfile-kubernetes | 2 +- ansible/vars.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile-17 b/Dockerfile-17 index 1f1309fc1..5ad8ed397 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -39,7 +39,7 @@ ARG index_advisor_release=0.2.0 ARG supautils_release=2.2.0 ARG wal_g_release=3.0.5 -FROM ubuntu:focal as base +FROM ubuntu:noble as base RUN apt update -y && apt install -y \ curl \ diff --git a/Dockerfile-kubernetes b/Dockerfile-kubernetes index 7337ee152..e27ec2ce7 100644 --- a/Dockerfile-kubernetes +++ b/Dockerfile-kubernetes @@ -6,7 +6,7 @@ RUN apk add --no-cache qemu-system-aarch64 qemu-img openssh-client aavmf virtiof && truncate -s 64M /root/varstore.img \ && truncate -s 64M /root/efi.img \ && dd if=/usr/share/AAVMF/QEMU_EFI.fd of=/root/efi.img conv=notrunc \ - && qemu-img create -f qcow2 /tmp/disk.qcow2 -b /disk/focal.qcow2 -F qcow2 \ + && qemu-img create -f qcow2 /tmp/disk.qcow2 -b /disk/image.qcow2 -F qcow2 \ && apk del --no-cache aavmf qemu-img CMD exec /bin/sh -c "trap : TERM INT; sleep 9999999999d & wait" diff --git a/ansible/vars.yml b/ansible/vars.yml index b30469bec..3ab3ab7a3 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.008-orioledb" - postgres17: "17.4.1.065" - postgres15: "15.8.1.122" + postgresorioledb-17: "17.5.1.009-orioledb" + postgres17: "17.4.1.066" + postgres15: "15.8.1.123" # Non Postgres Extensions pgbouncer_release: "1.19.0" From ca89fbd84aebaf27bc8b27bb36e636d75572fbe7 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Sun, 27 Jul 2025 10:21:14 +0800 Subject: [PATCH 049/134] chore: remove unused packages from qemu build --- ansible/playbook.yml | 2 +- ansible/vars.yml | 6 ++--- qemu-arm64-nix.pkr.hcl | 8 ++++++- scripts/90-cleanup-qemu.sh | 47 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 794b69895..0991a813a 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -198,7 +198,7 @@ - collect-binaries when: debpkg_mode - - name: Install osquery from nixpkgs binary cache + - name: Purge snapd become: yes shell: | apt autoremove -y --purge snapd diff --git a/ansible/vars.yml b/ansible/vars.yml index 3ab3ab7a3..580959265 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.009-orioledb" - postgres17: "17.4.1.066" - postgres15: "15.8.1.123" + postgresorioledb-17: "17.5.1.010-orioledb" + postgres17: "17.4.1.067" + postgres15: "15.8.1.124" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/qemu-arm64-nix.pkr.hcl b/qemu-arm64-nix.pkr.hcl index 352ae5c38..497871774 100644 --- a/qemu-arm64-nix.pkr.hcl +++ b/qemu-arm64-nix.pkr.hcl @@ -74,9 +74,15 @@ source "qemu" "cloudimg" { format = "qcow2" headless = true http_directory = "http" + # TODO (darora): switch to minimal images + # iso_checksum = "file:https://cloud-images.ubuntu.com/minimal/releases/noble/release/SHA256SUMS" + # iso_url = "https://cloud-images.ubuntu.com/minimal/releases/noble/release/ubuntu-24.04-minimal-cloudimg-arm64.img" iso_checksum = "file:https://cloud-images.ubuntu.com/noble/current/SHA256SUMS" iso_url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img" memory = 40000 + qemu_img_args { + convert = ["-o", "compression_type=zstd"] + } qemu_binary = "qemu-system-aarch64" qemuargs = [ ["-machine", "virt,gic-version=3"], @@ -84,7 +90,7 @@ source "qemu" "cloudimg" { ["-device", "virtio-gpu-pci"], ["-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.fd"], ["-drive", "if=pflash,format=raw,id=ovmf_vars,file=AAVMF_VARS.fd"], - ["-drive", "file=output-cloudimg/packer-cloudimg,format=qcow2"], + ["-drive", "file=output-cloudimg/packer-cloudimg,if=virtio,format=qcow2,discard=on,detect-zeroes=unmap"], ["-drive", "file=seeds-cloudimg.iso,format=raw"], ["--enable-kvm"] ] diff --git a/scripts/90-cleanup-qemu.sh b/scripts/90-cleanup-qemu.sh index c70c1d246..e6a585001 100644 --- a/scripts/90-cleanup-qemu.sh +++ b/scripts/90-cleanup-qemu.sh @@ -42,15 +42,47 @@ elif [ -n "$(command -v apt-get)" ]; then source /etc/os-release - apt-get -y update - apt-get -y upgrade + apt-mark manual libevent-2.1-7t64 + + apt-get remove -y --purge ansible-core apport appstream bash-completion bcache-tools bind9-dnsutils bind9-host bind9-libs bolt btrfs-progs byobu command-not-found console-setup distro-info eject fonts-ubuntu-console friendly-recovery ftp fwupd gawk gdisk keyboard-configuration libvolume-key1 libssl-dev lvm2 lxd-agent-loader man-db mdadm modemmanager mtd-utils nano netcat-openbsd nfs-common ntfs-3g parted pastebinit screen strace thin-provisioning-tools tmux usb-modeswitch vim vim-runtime wget whiptail xfsprogs + + apt remove -y --purge libc6-dev linux-libc-dev libevent-dev libpcre3-dev libsystemd-dev packagekit multipath-tools unattended-upgrades plymouth gnupg open-vm-tools xauth lxd-installer publicsuffix libclang-cpp18 python3-twisted python-babel-localedata libicu74 python3-pygments fonts-dejavu* python3-botocore + + apt-get remove -y --purge linux-headers* + + # remove old kernels + # CURRENT_KERNEL="$(uname -r | sed 's/-generic//')" + # INSTALLED_KERNELS=$(dpkg -l | awk '{print $2}' | grep -Eo 'linux-(image|headers|modules|tools)-[0-9]+' | sed -E 's/linux-(image|modules|tools)-//' | sort -Vu) + # REMOVE_KERNELS=$(echo "$INSTALLED_KERNELS" | grep -v -e "$CURRENT_KERNEL") + # for VER in $REMOVE_KERNELS; do + # for PREFIX in linux-image linux-modules linux-tools; do + # for PKG in $(dpkg -l | awk '{print $2}' | grep "^$PREFIX-$VER"); do + # apt-get purge -y "$PKG" + # done + # done + # done + # update-grub + apt-get -y autoremove apt-get -y autoclean + + apt-get -y update + apt-get -y upgrade + fi + +systemctl set-default multi-user.target +systemctl disable getty@tty1.service +systemctl mask getty@tty1.service +systemctl mask graphical.target + rm -rf /tmp/* /var/tmp/* history -c cat /dev/null > /root/.bash_history unset HISTFILE + +journalctl --rotate +journalctl --vacuum-time=1s find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; rm -rf /var/log/*.gz /var/log/*.[0-9] /var/log/*-???????? rm -rf /var/lib/cloud/instances/* @@ -60,3 +92,14 @@ chmod 600 /etc/ssh/revoked_keys cat /dev/null > /var/log/lastlog cat /dev/null > /var/log/wtmp + +dd if=/dev/zero of=/zerofile & + PID=$! + while [ -d /proc/$PID ] + do + printf "." + sleep 5 + done +sync; rm /zerofile; sync + +fstrim / From ae29c6f6d07e8f05f54fe5525ff7827fc3bceb7f Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Tue, 29 Jul 2025 12:23:40 +0100 Subject: [PATCH 050/134] fix: add wants, requires and after to supabase-admin-agent systemd unit (#1726) --- .../supabase-admin-agent_salt.service | 4 +++- ansible/vars.yml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service index 92f1d2e31..f368008b4 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service @@ -1,6 +1,8 @@ [Unit] Description=Configuration management via supabase-admin-agent salt -After=network.target +After=network.target local-fs.target tmp.mount +Wants=network-online.target +Requires=local-fs.target [Service] Type=oneshot diff --git a/ansible/vars.yml b/ansible/vars.yml index 580959265..fcbe8eb91 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.010-orioledb" - postgres17: "17.4.1.067" - postgres15: "15.8.1.124" + postgresorioledb-17: "17.5.1.011-orioledb" + postgres17: "17.4.1.068" + postgres15: "15.8.1.125" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -54,7 +54,7 @@ postgres_exporter_release_checksum: adminapi_release: 0.84.1 adminmgr_release: 0.25.1 -supabase_admin_agent_release: 1.4.37 +supabase_admin_agent_release: 1.4.38 supabase_admin_agent_splay: 30 vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" From d0fbf41a7977a6551cc0b191ee6d37abcd9569bf Mon Sep 17 00:00:00 2001 From: andres suarez Date: Wed, 30 Jul 2025 19:11:38 +0200 Subject: [PATCH 051/134] feat: add script to mount/unmount disks (#1727) * feat: add script to mount/unmount disks * feat: add script to unmount disk * fix: rmove files to correct path * feat: validating the disk in a state --------- Co-authored-by: andres.suarez --- .../files/admin_api_scripts/mount-volume.sh | 62 +++++++++++++++++++ .../files/admin_api_scripts/unmount-volume.sh | 43 +++++++++++++ ansible/files/adminapi.sudoers.conf | 2 + ansible/tasks/internal/admin-api.yml | 2 + 4 files changed, 109 insertions(+) create mode 100644 ansible/files/admin_api_scripts/mount-volume.sh create mode 100644 ansible/files/admin_api_scripts/unmount-volume.sh diff --git a/ansible/files/admin_api_scripts/mount-volume.sh b/ansible/files/admin_api_scripts/mount-volume.sh new file mode 100644 index 000000000..5f4277f2d --- /dev/null +++ b/ansible/files/admin_api_scripts/mount-volume.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +set -euo pipefail + +DEVICE=${1:-} +MOUNT_POINT=${2:-} + +if [[ -z "$DEVICE" || -z "$MOUNT_POINT" ]]; then + echo "Usage: $0 " + echo "Example: sudo ./mount-volume.sh /dev/nvme1n1 /data/150008" + exit 1 +fi + +# Mount a block device to a specified mount point +# If the device is not formatted, format it as ext4 +# Set ownership to postgres:postgres and permissions to 750 +# Add the mount entry to /etc/fstab for persistence across reboots + +OWNER="postgres:postgres" +PERMISSIONS="750" +FSTYPE="ext4" +MOUNT_OPTS="defaults" +FSTAB_FILE="/etc/fstab" + +if [ ! -b "$DEVICE" ]; then + echo "Error: Block device '$DEVICE' does not exist." + exit 2 +fi + +if ! blkid "$DEVICE" >/dev/null 2>&1; then + echo "Device $DEVICE appears unformatted. Formatting as $FSTYPE..." + mkfs."$FSTYPE" -F "$DEVICE" +else + echo "$DEVICE already has a filesystem — skipping format." +fi + +mkdir -p "$MOUNT_POINT" + +e2fsck -pf "$DEVICE" + +if ! mountpoint -q "$MOUNT_POINT"; then + echo "Mounting $DEVICE to $MOUNT_POINT" + mount -t "$FSTYPE" -o "$MOUNT_OPTS" "$DEVICE" "$MOUNT_POINT" +else + echo "$MOUNT_POINT is already mounted" +fi + +echo "Setting ownership and permissions on $MOUNT_POINT" +chown "$OWNER" "$MOUNT_POINT" +chmod "$PERMISSIONS" "$MOUNT_POINT" + +UUID=$(blkid -s UUID -o value "$DEVICE") +FSTAB_LINE="UUID=$UUID $MOUNT_POINT $FSTYPE $MOUNT_OPTS 0 2" + +if ! grep -q "$UUID" "$FSTAB_FILE"; then + echo "Adding $FSTAB_LINE to $FSTAB_FILE" + echo "$FSTAB_LINE" >> "$FSTAB_FILE" +else + echo "UUID $UUID already in $FSTAB_FILE — skipping" +fi + +echo "Mounted $DEVICE at $MOUNT_POINT with postgres:postgres and mode $PERMISSIONS" diff --git a/ansible/files/admin_api_scripts/unmount-volume.sh b/ansible/files/admin_api_scripts/unmount-volume.sh new file mode 100644 index 000000000..6250b8c47 --- /dev/null +++ b/ansible/files/admin_api_scripts/unmount-volume.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -euo pipefail + +MOUNT_POINT=${1:-} +DELETE_FLAG=${2:-} + +if [[ -z "$MOUNT_POINT" ]]; then + echo "Usage: $0 [--delete-dir]" + echo "Unmount only: sudo ./unmount-volume.sh /data/150008" + echo "Unmount delete dir: sudo ./unmount-volume.sh /data/150008 --delete-dir" + exit 1 +fi + +# Unmount a block device from a specified mount point +# Remove the corresponding entry from /etc/fstab for persistence across reboots + +FSTAB_FILE="/etc/fstab" +BACKUP_FILE="/etc/fstab.bak" + +if mountpoint -q "$MOUNT_POINT"; then + echo "Unmounting $MOUNT_POINT" + umount "$MOUNT_POINT" +else + echo "$MOUNT_POINT is not currently mounted — skipping umount" +fi + +UUID=$(findmnt -no UUID "$MOUNT_POINT" 2>/dev/null || true) + +if [[ -n "$UUID" ]]; then + echo "Removing UUID=$UUID from $FSTAB_FILE" + cp "$FSTAB_FILE" "$BACKUP_FILE" + sed -i "/UUID=${UUID//\//\\/}/d" "$FSTAB_FILE" +else + echo "Could not find UUID for $MOUNT_POINT — skipping fstab cleanup" +fi + +if [[ "$DELETE_FLAG" == "--delete-dir" ]]; then + echo "Deleting mount point directory: $MOUNT_POINT" + rm -rf "$MOUNT_POINT" +fi + +echo "Unmount and cleanup complete for $MOUNT_POINT" diff --git a/ansible/files/adminapi.sudoers.conf b/ansible/files/adminapi.sudoers.conf index 531d47ca1..904377c29 100644 --- a/ansible/files/adminapi.sudoers.conf +++ b/ansible/files/adminapi.sudoers.conf @@ -5,6 +5,8 @@ Cmnd_Alias GOTRUE = /bin/systemctl start gotrue.service, /bin/systemctl stop got Cmnd_Alias PGBOUNCER = /bin/systemctl start pgbouncer.service, /bin/systemctl stop pgbouncer.service, /bin/systemctl restart pgbouncer.service, /bin/systemctl disable pgbouncer.service, /bin/systemctl enable pgbouncer.service, /bin/systemctl reload pgbouncer.service, /bin/systemctl try-restart pgbouncer.service %adminapi ALL= NOPASSWD: /root/grow_fs.sh +%adminapi ALL= NOPASSWD: /root/mount-volume.sh +%adminapi ALL= NOPASSWD: /root/unmount-volume.sh %adminapi ALL= NOPASSWD: /root/manage_readonly_mode.sh %adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/prepare.sh %adminapi ALL= NOPASSWD: /etc/adminapi/pg_upgrade_scripts/initiate.sh diff --git a/ansible/tasks/internal/admin-api.yml b/ansible/tasks/internal/admin-api.yml index 5eb6fd276..5844b3f54 100644 --- a/ansible/tasks/internal/admin-api.yml +++ b/ansible/tasks/internal/admin-api.yml @@ -14,6 +14,8 @@ - { file: "grow_fs.sh" } - { file: "manage_readonly_mode.sh" } - { file: "pg_egress_collect.pl" } + - { file: "mount-volume.sh" } + - { file: "unmount-volume.sh" } - name: give adminapi user permissions copy: From e1ac8804019e4c3905fb8d0a47f0468605728f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 30 Jul 2025 22:55:37 +0200 Subject: [PATCH 052/134] fix(ext/wrappers): restore backward compatibility files for postgres upgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Postgres upgrade is failing due to missing files in the wrappers. Refactor extension build to move file creation from individual builds to the final buildEnv stage, ensuring all version-specific library symlinks and migration SQL files are properly included for postgres upgrades.
Files present in the extension before upgrading the extension ```bash $ nix build -L github:supabase/postgres/4db4d5b94269398dc167fe96ea43fc4336bff8b5\#packages.x86_64-linux.psql_15/exts/supabase-wrappers $ tree result result/ ├── lib │   ├── wrappers-0.1.0.so -> wrappers.so │   ├── wrappers-0.1.10.so -> wrappers.so │   ├── wrappers-0.1.11.so -> wrappers.so │   ├── wrappers-0.1.12.so -> wrappers.so │   ├── wrappers-0.1.14.so -> wrappers.so │   ├── wrappers-0.1.15.so -> wrappers.so │   ├── wrappers-0.1.16.so -> wrappers.so │   ├── wrappers-0.1.17.so -> wrappers.so │   ├── wrappers-0.1.18.so -> wrappers.so │   ├── wrappers-0.1.19.so -> wrappers.so │   ├── wrappers-0.1.1.so -> wrappers.so │   ├── wrappers-0.1.4.so -> wrappers.so │   ├── wrappers-0.1.5.so -> wrappers.so │   ├── wrappers-0.1.6.so -> wrappers.so │   ├── wrappers-0.1.7.so -> wrappers.so │   ├── wrappers-0.1.8.so -> wrappers.so │   ├── wrappers-0.1.9.so -> wrappers.so │   ├── wrappers-0.2.0.so -> wrappers.so │   ├── wrappers-0.3.0.so -> wrappers.so │   ├── wrappers-0.3.1.so -> wrappers.so │   ├── wrappers-0.4.0.so -> wrappers.so │   ├── wrappers-0.4.1.so -> wrappers.so │   ├── wrappers-0.4.2.so -> wrappers.so │   ├── wrappers-0.4.3.so -> wrappers.so │   ├── wrappers-0.4.4.so -> wrappers.so │   ├── wrappers-0.4.5.so -> wrappers.so │   ├── wrappers-0.4.6.so -> wrappers.so │   ├── wrappers-0.5.0.so -> wrappers.so │   └── wrappers.so └── share └── postgresql └── extension ├── wrappers--0.1.0--0.5.0.sql ├── wrappers--0.1.10--0.5.0.sql ├── wrappers--0.1.1--0.5.0.sql ├── wrappers--0.1.11--0.5.0.sql ├── wrappers--0.1.12--0.5.0.sql ├── wrappers--0.1.14--0.5.0.sql ├── wrappers--0.1.15--0.5.0.sql ├── wrappers--0.1.16--0.5.0.sql ├── wrappers--0.1.17--0.5.0.sql ├── wrappers--0.1.18--0.5.0.sql ├── wrappers--0.1.19--0.5.0.sql ├── wrappers--0.1.4--0.5.0.sql ├── wrappers--0.1.5--0.5.0.sql ├── wrappers--0.1.6--0.5.0.sql ├── wrappers--0.1.7--0.5.0.sql ├── wrappers--0.1.8--0.5.0.sql ├── wrappers--0.1.9--0.5.0.sql ├── wrappers--0.2.0--0.5.0.sql ├── wrappers--0.3.0--0.5.0.sql ├── wrappers--0.3.1--0.5.0.sql ├── wrappers--0.4.0--0.5.0.sql ├── wrappers--0.4.1--0.5.0.sql ├── wrappers--0.4.2--0.5.0.sql ├── wrappers--0.4.3--0.5.0.sql ├── wrappers--0.4.4--0.5.0.sql ├── wrappers--0.4.5--0.5.0.sql ├── wrappers--0.4.6--0.5.0.sql ├── wrappers--0.5.0.sql └── wrappers.control 5 directories, 58 files ```
Files present in the extension after upgrading the extension (after #1663 was merged) ```bash $ nix build -L github:supabase/postgres/develop\#packages.x86_64-linux.psql_15/exts/wrappers-all $ tree result result/ ├── lib │   ├── wrappers-0.5.3.so -> /nix/store/g84xfq2m4wrxwsrh63yrs4df44bwj52b-wrappers-0.5.3/lib/wrappers-0.5.3.so │   └── wrappers.so -> /nix/store/g84xfq2m4wrxwsrh63yrs4df44bwj52b-wrappers-0.5.3/lib/wrappers.so └── share └── postgresql └── extension ├── wrappers--0.5.3.control -> /nix/store/g84xfq2m4wrxwsrh63yrs4df44bwj52b-wrappers-0.5.3/share/postgresql/extension/wrappers--0.5.3.control ├── wrappers--0.5.3.sql -> /nix/store/g84xfq2m4wrxwsrh63yrs4df44bwj52b-wrappers-0.5.3/share/postgresql/extension/wrappers--0.5.3.sql └── wrappers.control -> /nix/store/g84xfq2m4wrxwsrh63yrs4df44bwj52b-wrappers-0.5.3/share/postgresql/extension/wrappers.control 5 directories, 5 files ```
Files present in the extension with this commit ```bash $ nix build -L .\#packages.x86_64-linux.psql_15/exts/wrappers-all $ tree result result/ ├── lib │   ├── wrappers-0.1.0.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.10.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.11.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.12.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.14.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.15.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.16.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.17.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.18.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.19.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.1.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.4.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.5.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.6.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.7.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.8.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.1.9.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.2.0.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.3.0.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.3.1.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.0.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.1.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.2.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.3.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.4.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.5.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.4.6.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.5.0.so -> /nix/store/w6yr0d0v8hxm32z1lh3p4m09gayli1sh-wrappers/lib/wrappers.so │   ├── wrappers-0.5.3.so -> /nix/store/m15jazn3jznd17naihs4w413r2wdwzpz-wrappers-0.5.3/lib/wrappers-0.5.3.so │   └── wrappers.so -> wrappers-0.5.3.so └── share └── postgresql └── extension ├── wrappers--0.1.0--0.5.3.sql ├── wrappers--0.1.10--0.5.3.sql ├── wrappers--0.1.1--0.5.3.sql ├── wrappers--0.1.11--0.5.3.sql ├── wrappers--0.1.12--0.5.3.sql ├── wrappers--0.1.14--0.5.3.sql ├── wrappers--0.1.15--0.5.3.sql ├── wrappers--0.1.16--0.5.3.sql ├── wrappers--0.1.17--0.5.3.sql ├── wrappers--0.1.18--0.5.3.sql ├── wrappers--0.1.19--0.5.3.sql ├── wrappers--0.1.4--0.5.3.sql ├── wrappers--0.1.5--0.5.3.sql ├── wrappers--0.1.6--0.5.3.sql ├── wrappers--0.1.7--0.5.3.sql ├── wrappers--0.1.8--0.5.3.sql ├── wrappers--0.1.9--0.5.3.sql ├── wrappers--0.2.0--0.5.3.sql ├── wrappers--0.3.0--0.5.3.sql ├── wrappers--0.3.1--0.5.3.sql ├── wrappers--0.4.0--0.5.3.sql ├── wrappers--0.4.1--0.5.3.sql ├── wrappers--0.4.2--0.5.3.sql ├── wrappers--0.4.3--0.5.3.sql ├── wrappers--0.4.4--0.5.3.sql ├── wrappers--0.4.5--0.5.3.sql ├── wrappers--0.4.6--0.5.3.sql ├── wrappers--0.5.0--0.5.3.sql ├── wrappers--0.5.3.control -> /nix/store/m15jazn3jznd17naihs4w413r2wdwzpz-wrappers-0.5.3/share/postgresql/extension/wrappers--0.5.3.control ├── wrappers--0.5.3.sql -> /nix/store/m15jazn3jznd17naihs4w413r2wdwzpz-wrappers-0.5.3/share/postgresql/extension/wrappers--0.5.3.sql └── wrappers.control 5 directories, 61 files ```
--- nix/ext/wrappers/default.nix | 113 ++++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 36 deletions(-) diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 218c65e77..9b36bec9c 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -17,7 +17,6 @@ let version: hash: rustVersion: pgrxVersion: let cargo = rust-bin.stable.${rustVersion}.default; - #previousVersions = lib.filter (v: v != version) versions; # FIXME mkPgrxExtension = callPackages ../../cargo-pgrx/mkPgrxExtension.nix { inherit rustVersion pgrxVersion; }; @@ -129,20 +128,12 @@ let doCheck = false; postInstall = '' - create_control_files() { - sed -e "/^default_version =/d" \ - -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ - $out/share/postgresql/extension/${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control - rm $out/share/postgresql/extension/${pname}.control - - if [[ "${version}" == "${latestVersion}" ]]; then - { - echo "default_version = '${latestVersion}'" - cat $out/share/postgresql/extension/${pname}--${latestVersion}.control - } > $out/share/postgresql/extension/${pname}.control - ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} - fi - } + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}-${version}'|" \ + $out/share/postgresql/extension/${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + rm $out/share/postgresql/extension/${pname}.control + } create_control_files ''; @@ -165,6 +156,37 @@ let }; } ); + previouslyPackagedVersions = [ + "0.5.0" + "0.4.6" + "0.4.5" + "0.4.4" + "0.4.3" + "0.4.2" + "0.4.1" + "0.4.0" + "0.3.1" + "0.3.0" + "0.2.0" + "0.1.19" + "0.1.18" + "0.1.17" + "0.1.16" + "0.1.15" + "0.1.14" + "0.1.12" + "0.1.11" + "0.1.10" + "0.1.9" + "0.1.8" + "0.1.7" + "0.1.6" + "0.1.5" + "0.1.4" + "0.1.1" + "0.1.0" + ]; + numberOfPreviouslyPackagedVersions = builtins.length previouslyPackagedVersions; allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).wrappers; supportedVersions = lib.filterAttrs ( _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql @@ -184,29 +206,48 @@ buildEnv { "/share/postgresql/extension" ]; postBuild = '' - # checks - (set -x - test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ - toString (numberOfVersions + 1) - }" - ) - - create_sql_files() { - PREVIOUS_VERSION="" - while IFS= read -r i; do - FILENAME=$(basename "$i") - DIRNAME=$(dirname "$i") - VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)" - if [[ "$PREVIOUS_VERSION" != "" ]]; then - echo "Processing $i" - MIGRATION_FILENAME="$DIRNAME/''${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}" - cp "$i" "$MIGRATION_FILENAME" - fi - PREVIOUS_VERSION="$VERSION" - done < <(find $out -name '*.sql' | sort -V) + create_control_files() { + # Create main control file pointing to latest version + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + } + + create_lib_files() { + # Create main library symlink to latest version + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + + # Create symlinks for all previously packaged versions to main library + for v in ${lib.concatStringsSep " " previouslyPackagedVersions}; do + ln -sfn $out/lib/${pname}${postgresql.dlSuffix} $out/lib/${pname}-$v${postgresql.dlSuffix} + done } - create_sql_files + create_migration_sql_files() { + # Create migration SQL files from previous versions to newer versions + for prev_version in ${lib.concatStringsSep " " previouslyPackagedVersions}; do + for curr_version in ${lib.concatStringsSep " " versions}; do + if [[ "$(printf '%s\n%s' "$prev_version" "$curr_version" | sort -V | head -n1)" == "$prev_version" ]] && [[ "$prev_version" != "$curr_version" ]]; then + main_sql_file="$out/share/postgresql/extension/wrappers--$curr_version.sql" + if [ -f "$main_sql_file" ]; then + new_file="$out/share/postgresql/extension/wrappers--$prev_version--$curr_version.sql" + cp "$main_sql_file" "$new_file" + sed -i 's|$libdir/wrappers-[0-9.]*|$libdir/wrappers|g' "$new_file" + fi + fi + done + done + } + + create_control_files + create_lib_files + create_migration_sql_files + + # checks + (test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + numberOfPreviouslyPackagedVersions + 1) + }") ''; passthru = { inherit versions numberOfVersions; From b3ce15fe1c671ae3cbdf190ad1dc5326c6fc1ca9 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 4 Aug 2025 11:42:54 -0400 Subject: [PATCH 053/134] tests: release candidate wrappers fix (#1731) * tests: release candidate wrappers fix * chore: rename suffix to avoid conflict * chore: final version bump to release --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index fcbe8eb91..e15b730ad 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.011-orioledb" - postgres17: "17.4.1.068" - postgres15: "15.8.1.125" + postgresorioledb-17: "17.5.1.012-orioledb" + postgres17: "17.4.1.069" + postgres15: "15.8.1.126" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 9cb7409d83d87c33aac63103704c6c796cb94198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 5 Aug 2025 23:07:33 +0200 Subject: [PATCH 054/134] feat: support multiple versions of the index_advisor extension (#1671) * feat: multiple versions for the index_advisor extension Build multiple versions of the index_advisor extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * Change VM name suffix * chore: bump testing version * chore: formatting * tests: bump version to test * fix: account for access needed by macos * fix: handle flake check user in darwin env * fix: pin version of macos * fix: trying without cleanup * fix: revert workflow * fix: disable pgtap * fix: restore tap tests * fix: restore and check version * chore: bump version for final testing * fix: include orioledb-17 in index_advisor * feat: bump version to release --------- Co-authored-by: Sam Rose --- .github/workflows/nix-build.yml | 1 + ansible/vars.yml | 6 +- nix/ext/index_advisor.nix | 88 ++++++++++++++----- nix/ext/tests/index_advisor.nix | 147 ++++++++++++++++++++++++++++++++ nix/ext/versions.json | 10 +++ 5 files changed, 230 insertions(+), 22 deletions(-) create mode 100644 nix/ext/tests/index_advisor.nix diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 077c525dd..362d3ff5e 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -82,6 +82,7 @@ jobs: - name: Aggressive disk cleanup for DuckDB build if: matrix.runner == 'macos-latest-xlarge' run: | + nix --version echo "=== BEFORE CLEANUP ===" df -h # Remove major space consumers diff --git a/ansible/vars.yml b/ansible/vars.yml index e15b730ad..4e75577e6 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.012-orioledb" - postgres17: "17.4.1.069" - postgres15: "15.8.1.126" + postgresorioledb-17: "17.5.1.013-orioledb" + postgres17: "17.4.1.070" + postgres15: "15.8.1.127" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/index_advisor.nix b/nix/ext/index_advisor.nix index 19777f39e..4e40214ec 100644 --- a/nix/ext/index_advisor.nix +++ b/nix/ext/index_advisor.nix @@ -1,34 +1,84 @@ { + pkgs, lib, stdenv, fetchFromGitHub, postgresql, }: -stdenv.mkDerivation rec { +let pname = "index_advisor"; - version = "0.2.0"; + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; - buildInputs = [ postgresql ]; + buildInputs = [ postgresql ]; - src = fetchFromGitHub { - owner = "olirice"; - repo = pname; - rev = "v${version}"; - hash = "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs="; - }; + src = fetchFromGitHub { + owner = "olirice"; + repo = pname; + rev = "v${version}"; + inherit hash; + }; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + create_sql_files() { + echo "Creating SQL files for previous versions..." + if [[ "${version}" == "${latestVersion}" ]]; then + cp *.sql $out/share/postgresql/extension + fi + } + + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + fi + } - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + create_sql_files + create_control_files + ''; - cp *.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension - ''; + meta = with lib; { + description = "Recommend indexes to improve query performance in PostgreSQL"; + homepage = "https://github.com/olirice/index_advisor"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + }; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); +in +pkgs.buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; - meta = with lib; { - description = "Recommend indexes to improve query performance in PostgreSQL"; - homepage = "https://github.com/olirice/index_advisor"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/index_advisor.nix b/nix/ext/tests/index_advisor.nix new file mode 100644 index 000000000..9f4b22024 --- /dev/null +++ b/nix/ext/tests/index_advisor.nix @@ -0,0 +1,147 @@ +{ self, pkgs }: +let + pname = "index_advisor"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + self.packages.${pkgs.system}."psql_${majorVersion}/exts/hypopg" # dependency + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(pg_version): + with subtest("Check ${pname} upgrade path"): + firstVersion = versions[pg_version][0] + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") + run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" + for version in versions[pg_version][1:]: + run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path("15") + + with subtest("Check ${pname} latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["15"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + with subtest("switch to postgresql 17"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + check_upgrade_path("17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index e5c4e90b1..c77b23be6 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -10,5 +10,15 @@ "pgrx": "0.14.3", "rust": "1.87.0" } + }, + "index_advisor": { + "0.2.0": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" + } } } From f75ac46ceba1f62160f6a5d321966a83bbed1f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20K=C4=B1l=C4=B1=C3=A7?= Date: Wed, 6 Aug 2025 11:36:01 +0200 Subject: [PATCH 055/134] feat: bump auth to v2.178.0 (#1733) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 4e75577e6..949a76cab 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.013-orioledb" - postgres17: "17.4.1.070" - postgres15: "15.8.1.127" + postgresorioledb-17: "17.5.1.014-orioledb" + postgres17: "17.4.1.071" + postgres15: "15.8.1.128" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -24,8 +24,8 @@ postgrest_release: "13.0.4" postgrest_arm_release_checksum: sha256:2b400200fb15eb5849267e4375fbbc516dd727afadd8786815b48074ed8c03e1 postgrest_x86_release_checksum: sha256:a0052c8d4726f52349e0298f98da51140ef4941855548590ee88331afa617811 -gotrue_release: 2.177.0 -gotrue_release_checksum: sha1:664a26237618c4bfb1e33e4f03a540c3cef3e3c8 +gotrue_release: 2.178.0 +gotrue_release_checksum: sha1:56c5cf913eebf701ab5805e529375483933a0476 aws_cli_release: "2.23.11" From da69a372a3fee5873eb0333662df072a3e2a7918 Mon Sep 17 00:00:00 2001 From: samrose Date: Thu, 7 Aug 2025 11:55:41 -0400 Subject: [PATCH 056/134] feat: source specific version of packer and build with specific go (#1735) * feat: source specific version of packer and build with specific go use in all workflows * fix: add package to checks to assure it is tested, built cached prior to use * fix: try to use nix shell to settle permission issue * fix: install packer with nix in profile within workflow * fix: use sudo on packer calls * fix: trying skip regiona validation for now * fix: use cachix installer with cache config * fix: try to fix perms and use non-sudo * fix: assure nix version we need is installed at this stage + perm fix * fix: see how nix was installed on this machine originally * fix: for now keep nix and inherit env * fix: use large-linux-arm here going forward * fix: try remove job level perms * fix: match permissions on ami-release * tests: debug role * fix: allows workflow to recv secret when called from other workflows * fix: receive the secret as a parameter * fix: no need for sudo * chore: revert qemu workflow/do not change packer handling there * docs: updating deps doc * chore: tmp suffix to test release * chore: restore versions post testing --- .github/workflows/ami-release-nix-single.yml | 16 +++-- .github/workflows/ami-release-nix.yml | 25 +++++-- .github/workflows/nix-build.yml | 2 + .github/workflows/testinfra-ami-build.yml | 56 ++++++++++++---- flake.lock | 17 +++++ flake.nix | 1 + nix/checks.nix | 1 + nix/devShells.nix | 4 +- nix/docs/updating-dependencies.md | 68 ++++++++++++++++++++ nix/packages/default.nix | 3 +- nix/packages/packer.nix | 50 ++++++++++++++ 11 files changed, 216 insertions(+), 27 deletions(-) create mode 100644 nix/docs/updating-dependencies.md create mode 100644 nix/packages/packer.nix diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 500bf26d5..dd579df30 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -40,7 +40,13 @@ jobs: run: | echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - uses: DeterminateSystems/nix-installer-action@main + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ github.event.inputs.postgres_version }}" >> $GITHUB_ENV @@ -57,18 +63,18 @@ jobs: env: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | - packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{ steps.get_sha.outputs.sha }} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 env: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | - packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{ steps.get_sha.outputs.sha }} + nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} - packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl - name: Grab release version id: process_release_version diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 0c97d8374..df0bf096e 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -24,7 +24,13 @@ jobs: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - uses: DeterminateSystems/nix-installer-action@main + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions @@ -52,7 +58,14 @@ jobs: aws-region: "us-east-1" output-credentials: true role-duration-seconds: 7200 - - uses: DeterminateSystems/nix-installer-action@main + + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} @@ -78,19 +91,19 @@ jobs: env: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | - packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} + nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl # why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined? - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 env: POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }} run: | - packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} + nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} - packer build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl - name: Grab release version id: process_release_version diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 362d3ff5e..058d9087b 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -118,6 +118,8 @@ jobs: needs: build-run-image if: ${{ success() }} uses: ./.github/workflows/testinfra-ami-build.yml + secrets: + DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }} run-tests: needs: build-run-image diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 5636a34c3..892b54b74 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -3,9 +3,13 @@ name: Testinfra Integration Tests Nix on: workflow_dispatch: workflow_call: + secrets: + DEV_AWS_ROLE: + description: 'AWS role for dev environment' + required: true permissions: - contents: read + contents: write id-token: write jobs: @@ -17,7 +21,13 @@ jobs: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - uses: DeterminateSystems/nix-installer-action@main + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions @@ -32,22 +42,44 @@ jobs: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: arm-runner + - runner: large-linux-arm arch: arm64 ubuntu_release: noble ubuntu_version: 24.04 mcpu: neoverse-n1 runs-on: ${{ matrix.runner }} timeout-minutes: 150 - permissions: - contents: write - packages: write - id-token: write steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD + - name: Debug AWS role secret + run: | + echo "Checking DEV_AWS_ROLE secret availability..." + if [ -z "${{ secrets.DEV_AWS_ROLE }}" ]; then + echo "❌ DEV_AWS_ROLE is empty or not available" + else + echo "✅ DEV_AWS_ROLE is available" + fi + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.DEV_AWS_ROLE }} + aws-region: "us-east-1" + output-credentials: true + role-duration-seconds: 7200 + + - name: Install nix + uses: cachix/install-nix-action@v27 + with: + install_url: https://releases.nixos.org/nix/nix-2.29.1/install + extra_nix_config: | + substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + + - id: args uses: mikefarah/yq@master with: @@ -68,7 +100,7 @@ jobs: - name: Generate common-nix.vars.pkr.hcl run: | - PG_VERSION=$(sudo nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) + PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml) PG_VERSION=$(echo "$PG_VERSION" | tr -d '"') # Remove any surrounding quotes echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl # Ensure there's a newline at the end of the file @@ -76,15 +108,15 @@ jobs: - name: Build AMI stage 1 run: | - packer init amazon-arm64-nix.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 run: | - packer init stage2-nix-psql.pkr.hcl GIT_SHA=${{github.sha}} - packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl - name: Run tests timeout-minutes: 10 diff --git a/flake.lock b/flake.lock index 8b6d868bf..9d2865e1d 100644 --- a/flake.lock +++ b/flake.lock @@ -208,6 +208,22 @@ "type": "github" } }, + "nixpkgs-go124": { + "locked": { + "lastModified": 1754085309, + "narHash": "sha256-3RTSdhnqTcxS5wjKNEBpbt0hiSKfBZiQPlWHn90N1qQ=", + "owner": "Nixos", + "repo": "nixpkgs", + "rev": "d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0", + "type": "github" + }, + "original": { + "owner": "Nixos", + "repo": "nixpkgs", + "rev": "d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1750555020, @@ -295,6 +311,7 @@ "nix-fast-build": "nix-fast-build", "nix2container": "nix2container", "nixpkgs": "nixpkgs_4", + "nixpkgs-go124": "nixpkgs-go124", "rust-overlay": "rust-overlay", "treefmt-nix": "treefmt-nix_2" } diff --git a/flake.nix b/flake.nix index 3aa651b09..db14dac9a 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,7 @@ treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; git-hooks.url = "github:cachix/git-hooks.nix"; git-hooks.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-go124.url = "github:Nixos/nixpkgs/d2ac4dfa61fba987a84a0a81555da57ae0b9a2b0"; }; outputs = diff --git a/nix/checks.nix b/nix/checks.nix index 13be10f23..2dc51797a 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -294,6 +294,7 @@ wal-g-2 wal-g-3 dbmate-tool + packer pg_regress ; } diff --git a/nix/devShells.nix b/nix/devShells.nix index 7ff4d0720..03768a770 100644 --- a/nix/devShells.nix +++ b/nix/devShells.nix @@ -45,9 +45,7 @@ shellcheck ansible ansible-lint - (packer.overrideAttrs (_oldAttrs: { - version = "1.7.8"; - })) + self'.packages.packer self'.packages.start-server self'.packages.start-client diff --git a/nix/docs/updating-dependencies.md b/nix/docs/updating-dependencies.md new file mode 100644 index 000000000..73c5cf79a --- /dev/null +++ b/nix/docs/updating-dependencies.md @@ -0,0 +1,68 @@ +# Updating Dependencies + +This document explains how to update various dependencies used in the nix configuration. + +## Updating Packer + +Packer is used for creating machine images and is defined in `nix/packages/packer.nix`. + +### Steps to update Packer version: + +1. Create a branch off of `develop` +2. Navigate to `nix/packages/packer.nix` +3. Update the version field: + ```nix + version = "1.15.0"; # Update to desired version + ``` +4. Update the git revision to match the new version: + ```nix + rev = "v${version}"; + ``` +5. Temporarily clear the hash to get the new SHA256: + ```nix + hash = ""; # Clear this temporarily + ``` +6. Save the file and run: + ```bash + nix build .#packer + ``` +7. Nix will fail and output the correct SHA256 hash. Copy this hash and update the file: + ```nix + hash = "sha256-NEWHASHHEREFROMBUILDOUTPUT"; + ``` +8. Update the vendorHash if needed. If the build fails due to vendor hash mismatch, temporarily set: + ```nix + vendorHash = ""; # Clear this temporarily + ``` +9. Run `nix build .#packer` again to get the correct vendorHash, then update: + ```nix + vendorHash = "sha256-NEWVENDORHASHHEREFROMBUILDOUTPUT"; + ``` +10. Verify the build works: + ```bash + nix build .#packer + ``` +11. Test the packer binary: + ```bash + ./result/bin/packer version + ``` +12. Run the full test suite to ensure nothing is broken: + ```bash + nix flake check -L + ``` +13. Commit your changes and create a PR for review +14. Update any CI/CD workflows or documentation that reference the old Packer version + +### Notes: +- Always check the [Packer changelog](https://github.com/hashicorp/packer/releases) for breaking changes +- Packer uses Go, so ensure compatibility with the Go version specified in the flake inputs +- The current Go version is specified in `flake.nix` under `nixpkgs-go124` input +- If updating to a major version, test all packer templates (`.pkr.hcl` files) in the repository + +## Updating Other Dependencies + +Similar patterns can be followed for other dependencies defined in the nix packages. Always: +1. Check for breaking changes in changelogs +2. Update version numbers and hashes +3. Run local tests +4. Verify functionality before creating PR \ No newline at end of file diff --git a/nix/packages/default.nix b/nix/packages/default.nix index cd6d6a1d0..342763961 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,4 +1,4 @@ -{ self, ... }: +{ self, inputs, ... }: { imports = [ ./postgres.nix ]; perSystem = @@ -37,6 +37,7 @@ supabase-groonga = pkgs.callPackage ./groonga { }; local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { }; migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; }; + packer = pkgs.callPackage ./packer.nix { inherit inputs; }; pg-restore = pkgs.callPackage ./pg-restore.nix { psql_15 = self'.packages."psql_15/bin"; }; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; pg_regress = makePgRegress activeVersion; diff --git a/nix/packages/packer.nix b/nix/packages/packer.nix new file mode 100644 index 000000000..7f0063c30 --- /dev/null +++ b/nix/packages/packer.nix @@ -0,0 +1,50 @@ +{ + pkgs, + inputs, + lib, + fetchFromGitHub, + installShellFiles, + ... +}: +let + go124 = inputs.nixpkgs-go124.legacyPackages.${pkgs.system}.go_1_24; + buildGoModule = pkgs.buildGoModule.override { go = go124; }; +in +buildGoModule rec { + pname = "packer"; + version = "1.14.1"; + + src = fetchFromGitHub { + owner = "hashicorp"; + repo = "packer"; + rev = "v${version}"; + hash = "sha256-3g9hsmrfLzGhjcGvUza/L9PMGUFw+KLbg2pIK0CxlQI="; + }; + + vendorHash = "sha256-F6hn+pXPyPe70UTK8EF24lk7ArYz7ygUyVVsatW6+hI="; + + subPackages = [ "." ]; + + ldflags = [ + "-s" + "-w" + ]; + + nativeBuildInputs = [ installShellFiles ]; + + buildInputs = lib.optionals pkgs.stdenv.isDarwin [ + pkgs.darwin.apple_sdk.frameworks.IOKit + pkgs.darwin.apple_sdk.frameworks.Security + ]; + + postInstall = '' + installShellCompletion --zsh contrib/zsh-completion/_packer + ''; + + meta = { + description = "Tool for creating identical machine images for multiple platforms from a single source configuration"; + homepage = "https://www.packer.io/"; + license = lib.licenses.bsl11; + changelog = "https://github.com/hashicorp/packer/blob/v$%7Bversion%7D/CHANGELOG.md"; + }; +} From ad35eac99f77ccc33b5f5e5af9ae51b005fad07a Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 7 Aug 2025 10:36:30 +0800 Subject: [PATCH 057/134] ci: add failure notifications for v3 build --- .github/workflows/qemu-image-build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index ffd12683c..1ba97b86c 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -144,6 +144,16 @@ jobs: docker tag "postgres:$IMAGE_TAG" "$REGISTRY/$REPOSITORY:$IMAGE_TAG" docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG" + - name: Slack Notification on Failure + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }} + SLACK_USERNAME: 'gha-failures-notifier' + SLACK_COLOR: 'danger' + SLACK_MESSAGE: 'Building Postgres QEMU artifact failed' + SLACK_FOOTER: '' +b - name: Cleanup resources after build if: ${{ always() }} run: | From cf8739082d1cb35c61d3309e94366573bb5625da Mon Sep 17 00:00:00 2001 From: Div Arora Date: Thu, 7 Aug 2025 10:35:09 +0800 Subject: [PATCH 058/134] ci: remove nix dependency for simple tools yq and jq are now bundled on the runner image --- .github/workflows/qemu-image-build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index 1ba97b86c..fad63a510 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -26,12 +26,10 @@ jobs: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD - - uses: DeterminateSystems/nix-installer-action@main - - name: Set PostgreSQL versions - only builds pg17 atm id: set-versions run: | - VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[1]' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]') + VERSIONS=$(yq '.postgres_major[1]' ansible/vars.yml | jq -R -s -c 'split("\n")[:-1]') echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT build: @@ -55,7 +53,7 @@ jobs: - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} run: | - SUFFIX=$(sudo nix run nixpkgs#yq -- ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') + SUFFIX=$(yq ".postgres_release[\"postgres${{ matrix.postgres_version }}\"]" ansible/vars.yml | sed -E 's/[0-9\.]+(.*)$/\1/') if [[ -z $SUFFIX ]] ; then echo "Version must include non-numeric characters if built manually." exit 1 @@ -153,7 +151,7 @@ jobs: SLACK_COLOR: 'danger' SLACK_MESSAGE: 'Building Postgres QEMU artifact failed' SLACK_FOOTER: '' -b + - name: Cleanup resources after build if: ${{ always() }} run: | From 2262ddeac385212c5d0257724f67d976336dd5e7 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Fri, 8 Aug 2025 10:42:02 +0100 Subject: [PATCH 059/134] fix: accurately determine disk mount for upgrade disk xvdp (#1740) * chore: install amazon-ec2-utils for ebs nvme mapping tool * fix: accurately determine disk mount for upgrade disk xvdp --- .../pg_upgrade_scripts/initiate.sh | 24 ++++++++++++++++--- ansible/tasks/setup-supabase-internal.yml | 6 +++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index e5c4ddbf7..9f78a8d5e 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -348,10 +348,28 @@ function initiate_upgrade { locale-gen if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then - # awk NF==3 prints lines with exactly 3 fields, which are the block devices currently not mounted anywhere - # excluding nvme0 since it is the root disk + # DATABASE_UPGRADE_DATA_MIGRATION_DEVICE_NAME = '/dev/xvdp' can be derived from the worker mount echo "5. Determining block device to mount" - BLOCK_DEVICE=$(lsblk -dprno name,size,mountpoint,type | grep "disk" | grep -v "nvme0" | awk 'NF==3 { print $1; }') + if command -v ebsnvme-id >/dev/null 2>&1 && dpkg -l | grep -q amazon-ec2-utils; then + for nvme_dev in $(lsblk -dprno name,size,mountpoint,type | grep disk | awk '{print $1}'); do + if [ -b "$nvme_dev" ]; then + mapping=$(ebsnvme-id -b "$nvme_dev" 2>/dev/null) + if [[ "$mapping" == "xvdp" || $mapping == "/dev/xvdp" ]]; then + BLOCK_DEVICE="$nvme_dev" + break + fi + fi + done + fi + + # Fallback to lsblk if ebsnvme-id is not available or no mapping found, pre ubuntu 20.04 + if [ -z "$BLOCK_DEVICE" ]; then + echo "No block device found using ebsnvme-id, falling back to lsblk" + # awk NF==3 prints lines with exactly 3 fields, which are the block devices currently not mounted anywhere + # excluding nvme0 since it is the root disk + BLOCK_DEVICE=$(lsblk -dprno name,size,mountpoint,type | grep "disk" | grep -v "nvme0" | awk 'NF==3 { print $1; exit }') # exit ensures we grab the first only + fi + echo "Block device found: $BLOCK_DEVICE" mkdir -p "$MOUNT_POINT" diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index d5583b597..d63f3abad 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -29,6 +29,12 @@ shell: "/tmp/aws/install --update" become: true +- name: install utilities to manage Amazon EC2 instance storage + become: true + apt: + pkg: + - amazon-ec2-utils + - name: AWS CLI - configure ipv6 support for s3 shell: | aws configure set default.s3.use_dualstack_endpoint true From a3d559fd7e264460120e6941a8a2c6e2c99b4dc9 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Fri, 8 Aug 2025 11:03:08 +0100 Subject: [PATCH 060/134] chore: version bump amis for release (#1741) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 949a76cab..0edea89b3 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.014-orioledb" - postgres17: "17.4.1.071" - postgres15: "15.8.1.128" + postgresorioledb-17: "17.5.1.015-orioledb" + postgres17: "17.4.1.072" + postgres15: "15.8.1.129" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 4433e215f0e011ec08a70c234c819d47d0064014 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Mon, 11 Aug 2025 20:06:59 +0100 Subject: [PATCH 061/134] fix: Ubuntu 24.04 mounts disks when available, can change mountpoints" (#1747) * fix: pipefail handling for missing variables * fix: detect disks for ubuntu 24.04 inconsistencies * fix: use findmnt to more robustly discover mount point * custom ami version for testing * fix: bump versions --- ansible/files/admin_api_scripts/grow_fs.sh | 58 +++++++++++++------ .../pg_upgrade_scripts/initiate.sh | 2 +- ansible/vars.yml | 6 +- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/ansible/files/admin_api_scripts/grow_fs.sh b/ansible/files/admin_api_scripts/grow_fs.sh index c8c14890f..6d9fc8a16 100644 --- a/ansible/files/admin_api_scripts/grow_fs.sh +++ b/ansible/files/admin_api_scripts/grow_fs.sh @@ -4,37 +4,61 @@ set -euo pipefail VOLUME_TYPE=${1:-data} +# lsb release +UBUNTU_VERSION=$(lsb_release -rs) + if pgrep resizefs; then echo "resize2fs is already running" exit 1 fi -# Parses the output of lsblk to get the root partition number -# Example output: -# NAME MOUNTPOINT -# nvme0n1 -# ├─nvme0n1p1 /boot -# └─nvme0n1p3 / -# nvme1n1 /data -# -# Resulting in: -# └─nvme0n1p3 / -> nvme0n1p3 -> 3 -ROOT_PARTITION_NUMBER=$(lsblk -no NAME,MOUNTPOINT | grep ' /$' | awk '{print $1;}' | sed 's/.*nvme[0-9]n[0-9]p//g') +# install amazon disk utilities if not present on 24.04 +if [ "${UBUNTU_VERSION}" = "24.04" ] && ! dpkg -l | grep -q amazon-ec2-utils; then + apt-get update + apt-get install -y amazon-ec2-utils || true +fi + +# We currently mount 3 possible disks +# - /dev/xvda (root disk) +# - /dev/xvdh (data disk) +# - /dev/xvdp (upgrade data disk), not used here +# Initialize variables at 20.04 levels +XVDA_DEVICE="/dev/nvme0n1" +XVDH_DEVICE="/dev/nvme1n1" +# Map AWS devices to NVMe for ubuntu 24.04 and later +if [ "${UBUNTU_VERSION}" = "24.04" ] && dpkg -l | grep -q amazon-ec2-utils; then + for nvme_dev in $(lsblk -dprno name,type | grep disk | awk '{print $1}'); do + if [ -b "$nvme_dev" ]; then + mapping=$(ebsnvme-id -b "$nvme_dev" 2>/dev/null) + case "$mapping" in + "xvda"|"/dev/xvda") XVDA_DEVICE="$nvme_dev" ;; + "xvdh"|"/dev/xvdh") XVDH_DEVICE="$nvme_dev" ;; + esac + fi + done +fi + +echo "Using devices - Root: $XVDA_DEVICE, Data: $XVDH_DEVICE" + +# Get root partition using findmnt +ROOT_DEVICE_FULL=$(findmnt -no SOURCE /) +ROOT_DEVICE=$(lsblk -no PKNAME "$ROOT_DEVICE_FULL") +ROOT_PARTITION_NUMBER=$(echo "$ROOT_DEVICE_FULL" | sed "s|.*${ROOT_DEVICE}p||") if ! [[ "$ROOT_PARTITION_NUMBER" =~ ^[0-9]+$ ]]; then echo "Error: ROOT_PARTITION_NUMBER is not a valid number: $ROOT_PARTITION_NUMBER" exit 1 fi -if [ -b /dev/nvme1n1 ] ; then +if [ -b "${XVDH_DEVICE}" ] ; then if [[ "${VOLUME_TYPE}" == "data" ]]; then - resize2fs /dev/nvme1n1 + resize2fs "${XVDH_DEVICE}" elif [[ "${VOLUME_TYPE}" == "root" ]] ; then PLACEHOLDER_FL=/home/ubuntu/50M_PLACEHOLDER rm -f "${PLACEHOLDER_FL}" || true - growpart /dev/nvme0n1 "${ROOT_PARTITION_NUMBER}" - resize2fs "/dev/nvme0n1p${ROOT_PARTITION_NUMBER}" + growpart "${XVDA_DEVICE}" "${ROOT_PARTITION_NUMBER}" + resize2fs "${XVDA_DEVICE}p${ROOT_PARTITION_NUMBER}" if [[ ! -f "${PLACEHOLDER_FL}" ]] ; then fallocate -l50M "${PLACEHOLDER_FL}" fi @@ -43,7 +67,7 @@ if [ -b /dev/nvme1n1 ] ; then exit 1 fi else - growpart /dev/nvme0n1 "${ROOT_PARTITION_NUMBER}" - resize2fs "/dev/nvme0n1p${ROOT_PARTITION_NUMBER}" + growpart "${XVDA_DEVICE}" "${ROOT_PARTITION_NUMBER}" + resize2fs "${XVDA_DEVICE}p${ROOT_PARTITION_NUMBER}" fi echo "Done resizing disk" diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 9f78a8d5e..9017f6169 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -363,7 +363,7 @@ function initiate_upgrade { fi # Fallback to lsblk if ebsnvme-id is not available or no mapping found, pre ubuntu 20.04 - if [ -z "$BLOCK_DEVICE" ]; then + if [ -z "${BLOCK_DEVICE:-}" ]; then echo "No block device found using ebsnvme-id, falling back to lsblk" # awk NF==3 prints lines with exactly 3 fields, which are the block devices currently not mounted anywhere # excluding nvme0 since it is the root disk diff --git a/ansible/vars.yml b/ansible/vars.yml index 0edea89b3..99de42a6b 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.015-orioledb" - postgres17: "17.4.1.072" - postgres15: "15.8.1.129" + postgresorioledb-17: "17.5.1.016-orioledb" + postgres17: "17.4.1.073" + postgres15: "15.8.1.130" # Non Postgres Extensions pgbouncer_release: "1.19.0" From ae728fa9443d72c6e97034d0b4dc48b79f42ac6d Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Tue, 12 Aug 2025 15:01:41 +0530 Subject: [PATCH 062/134] feat: add supabase_etl_admin user --- ansible/files/postgresql_config/supautils.conf.j2 | 4 ++-- ansible/vars.yml | 6 +++--- .../db/init-scripts/00000000000000-initial-schema.sql | 5 +++++ nix/tests/expected/roles.out | 6 ++++-- nix/tests/expected/z_15_roles.out | 3 ++- nix/tests/expected/z_17_roles.out | 6 ++++-- nix/tools/postgresql_schema.sql | 1 + testinfra/test_ami_nix.py | 1 + 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index f8c4aa0a2..a3456f699 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -11,5 +11,5 @@ supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-cust supautils.privileged_extensions_superuser = 'supabase_admin' supautils.privileged_role = 'postgres' supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_io_timing, wal_compression' -supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, authenticator' -supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' +supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, authenticator' +supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*' diff --git a/ansible/vars.yml b/ansible/vars.yml index 99de42a6b..cd7ea6a28 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.016-orioledb" - postgres17: "17.4.1.073" - postgres15: "15.8.1.130" + postgresorioledb-17: "17.5.1.017-orioledb" + postgres17: "17.4.1.074" + postgres15: "15.8.1.131" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/db/init-scripts/00000000000000-initial-schema.sql b/migrations/db/init-scripts/00000000000000-initial-schema.sql index 272c989c0..2406a7485 100644 --- a/migrations/db/init-scripts/00000000000000-initial-schema.sql +++ b/migrations/db/init-scripts/00000000000000-initial-schema.sql @@ -10,6 +10,11 @@ alter user supabase_admin with superuser createdb createrole replication bypass -- Supabase replication user create user supabase_replication_admin with login replication; +-- Supabase etl user +create user supabase_etl_admin with login replication; +grant pg_read_all_data to supabase_etl_admin; +grant create on database postgres to supabase_etl_admin; + -- Supabase read-only user create role supabase_read_only_user with login bypassrls; grant pg_read_all_data to supabase_read_only_user; diff --git a/nix/tests/expected/roles.out b/nix/tests/expected/roles.out index 69446110c..9c5a47a71 100644 --- a/nix/tests/expected/roles.out +++ b/nix/tests/expected/roles.out @@ -46,11 +46,12 @@ order by rolname; service_role | f | f | f | t | f | f | -1 | t | supabase_admin | t | t | t | t | t | t | -1 | t | supabase_auth_admin | t | t | f | f | f | f | -1 | f | + supabase_etl_admin | f | t | f | t | f | t | -1 | f | supabase_functions_admin | t | t | f | f | f | f | -1 | f | supabase_read_only_user | f | t | f | t | f | f | -1 | t | supabase_replication_admin | f | t | f | t | f | t | -1 | f | supabase_storage_admin | t | t | f | f | f | f | -1 | f | -(29 rows) +(30 rows) select rolname, @@ -85,11 +86,12 @@ order by rolname; service_role | supabase_admin | {"search_path=\"$user\", public, auth, extensions",log_statement=none} supabase_auth_admin | {search_path=auth,idle_in_transaction_session_timeout=60000,log_statement=none} + supabase_etl_admin | supabase_functions_admin | supabase_read_only_user | {default_transaction_read_only=on} supabase_replication_admin | supabase_storage_admin | {search_path=storage,log_statement=none} -(29 rows) +(30 rows) -- Check all privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for diff --git a/nix/tests/expected/z_15_roles.out b/nix/tests/expected/z_15_roles.out index 42c2314e8..796b298bb 100644 --- a/nix/tests/expected/z_15_roles.out +++ b/nix/tests/expected/z_15_roles.out @@ -29,7 +29,8 @@ order by postgres | pg_signal_backend | f postgres | pgtle_admin | f postgres | service_role | f + supabase_etl_admin | pg_read_all_data | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(18 rows) +(19 rows) diff --git a/nix/tests/expected/z_17_roles.out b/nix/tests/expected/z_17_roles.out index 40ce6007d..ecda2ffde 100644 --- a/nix/tests/expected/z_17_roles.out +++ b/nix/tests/expected/z_17_roles.out @@ -66,9 +66,10 @@ order by postgres | pg_signal_backend | t postgres | pgtle_admin | f postgres | service_role | t + supabase_etl_admin | pg_read_all_data | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(20 rows) +(21 rows) -- Check version-specific privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for @@ -157,7 +158,8 @@ order by postgres | pg_signal_backend | t postgres | pgtle_admin | f postgres | service_role | t + supabase_etl_admin | pg_read_all_data | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(19 rows) +(20 rows) diff --git a/nix/tools/postgresql_schema.sql b/nix/tools/postgresql_schema.sql index 4547ab239..7c2ae21a9 100644 --- a/nix/tools/postgresql_schema.sql +++ b/nix/tools/postgresql_schema.sql @@ -7,5 +7,6 @@ ALTER USER pgbouncer WITH PASSWORD 'postgres'; ALTER USER supabase_auth_admin WITH PASSWORD 'postgres'; ALTER USER supabase_storage_admin WITH PASSWORD 'postgres'; ALTER USER supabase_replication_admin WITH PASSWORD 'postgres'; +ALTER USER supabase_etl_admin WITH PASSWORD 'postgres'; ALTER ROLE supabase_read_only_user WITH PASSWORD 'postgres'; ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions; diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index d7b3ecca7..96ce12dab 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -32,6 +32,7 @@ ALTER USER supabase_auth_admin WITH PASSWORD 'postgres'; ALTER USER supabase_storage_admin WITH PASSWORD 'postgres'; ALTER USER supabase_replication_admin WITH PASSWORD 'postgres'; +ALTER USER supabase_etl_admin WITH PASSWORD 'postgres'; ALTER ROLE supabase_read_only_user WITH PASSWORD 'postgres'; ALTER ROLE supabase_admin SET search_path TO "$user",public,auth,extensions; """ From 24430eebc66f4150ecfc45da617df1012fe43419 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 12 Aug 2025 16:28:18 -0400 Subject: [PATCH 063/134] fix: pin entrypoint file download until we can test changes (#1752) --- Dockerfile-15 | 4 ++-- Dockerfile-17 | 4 ++-- Dockerfile-orioledb-17 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index 68e9f4e59..b4561db23 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -190,10 +190,10 @@ COPY migrations/db /docker-entrypoint-initdb.d/ COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql -# # Add upstream entrypoint script +# # Add upstream entrypoint script pinned for now to last tested version COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/15/bullseye/docker-entrypoint.sh \ + https://github.com/docker-library/postgres/raw/889f9447cd2dfe21cccfbe9bb7945e3b037e02d8/15/bullseye/docker-entrypoint.sh \ /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-17 b/Dockerfile-17 index 5ad8ed397..1c7f5e575 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -198,10 +198,10 @@ COPY migrations/db /docker-entrypoint-initdb.d/ COPY ansible/files/pgbouncer_config/pgbouncer_auth_schema.sql /docker-entrypoint-initdb.d/init-scripts/00-schema.sql COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00-extension.sql -# # Add upstream entrypoint script +# # Add upstream entrypoint script pinned for now to last tested version COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ + https://github.com/docker-library/postgres/raw/889f9447cd2dfe21cccfbe9bb7945e3b037e02d8/17/bullseye/docker-entrypoint.sh \ /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 41254e4f7..2a9dfe982 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -203,10 +203,10 @@ COPY ansible/files/stat_extension.sql /docker-entrypoint-initdb.d/migrations/00- RUN echo "CREATE EXTENSION orioledb;" > /docker-entrypoint-initdb.d/init-scripts/00-pre-init.sql && \ chown postgres:postgres /docker-entrypoint-initdb.d/init-scripts/00-pre-init.sql -# # Add upstream entrypoint script +# # Add upstream entrypoint script pinned for now to last tested version COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu ADD --chmod=0755 \ - https://github.com/docker-library/postgres/raw/master/17/bullseye/docker-entrypoint.sh \ + https://github.com/docker-library/postgres/raw/889f9447cd2dfe21cccfbe9bb7945e3b037e02d8/17/bullseye/docker-entrypoint.sh \ /usr/local/bin/docker-entrypoint.sh RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql From defc662f7258025f3a28a12b0c0bee61aa6893bd Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Thu, 14 Aug 2025 10:28:53 +0100 Subject: [PATCH 064/134] fix: ensure amazon-ec2-utils is installed before 24.04 upgrade (#1759) * fix: ensure amazon-ec2-utils is installed before 24.04 upgrade * fix: detect package installed, pipefail friendly * fix: pipefail friendly way to detect package --- ansible/files/admin_api_scripts/grow_fs.sh | 4 ++-- .../admin_api_scripts/pg_upgrade_scripts/initiate.sh | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ansible/files/admin_api_scripts/grow_fs.sh b/ansible/files/admin_api_scripts/grow_fs.sh index 6d9fc8a16..01e4736ed 100644 --- a/ansible/files/admin_api_scripts/grow_fs.sh +++ b/ansible/files/admin_api_scripts/grow_fs.sh @@ -13,7 +13,7 @@ if pgrep resizefs; then fi # install amazon disk utilities if not present on 24.04 -if [ "${UBUNTU_VERSION}" = "24.04" ] && ! dpkg -l | grep -q amazon-ec2-utils; then +if [ "${UBUNTU_VERSION}" = "24.04" ] && ! /usr/bin/dpkg-query -W amazon-ec2-utils >/dev/null 2>&1; then apt-get update apt-get install -y amazon-ec2-utils || true fi @@ -26,7 +26,7 @@ fi XVDA_DEVICE="/dev/nvme0n1" XVDH_DEVICE="/dev/nvme1n1" # Map AWS devices to NVMe for ubuntu 24.04 and later -if [ "${UBUNTU_VERSION}" = "24.04" ] && dpkg -l | grep -q amazon-ec2-utils; then +if [ "${UBUNTU_VERSION}" = "24.04" ] && /usr/bin/dpkg-query -W amazon-ec2-utils >/dev/null 2>&1; then for nvme_dev in $(lsblk -dprno name,type | grep disk | awk '{print $1}'); do if [ -b "$nvme_dev" ]; then mapping=$(ebsnvme-id -b "$nvme_dev" 2>/dev/null) diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 9017f6169..71016a294 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -350,7 +350,14 @@ function initiate_upgrade { if [ -z "$IS_CI" ] && [ -z "$IS_LOCAL_UPGRADE" ]; then # DATABASE_UPGRADE_DATA_MIGRATION_DEVICE_NAME = '/dev/xvdp' can be derived from the worker mount echo "5. Determining block device to mount" - if command -v ebsnvme-id >/dev/null 2>&1 && dpkg -l | grep -q amazon-ec2-utils; then + # lsb release + UBUNTU_VERSION=$(lsb_release -rs) + # install amazon disk utilities if not present on 24.04 + if [ "${UBUNTU_VERSION}" = "24.04" ] && ! /usr/bin/dpkg-query -W amazon-ec2-utils >/dev/null 2>&1; then + apt-get update + apt-get install -y amazon-ec2-utils || true + fi + if command -v ebsnvme-id >/dev/null 2>&1 && /usr/bin/dpkg-query -W amazon-ec2-utils >/dev/null 2>&1; then for nvme_dev in $(lsblk -dprno name,size,mountpoint,type | grep disk | awk '{print $1}'); do if [ -b "$nvme_dev" ]; then mapping=$(ebsnvme-id -b "$nvme_dev" 2>/dev/null) From bed7a3e770d7a5c612e67b895df0f9a527260bd0 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Mon, 18 Aug 2025 14:49:16 +0100 Subject: [PATCH 065/134] fix don't use PrivateTmp for SAA unit (#1763) --- .../supabase-admin-agent_salt.service | 3 --- 1 file changed, 3 deletions(-) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service index f368008b4..969a588e6 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service @@ -14,8 +14,5 @@ StandardError=journal StateDirectory=supabase-admin-agent CacheDirectory=supabase-admin-agent -# Security hardening -PrivateTmp=true - [Install] WantedBy=multi-user.target From 266832a2a00f523b5fa6b58b28d88131b67bceaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 18 Aug 2025 17:12:47 +0200 Subject: [PATCH 066/134] fix(ci): avoid testinfra failure due to loss of ssh connection (#1764) * fix(ci): replace EC2 Instance Connect with cloud-init SSH key injection Tests are often failing due to the SSH access to the instance. EC2 Instance Connect push the temporary SSH key which is then available only for 60 seconds. Recently, errors often occur when the SSH key is sent to the instance, resulting in a timeout. We replace runtime SSH key injection via EC2 Instance Connect API with cloud-init configuration to add the SSH public key during instance initialization. Note that we are still using EC2 Instance Connect to create the SSH key pair, but we are not using it to push the key to the instance. * fix(ci): terminate only the ec2 instance of the matrix job For the moment, the first matrix job that finishes will terminate all the ec2 instances running in the current workflow run. This is not what we want. This change only terminates the instance that is running the matrix job. * fix(ci): init.sh completion check should not be blocking Add optional timeout parameter to run_ssh_command() to check init completion status with a 5-second timeout. --- .github/workflows/ami-release-nix-single.yml | 12 ++++---- .github/workflows/ami-release-nix.yml | 12 ++++---- .github/workflows/qemu-image-build.yml | 8 ++++-- .github/workflows/testinfra-ami-build.yml | 12 ++++---- testinfra/test_ami_nix.py | 29 +++++++++----------- 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index dd579df30..6209c5692 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -49,7 +49,9 @@ jobs: trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL version environment variable - run: echo "POSTGRES_MAJOR_VERSION=${{ github.event.inputs.postgres_version }}" >> $GITHUB_ENV + run: | + echo "POSTGRES_MAJOR_VERSION=${{ github.event.inputs.postgres_version }}" >> $GITHUB_ENV + echo "EXECUTION_ID=${{ github.run_id }}-${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Generate common-nix.vars.pkr.hcl run: | @@ -65,7 +67,7 @@ jobs: run: | GIT_SHA=${{ steps.get_sha.outputs.sha }} nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 env: @@ -74,7 +76,7 @@ jobs: GIT_SHA=${{ steps.get_sha.outputs.sha }} nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl - name: Grab release version id: process_release_version @@ -153,10 +155,10 @@ jobs: - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index df0bf096e..405deeeb4 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -77,7 +77,9 @@ jobs: fi - name: Set PostgreSQL version environment variable - run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + run: | + echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + echo "EXECUTION_ID=${{ github.run_id }}-${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Generate common-nix.vars.pkr.hcl run: | @@ -94,7 +96,7 @@ jobs: GIT_SHA=${{github.sha}} nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl # why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined? - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 env: @@ -103,7 +105,7 @@ jobs: GIT_SHA=${{github.sha}} nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }} - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl - name: Grab release version id: process_release_version @@ -182,9 +184,9 @@ jobs: - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids diff --git a/.github/workflows/qemu-image-build.yml b/.github/workflows/qemu-image-build.yml index fad63a510..1be4caa15 100644 --- a/.github/workflows/qemu-image-build.yml +++ b/.github/workflows/qemu-image-build.yml @@ -65,7 +65,9 @@ jobs: sudo chmod 666 /dev/kvm - name: Set PostgreSQL version environment variable - run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + run: | + echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + echo "EXECUTION_ID=${{ github.run_id }}-${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Generate common-nix.vars.pkr.hcl run: | @@ -155,9 +157,9 @@ jobs: - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --instance-ids diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 892b54b74..a468b6860 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -96,7 +96,9 @@ jobs: run: echo "random_string=$(openssl rand -hex 8)" >> $GITHUB_OUTPUT - name: Set PostgreSQL version environment variable - run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + run: | + echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV + echo "EXECUTION_ID=${{ github.run_id }}-${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Generate common-nix.vars.pkr.hcl run: | @@ -110,13 +112,13 @@ jobs: run: | GIT_SHA=${{github.sha}} nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl - name: Build AMI stage 2 run: | GIT_SHA=${{github.sha}} nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl - nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl + nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl - name: Run tests timeout-minutes: 10 @@ -130,12 +132,12 @@ jobs: - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | - aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids + aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids - name: Cleanup resources after build if: ${{ always() }} run: | - aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids || true + aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${EXECUTION_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -r aws ec2 terminate-instances --region ap-southeast-1 --instance-ids || true - name: Cleanup AMIs if: always() diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 96ce12dab..19219f74a 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -9,12 +9,11 @@ from ec2instanceconnectcli.EC2InstanceConnectLogger import EC2InstanceConnectLogger from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey from time import sleep -import subprocess import paramiko -# if GITHUB_RUN_ID is not set, use a default value that includes the user and hostname +# if EXECUTION_ID is not set, use a default value that includes the user and hostname RUN_ID = os.environ.get( - "GITHUB_RUN_ID", + "EXECUTION_ID", "unknown-ci-run-" + os.environ.get("USER", "unknown-user") + "@" @@ -206,9 +205,9 @@ def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): sleep(5) -def run_ssh_command(ssh, command): +def run_ssh_command(ssh, command, timeout=None): """Run a command over the established SSH connection.""" - stdin, stdout, stderr = ssh.exec_command(command) + stdin, stdout, stderr = ssh.exec_command(command, timeout=timeout) exit_code = stdout.channel.recv_exit_status() return { 'succeeded': exit_code == 0, @@ -233,6 +232,10 @@ def host(): def gzip_then_base64_encode(s: str) -> str: return base64.b64encode(gzip.compress(s.encode())).decode() + # Create temporary SSH key pair + ec2logger = EC2InstanceConnectLogger(debug=False) + temp_key = EC2InstanceConnectKey(ec2logger.get_logger()) + instance = list( ec2.create_instances( BlockDeviceMappings=[ @@ -279,6 +282,10 @@ def gzip_then_base64_encode(s: str) -> str: - 'bash init.sh "staging"' - 'touch /var/lib/init-complete' - 'rm -rf /tmp/*' +users: + - name: ubuntu + ssh_authorized_keys: + - {temp_key.get_pub_key()} """, TagSpecifications=[ { @@ -297,16 +304,6 @@ def gzip_then_base64_encode(s: str) -> str: # Increase wait time before starting health checks sleep(30) # Wait for 30 seconds to allow services to start - ec2logger = EC2InstanceConnectLogger(debug=False) - temp_key = EC2InstanceConnectKey(ec2logger.get_logger()) - ec2ic = boto3.client("ec2-instance-connect", region_name="ap-southeast-1") - response = ec2ic.send_ssh_public_key( - InstanceId=instance.id, - InstanceOSUser="ubuntu", - SSHPublicKey=temp_key.get_pub_key(), - ) - assert response["Success"] - # Wait for instance to have public IP while not instance.public_ip_address: logger.warning("waiting for ip to be available") @@ -333,7 +330,7 @@ def gzip_then_base64_encode(s: str) -> str: attempt = 0 while attempt < max_attempts: try: - result = run_ssh_command(ssh, "test -f /var/lib/init-complete") + result = run_ssh_command(ssh, "test -f /var/lib/init-complete", timeout=5) if result['succeeded']: logger.info("init.sh has completed") break From 80644eabbc5eeec7beacea18b290dd6919b0bb06 Mon Sep 17 00:00:00 2001 From: Bo Lu Date: Fri, 22 Aug 2025 13:21:58 +1000 Subject: [PATCH 067/134] chore: bump Wrappers version to 0.5.4 (#1768) * chore: bump Wrappers version to 0.5.4 * update wappers hash --- Dockerfile-15 | 2 +- Dockerfile-17 | 2 +- Dockerfile-orioledb-17 | 2 +- nix/ext/versions.json | 4 ++-- nix/ext/wrappers/default.nix | 8 ++++++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index b4561db23..f1b0f4558 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -30,7 +30,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.5.0 +ARG wrappers_release=0.5.4 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-17 b/Dockerfile-17 index 1c7f5e575..7db870ad8 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.5.0 +ARG wrappers_release=0.5.4 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 2a9dfe982..0df0b9df0 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -31,7 +31,7 @@ ARG pg_repack_release=1.4.8 ARG vault_release=0.2.8 ARG groonga_release=12.0.8 ARG pgroonga_release=2.4.0 -ARG wrappers_release=0.5.0 +ARG wrappers_release=0.5.4 ARG hypopg_release=1.3.1 ARG pgvector_release=0.4.0 ARG pg_tle_release=1.3.2 diff --git a/nix/ext/versions.json b/nix/ext/versions.json index c77b23be6..33507f1de 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -1,12 +1,12 @@ { "wrappers": { - "0.5.3": { + "0.5.4": { "postgresql": [ "15", "17", "orioledb-17" ], - "hash": "sha256-iaJriPEa0iVLpmnuUk9R3HS545Jhz7aH1clYvHEuEvs=", + "hash": "sha256-W1RokXH4Vfj2FIuEzGEP5SzzWsv2Pbzfa816nXKnSoc=", "pgrx": "0.14.3", "rust": "1.87.0" } diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 9b36bec9c..606eca7e9 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -78,6 +78,11 @@ let "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; } + else if builtins.compareVersions "0.5.4" version == 0 then + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; + } else { "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; @@ -157,6 +162,9 @@ let } ); previouslyPackagedVersions = [ + "0.5.3" + "0.5.2" + "0.5.1" "0.5.0" "0.4.6" "0.4.5" From 88247a3760891345d162eb17be6f3a437570b216 Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Mon, 25 Aug 2025 19:49:00 +0800 Subject: [PATCH 068/134] fix: path to vars.yml for mirror postgrest job (#1771) --- .github/workflows/mirror-postgrest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror-postgrest.yml b/.github/workflows/mirror-postgrest.yml index 0195ab695..d649445b2 100644 --- a/.github/workflows/mirror-postgrest.yml +++ b/.github/workflows/mirror-postgrest.yml @@ -6,7 +6,7 @@ on: - develop paths: - ".github/workflows/mirror-postgrest.yml" - - "common.vars*" + - "ansible/vars.yml" permissions: contents: read From 37e8528f03ea05624997fa24ed05ec5803312623 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 26 Aug 2025 15:15:19 -0400 Subject: [PATCH 069/134] feat: multi version pg_net including 0.19.5 (#1744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: multi version pg_net including 0.19.5 * feat: bump ver and add tests * feat: if file exists, run prestart version switch scripts * tests: bump version to test * fix: rm unneeded check and fix err codes for file handling * chore: bump version for testing * chore: update versions for release * Add pg-net nixos test in flake checks output * Move switch_pg_net_version script into separate package * Fix shellcheck errors * feat: limit using verison in extension creation to admin user for all extensions by using supautils and before-create hooks add test for this in pg_net * feat(pg_net): switch version on file system using overlayfs For pg_net background worker, we need to switch the version of the extension on the file system (both pg_net.so and pg_net.control need to point to the desired version). As the extension is in the Nix store, we cannot simply symlink to the desired version, as the Nix store is read-only. To work around this, we use overlayfs to create a writable layer on top of the pg_net store path. * Revert "feat:" This reverts commit 268cadb9eab2b858a376775a9ae086a7be99fe15. * fix: fmt * chore: bump version for testin * fix: control files need module_pathname * Revert "fix: control files need module_pathname" This reverts commit 4996d81a8596ffbb903a8eceb2b1c8d0e153bc7c. This change would not resolve the issue it was targeting. * chore: version bump for testing * fix: limit flag to versions less than 0.19.1 * chore: bump version for release --------- Co-authored-by: Jean-François Roche --- .gitignore | 3 +- ansible/files/postgres_prestart.sh.j2 | 90 ++++++- ansible/vars.yml | 6 +- nix/checks.nix | 4 + nix/ext/pg_net.nix | 233 ++++++++++++++++-- nix/ext/tests/pg_net.nix | 175 +++++++++++++ nix/ext/versions.json | 72 ++++++ nix/tests/expected/z_15_ext_interface.out | 6 +- nix/tests/expected/z_17_ext_interface.out | 6 +- .../expected/z_orioledb-17_ext_interface.out | 6 +- 10 files changed, 565 insertions(+), 36 deletions(-) create mode 100644 nix/ext/tests/pg_net.nix diff --git a/.gitignore b/.gitignore index 5372bfdeb..1e8b1d680 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ result* .history .envrc .direnv - +.nixos-test-history #IDE .idea/ @@ -30,3 +30,4 @@ common-nix.vars.pkr.hcl # pre-commit config is managed in nix .pre-commit-config.yaml +nixos.qcow2 \ No newline at end of file diff --git a/ansible/files/postgres_prestart.sh.j2 b/ansible/files/postgres_prestart.sh.j2 index 3ffe54c85..cc8ff53c6 100644 --- a/ansible/files/postgres_prestart.sh.j2 +++ b/ansible/files/postgres_prestart.sh.j2 @@ -1,5 +1,11 @@ #!/bin/bash +set -x # Print commands + +log() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" +} + check_orioledb_enabled() { local pg_conf="/etc/postgresql/postgresql.conf" if [ ! -f "$pg_conf" ]; then @@ -26,7 +32,87 @@ update_orioledb_buffers() { fi } +check_extensions_file() { + local extensions_file="/etc/adminapi/pg-extensions.json" + if [ ! -f "$extensions_file" ]; then + log "extensions: No extensions file found, skipping extensions versions check" + return 0 #if file not found, skip + fi + if [ ! -r "$extensions_file" ]; then + log "extensions: Cannot read extensions file" + return 1 #a true error, we should be able to read file + fi + return 0 +} + +switch_extension_version() { + local extension_name="$1" + local version="$2" + + # Use BIN_PATH environment variable or default to /var/lib/postgresql/.nix-profile + : ${BIN_PATH:="/var/lib/postgresql/.nix-profile"} + + local switch_script="$BIN_PATH/bin/switch_${extension_name}_version" + + if [ ! -x "$switch_script" ]; then + log "$extension_name: No version switch script available at $switch_script, skipping" + return 0 + fi + + log "$extension_name: Switching to version $version" + # Run directly as root since we're already running as root + "$switch_script" "$version" + local exit_code=$? + if [ $exit_code -eq 0 ]; then + log "$extension_name: Version switch completed successfully" + else + log "$extension_name: Version switch failed with exit code $exit_code" + fi + return $exit_code +} + +handle_extension_versions() { + if ! check_extensions_file; then + return + fi + + local extensions_file="/etc/adminapi/pg-extensions.json" + + # Get all extension names from the JSON file + local extensions + extensions=$(jq -r 'keys[]' "$extensions_file" 2>/dev/null) + + if [ -z "$extensions" ]; then + log "extensions: No extensions found in configuration" + return + fi + + # Iterate through each extension + while IFS= read -r extension_name; do + # Get the version for this extension + local version + version=$(jq -r --arg ext "$extension_name" '.[$ext] // empty' "$extensions_file") + + if [ -z "$version" ]; then + log "$extension_name: No version specified, skipping" + continue + fi + + log "$extension_name: Found version $version in extensions file" + + # Don't fail if version switch fails - just log and continue + switch_extension_version "$extension_name" "$version" || log "$extension_name: Version switch failed but continuing" + + done <<< "$extensions" +} + main() { + log "Starting prestart script" + + # 1. Handle all extension versions from config file + handle_extension_versions + + # 2. orioledb handling local has_orioledb=$(check_orioledb_enabled) if [ "$has_orioledb" -lt 1 ]; then return 0 @@ -35,6 +121,8 @@ main() { if [ ! -z "$shared_buffers_value" ]; then update_orioledb_buffers "$shared_buffers_value" fi + + log "Prestart script completed" } # Initial locale setup @@ -46,4 +134,4 @@ if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then locale-gen fi -main +main \ No newline at end of file diff --git a/ansible/vars.yml b/ansible/vars.yml index cd7ea6a28..d6757b82c 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.017-orioledb" - postgres17: "17.4.1.074" - postgres15: "15.8.1.131" + postgresorioledb-17: "17.5.1.018-orioledb" + postgres17: "17.4.1.075" + postgres15: "15.8.1.132" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/checks.nix b/nix/checks.nix index 2dc51797a..43a0dd4ab 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -309,6 +309,10 @@ ; } // pkgs.lib.optionalAttrs (system == "x86_64-linux") { + pg_net = import ./ext/tests/pg_net.nix { + inherit self; + inherit pkgs; + }; wrappers = import ./ext/tests/wrappers.nix { inherit self; inherit pkgs; diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 02d673297..3d406f49b 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -1,41 +1,224 @@ { + pkgs, lib, stdenv, fetchFromGitHub, curl, postgresql, + libuv, + writeShellApplication, + makeWrapper, }: -stdenv.mkDerivation rec { - pname = "pg_net"; - version = "0.14.0"; - - buildInputs = [ - curl - postgresql - ]; - - src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-c1pxhTyrE5j6dY+M5eKAboQNofIORS+Dccz+7HKEKQI="; +let + enableOverlayOnPackage = writeShellApplication { + name = "enable_overlay_on_package"; + runtimeInputs = [ pkgs.coreutils ]; + text = '' + # This script enable overlayfs on a specific nix store path + set -euo pipefail + + if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 + fi + + PACKAGE_PATH="$1" + PACKAGE_NAME=$(basename "$1"|cut -c 34-) + + # Nixos compatibility: use systemd mount unit + #shellcheck disable=SC1091 + source /etc/os-release || true + if [[ "$ID" == "nixos" ]]; then + # This script is used in NixOS test only for the moment + SYSTEMD_DIR="/run/systemd/system" + else + SYSTEMD_DIR="/etc/systemd/system" + fi + + # Create required directories for overlay + echo "$PACKAGE_NAME" + mkdir -p "/var/lib/overlay/$PACKAGE_NAME/"{upper,work} + + PACKAGE_MOUNT_PATH=$(systemd-escape -p --suffix=mount "$PACKAGE_PATH") + + cat > "$SYSTEMD_DIR/$PACKAGE_MOUNT_PATH" <" + echo "Example: $0 0.10.0" + echo "" + echo "Optional environment variables:" + echo " NIX_PROFILE - Path to nix profile (default: /var/lib/postgresql/.nix-profile)" + echo " LIB_DIR - Override library directory" + echo " EXTENSION_DIR - Override extension directory" + exit 1 + fi + + VERSION="$1" + echo "$VERSION" + + # Enable overlay on the wrapper package to be able to switch version + ${lib.getExe enableOverlayOnPackage} "$EXT_WRAPPER" + + # Check if version exists + EXT_WRAPPER_LIB="$EXT_WRAPPER/lib" + PG_NET_LIB_TO_USE="$EXT_WRAPPER_LIB/pg_net-$VERSION${postgresql.dlSuffix}" + if [ ! -f "$PG_NET_LIB_TO_USE" ]; then + echo "Error: Version $VERSION not found in $EXT_WRAPPER_LIB" + echo "Available versions:" + #shellcheck disable=SC2012 + ls "$EXT_WRAPPER_LIB"/pg_net-*${postgresql.dlSuffix} 2>/dev/null | sed 's/.*pg_net-/ /' | sed 's/${postgresql.dlSuffix}$//' || echo " No versions found" + exit 1 + fi + + # Update library symlink + ln -sfnv "$PG_NET_LIB_TO_USE" "$EXT_WRAPPER_LIB/pg_net${postgresql.dlSuffix}" + + # Update control file + EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" + echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/pg_net.control" + cat "$EXT_WRAPPER_SHARE/pg_net--$VERSION.control" >> "$EXT_WRAPPER_SHARE/pg_net.control" + + echo "Successfully switched pg_net to version $VERSION" + ''; + }; + pname = "pg_net"; + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + + buildInputs = [ + curl + postgresql + ] ++ lib.optional (version == "0.6") libuv; + + src = fetchFromGitHub { + owner = "supabase"; + repo = pname; + rev = "refs/tags/v${version}"; + inherit hash; + }; + + buildPhase = '' + make PG_CONFIG=${postgresql}/bin/pg_config + ''; + + postPatch = + lib.optionalString (version == "0.6") '' + # handle collision with pg_net 0.10.0 + rm sql/pg_net--0.2--0.3.sql + rm sql/pg_net--0.4--0.5.sql + rm sql/pg_net--0.5.1--0.6.sql + '' + + lib.optionalString (version == "0.7.1") '' + # handle collision with pg_net 0.10.0 + rm sql/pg_net--0.5.1--0.6.sql + ''; + + env.NIX_CFLAGS_COMPILE = lib.optionalString (lib.versionOlder version "0.19.1") "-Wno-error"; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + # Install versioned library + install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + if [ -f sql/${pname}.sql ]; then + cp sql/${pname}.sql $out/share/postgresql/extension/${pname}--${version}.sql + else + cp sql/${pname}--${version}.sql $out/share/postgresql/extension/${pname}--${version}.sql + fi + + # Install upgrade scripts + find . -name '${pname}--*--*.sql' -exec install -Dm644 {} $out/share/postgresql/extension/ \; + + # Create versioned control file with modified module path + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + ''; + + meta = with lib; { + description = "Async networking for Postgres"; + homepage = "https://github.com/supabase/pg_net"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + }; + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).pg_net; + # Filter out versions that don't work on current platform + platformFilteredVersions = lib.filterAttrs ( + name: _: + # Exclude 0.11.0 on macOS due to epoll.h dependency + !(stdenv.isDarwin && name == "0.11.0") + ) allVersions; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) platformFilteredVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); +in +pkgs.buildEnv { + name = pname; + paths = packages; + nativeBuildInputs = [ makeWrapper ]; + postBuild = '' + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} - env.NIX_CFLAGS_COMPILE = "-Wno-error"; - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) - cp *${postgresql.dlSuffix} $out/lib - cp sql/*.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + makeWrapper ${lib.getExe switchPgNetVersion} $out/bin/switch_pg_net_version \ + --prefix EXT_WRAPPER : "$out" ''; - meta = with lib; { - description = "Async networking for Postgres"; - homepage = "https://github.com/supabase/pg_net"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions switchPgNetVersion; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/pg_net.nix b/nix/ext/tests/pg_net.nix new file mode 100644 index 000000000..6ec9b92cf --- /dev/null +++ b/nix/ext/tests/pg_net.nix @@ -0,0 +1,175 @@ +{ self, pkgs }: +let + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/pg_net-all"; + versions = (installedExtension "17").versions; + firstVersion = lib.head versions; + latestVersion = lib.last versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-pg_net"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = "pg_net"; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIo+ulCUfJjnCVgfM4946Ih5Nm8DeZZiayYeABHGPEl7 jfroche" + ]; + + services.postgresql = { + enable = true; + package = psql_15; + settings = { + shared_preload_libraries = "pg_net"; + }; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; + + environment.systemPackages = [ psql_17 ]; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(): + with subtest("Check pg_net upgrade path"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS pg_net;'") + run_sql(r"""CREATE EXTENSION pg_net WITH VERSION \"${firstVersion}\";""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'pg_net';""") + assert installed_version == "${firstVersion}", f"Expected pg_net version ${firstVersion}, but found {installed_version}" + for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: + run_sql(f"""ALTER EXTENSION pg_net UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'pg_net';""") + assert installed_version == version, f"Expected pg_net version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path() + + with subtest("Test switch_pg_net_version"): + # Check that we are using the last version first + pg_net_version = server.succeed("readlink -f ${psql_15}/lib/pg_net.so").strip() + print(f"Current pg_net version: {pg_net_version}") + assert pg_net_version.endswith("pg_net-${latestVersion}.so"), f"Expected pg_net version ${latestVersion}, but found {pg_net_version}" + + server.succeed( + "switch_pg_net_version ${firstVersion}" + ) + + pg_net_version = server.succeed("readlink -f ${psql_15}/lib/pg_net.so").strip() + assert pg_net_version.endswith("pg_net-${firstVersion}.so"), f"Expected pg_net version ${firstVersion}, but found {pg_net_version}" + + server.succeed( + "switch_pg_net_version ${latestVersion}" + ) + + with subtest("Check pg_net latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION pg_net;'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION pg_net;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + assert "pg_net,${latestVersion}" in installed_extensions + + with subtest("switch to multiple node configuration"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check pg_net latest extension version"): + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + assert "pg_net,${latestVersion}" in installed_extensions + + check_upgrade_path() + + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 33507f1de..b42d93b82 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -20,5 +20,77 @@ ], "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" } + }, + "pg_net": { + "0.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-geXGMb9MxU2vVB3ZBkGEwNqHixPbqjywyUumk7kbdbQ=" + }, + "0.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-ArJmZTh7rc6OgvA6RIndMqcDRJl91QPt6pgEeCuHA6M=" + }, + "0.6": { + "postgresql": [ + "15" + ], + "hash": "sha256-SpQbF/ZeAVa8zf0+N6uluHrjpmGy0NLd2/hvyiOyNsY=" + }, + "0.7": { + "postgresql": [ + "15" + ], + "hash": "sha256-FRaTZPCJQPYAFmsJg22hYJJ0+gH1tMdDQoCQgiqEnaA=" + }, + "0.7.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-VScRKzY/skQu9SWGx9iZvifH7pv7SRXcvLfybB+XX4Q=" + }, + "0.8.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-ZPsRPWV1G3lMM2mT+H139Wvgoy8QnmeUbzEnGeDJmZA=" + }, + "0.10.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-R9Mzw5gvV7b2R59LTOzuOc0AI99+3ncFNzijI4mySUg=" + }, + "0.11.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-XN441jXK1q+I/LZRNwvzbSsebXHgZ8iYsslZvcPFlAs=" + }, + "0.13.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-FRaTZPCJQPYAFmsJg22hYJJ0+gH1tMdDQoCQgiqEnaA=" + }, + "0.14.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-c1pxhTyrE5j6dY+M5eKAboQNofIORS+Dccz+7HKEKQI=" + }, + "0.19.5": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" + } } } diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index c652a95eb..d3d9f7c4f 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1161,9 +1161,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -5227,7 +5229,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5057 rows) +(5059 rows) /* diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index d31894bc3..46792e48f 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1146,9 +1146,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4871,7 +4873,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4714 rows) +(4716 rows) /* diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index d31894bc3..46792e48f 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -1146,9 +1146,11 @@ order by pg_net | net | _urlencode_string | string character varying | text pg_net | net | check_worker_is_up | | void pg_net | net | http_collect_response | request_id bigint, async boolean | net.http_response_result - pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | http_delete | url text, params jsonb, headers jsonb, timeout_milliseconds integer, body jsonb | bigint pg_net | net | http_get | url text, params jsonb, headers jsonb, timeout_milliseconds integer | bigint pg_net | net | http_post | url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer | bigint + pg_net | net | wait_until_running | | void + pg_net | net | wake | | void pg_net | net | worker_restart | | boolean pg_prewarm | public | autoprewarm_dump_now | | bigint pg_prewarm | public | autoprewarm_start_worker | | void @@ -4871,7 +4873,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4714 rows) +(4716 rows) /* From 49d62e4c7a1338edc6595ca6c76df8bcf59a17ac Mon Sep 17 00:00:00 2001 From: Sergio Cioban Date: Thu, 28 Aug 2025 22:39:04 +0100 Subject: [PATCH 070/134] feat: using ubuntu minimal for qemu --- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 +- qemu-arm64-nix.pkr.hcl | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index b52b85789..e74617801 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -22,7 +22,7 @@ function waitfor_boot_finished { } function install_packages { - apt-get update && sudo apt-get install software-properties-common e2fsprogs nfs-common -y + apt-get update && sudo apt-get install software-properties-common e2fsprogs nfs-common locales iptables arptables ebtables ufw logrotate -y add-apt-repository --yes --update ppa:ansible/ansible && sudo apt-get install ansible -y ansible-galaxy collection install community.general } diff --git a/qemu-arm64-nix.pkr.hcl b/qemu-arm64-nix.pkr.hcl index 497871774..17cca3a6e 100644 --- a/qemu-arm64-nix.pkr.hcl +++ b/qemu-arm64-nix.pkr.hcl @@ -74,11 +74,8 @@ source "qemu" "cloudimg" { format = "qcow2" headless = true http_directory = "http" - # TODO (darora): switch to minimal images - # iso_checksum = "file:https://cloud-images.ubuntu.com/minimal/releases/noble/release/SHA256SUMS" - # iso_url = "https://cloud-images.ubuntu.com/minimal/releases/noble/release/ubuntu-24.04-minimal-cloudimg-arm64.img" - iso_checksum = "file:https://cloud-images.ubuntu.com/noble/current/SHA256SUMS" - iso_url = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img" + iso_checksum = "file:https://cloud-images.ubuntu.com/minimal/releases/noble/release/SHA256SUMS" + iso_url = "https://cloud-images.ubuntu.com/minimal/releases/noble/release/ubuntu-24.04-minimal-cloudimg-arm64.img" memory = 40000 qemu_img_args { convert = ["-o", "compression_type=zstd"] From e40cd2dff07654f57e8efde9797763b35862d724 Mon Sep 17 00:00:00 2001 From: Sergio Cioban Date: Thu, 28 Aug 2025 23:10:18 +0100 Subject: [PATCH 071/134] chore: adding details on EKS build --- ansible/vars.yml | 6 +++--- qemu_artifact.md | 34 +++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index d6757b82c..f0fed3c1f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.018-orioledb" - postgres17: "17.4.1.075" - postgres15: "15.8.1.132" + postgresorioledb-17: "17.5.1.019-orioledb" + postgres17: "17.4.1.076" + postgres15: "15.8.1.133" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/qemu_artifact.md b/qemu_artifact.md index 847a1c8c2..20a33f5c1 100644 --- a/qemu_artifact.md +++ b/qemu_artifact.md @@ -9,22 +9,28 @@ Given the size of the image, the first VM using it on a node might take a while The current AMI process involves a few steps: 1. nix package is build and published using GHA (`.github/workflows/nix-build.yml`) - - this builds Postgres along with the PG extensions we use. + +- this builds Postgres along with the PG extensions we use. + 2. "stage1" build (`amazon-arm64-nix.pkr.hcl`, invoked via `.github/workflows/ami-release-nix.yml`) - - uses an upstream Ubuntu image to initialize the AMI - - installs and configures the majority of the software that gets shipped as part of the AMI (e.g. gotrue, postgrest, ...) + +- uses an upstream Ubuntu image to initialize the AMI +- installs and configures the majority of the software that gets shipped as part of the AMI (e.g. gotrue, postgrest, ...) + 3. "stage2" build (`stage2-nix-psql.pkr.hcl`, invoked via `.github/workflows/ami-release-nix.yml`) - - uses the image published from (2) - - installs and configures the software that is build and published using nix in (1) - - cleans up build dependencies etc + +- uses the image published from (2) +- installs and configures the software that is build and published using nix in (1) +- cleans up build dependencies etc The QEMU artifact process collapses (2) and (3): a. nix package is build and published using GHA (`.github/workflows/nix-build.yml`) b. packer build (`qemu-arm64-nix.pkr.hcl`) - - uses an upstream Ubuntu live image as the base - - performs the work that was performed as part of the "stage1" and "stage2" builds - - this work is executed using `ebssurrogate/scripts/qemu-bootstrap-nix.sh` + +- uses an upstream Ubuntu live image as the base +- performs the work that was performed as part of the "stage1" and "stage2" builds +- this work is executed using `ebssurrogate/scripts/qemu-bootstrap-nix.sh` While the AMI build uses the EBS Surrogate Packer builder to create a minimal boot environment that it then adds things to, the QEMU build merely adds things to the Ubuntu Cloud Image. As such, it's likely possible to make something more minimal with a bit more work, but this was deemed unnecessary for now. Collapsing Stage1 and Stage2 was done in the interest of iteration speed, as executing them together is much faster than saving an artifact off stage1, booting another VM off it, and then executing stage2. @@ -36,6 +42,16 @@ Following `make init alpine-image`, the generated VM image should be bundled as For faster iteration, it's more convenient to build the image on an ubuntu bare-metal node that's part of the EKS cluster you're using. Build the image in the `k8s.io` namespace in order for it to be available for immediate use on that node. +list of packages installed on the EKS to build images: + +``` + apt-get install -y git emacs ripgrep vim-tiny byobu build-essential + wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list + apt-cache update + apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli packer=1.11.2-1 +``` + ### Dependencies note Installing `docker.io` on an EKS node might interfere with the k8s setup of the node. You can instead install `nerdctl` and `buildkit`: From 3cd4dde42e1bd1b7c4d9252ee61a50531e0c50d5 Mon Sep 17 00:00:00 2001 From: Laurence Isla Date: Sat, 30 Aug 2025 02:08:25 +0000 Subject: [PATCH 072/134] chore: bump PostgREST to v13.0.5 (#1775) --- ansible/vars.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index f0fed3c1f..1901c783f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.019-orioledb" - postgres17: "17.4.1.076" - postgres15: "15.8.1.133" + postgresorioledb-17: "17.5.1.020-orioledb" + postgres17: "17.4.1.077" + postgres15: "15.8.1.134" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -20,9 +20,9 @@ pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e # The checksum can be found under "Assets", in the GitHub release page for each version. # The binaries used are: ubuntu-aarch64 and linux-static. # https://github.com/PostgREST/postgrest/releases -postgrest_release: "13.0.4" -postgrest_arm_release_checksum: sha256:2b400200fb15eb5849267e4375fbbc516dd727afadd8786815b48074ed8c03e1 -postgrest_x86_release_checksum: sha256:a0052c8d4726f52349e0298f98da51140ef4941855548590ee88331afa617811 +postgrest_release: "13.0.5" +postgrest_arm_release_checksum: sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4 +postgrest_x86_release_checksum: sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5 gotrue_release: 2.178.0 gotrue_release_checksum: sha1:56c5cf913eebf701ab5805e529375483933a0476 From f1ff862fa79a8888f2eb9a959bca3091dff8357b Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Tue, 2 Sep 2025 09:00:31 +0200 Subject: [PATCH 073/134] feat: bump auth to v2.179.0 (#1776) --- ansible/vars.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 1901c783f..7000d828a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -24,8 +24,8 @@ postgrest_release: "13.0.5" postgrest_arm_release_checksum: sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4 postgrest_x86_release_checksum: sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5 -gotrue_release: 2.178.0 -gotrue_release_checksum: sha1:56c5cf913eebf701ab5805e529375483933a0476 +gotrue_release: 2.179.0 +gotrue_release_checksum: sha1:e985fce00b2720b747e6a04420910015c4967121 aws_cli_release: "2.23.11" From 829ef410913e695c300fec4019cbc6f778fc2d77 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Tue, 2 Sep 2025 11:23:53 +0200 Subject: [PATCH 074/134] fix: bump postgres versions for auth v2.179.0 (#1779) --- ansible/vars.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 7000d828a..385f29f7d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.020-orioledb" - postgres17: "17.4.1.077" - postgres15: "15.8.1.134" + postgresorioledb-17: "17.5.1.021-orioledb" + postgres17: "17.4.1.078" + postgres15: "15.8.1.135" # Non Postgres Extensions pgbouncer_release: "1.19.0" From 34840bea2c3fcb8ab1a673c7ad097cb10c461443 Mon Sep 17 00:00:00 2001 From: samrose Date: Tue, 2 Sep 2025 19:00:11 -0400 Subject: [PATCH 075/134] feat: update minor versions of pg 17 and 15 (#1766) * feat: update minor versions of pg 17 and 15 due to https://www.postgresql.org/about/news/postgresql-176-1610-1514-1419-1322-and-18-beta-3-released-3118/ * fix: update input hash on each version * fix: update schemas used for testing * fix: new minor version introduces --restrict-key which we will set with arbitrary value ONLY IN TESTING context No one should EVER use the schemas in our repo for restoration of production databases! * chore: bump version for release --- ansible/vars.yml | 6 +++--- migrations/schema-15.sql | 8 ++++++-- migrations/schema-17.sql | 8 ++++++-- nix/config.nix | 8 ++++---- nix/tools/dbmate-tool.sh.in | 17 +++++++++++++++-- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 385f29f7d..6c04ad83d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.021-orioledb" - postgres17: "17.4.1.078" - postgres15: "15.8.1.135" + postgresorioledb-17: "17.5.1.018-orioledb" + postgres17: "17.6.1.000" + postgres15: "15.14.1.000" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/migrations/schema-15.sql b/migrations/schema-15.sql index 00e62c8eb..1f1d98496 100644 --- a/migrations/schema-15.sql +++ b/migrations/schema-15.sql @@ -2,8 +2,10 @@ -- PostgreSQL database dump -- --- Dumped from database version 15.8 --- Dumped by pg_dump version 15.8 +\restrict SupabaseTestDumpKey123 + +-- Dumped from database version 15.14 +-- Dumped by pg_dump version 15.14 SET statement_timeout = 0; SET lock_timeout = 0; @@ -997,3 +999,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- +\unrestrict SupabaseTestDumpKey123 + diff --git a/migrations/schema-17.sql b/migrations/schema-17.sql index f120b1b27..e0b353e9d 100644 --- a/migrations/schema-17.sql +++ b/migrations/schema-17.sql @@ -2,8 +2,10 @@ -- PostgreSQL database dump -- --- Dumped from database version 17.4 --- Dumped by pg_dump version 17.4 +\restrict SupabaseTestDumpKey123 + +-- Dumped from database version 17.6 +-- Dumped by pg_dump version 17.6 SET statement_timeout = 0; SET lock_timeout = 0; @@ -998,3 +1000,5 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop -- PostgreSQL database dump complete -- +\unrestrict SupabaseTestDumpKey123 + diff --git a/nix/config.nix b/nix/config.nix index 267ec18a8..4076f0cea 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -42,12 +42,12 @@ in supportedPostgresVersions = { postgres = { "15" = { - version = "15.8"; - hash = "sha256-RANRX5pp7rPv68mPMLjGlhIr/fiV6Ss7I/W452nty2o="; + version = "15.14"; + hash = "sha256-Bt110wXNOHDuYrOTLmYcYkVD6vmuK6N83sCk+O3QUdI="; }; "17" = { - version = "17.4"; - hash = "sha256-xGBbc/6hGWNAZpn5Sblm5dFzp+4Myu+JON7AyoqZX+c="; + version = "17.6"; + hash = "sha256-4GMKNgCuonURcVVjJZ7CERzV9DU6SwQOC+gn+UzXqLA="; }; }; orioledb = { diff --git a/nix/tools/dbmate-tool.sh.in b/nix/tools/dbmate-tool.sh.in index 8fa266fce..934724c03 100644 --- a/nix/tools/dbmate-tool.sh.in +++ b/nix/tools/dbmate-tool.sh.in @@ -177,7 +177,21 @@ perform_dump() { while [ $attempt -le $max_attempts ]; do echo "Attempting pg_dump (attempt $attempt/$max_attempts)" - if "${PSQLBIN}/pg_dump" -h localhost -p "$PORTNO" -U "$PGSQL_SUPERUSER" -d postgres --schema-only --no-owner --no-privileges > "./db/schema.sql"; then + # Build the dump command + local dump_cmd="${PSQLBIN}/pg_dump -h localhost -p $PORTNO -U $PGSQL_SUPERUSER -d postgres --schema-only --no-owner --no-privileges" + + # Only use --restrict-key for standard PostgreSQL 15 and 17 versions + # OrioleDB doesn't support this flag yet + if [ "$PSQL_VERSION" = "15" ] || [ "$PSQL_VERSION" = "17" ]; then + # Use a fixed restrict key for reproducible test dumps + # This is safe in testing contexts but should not be used in production + dump_cmd="$dump_cmd --restrict-key=SupabaseTestDumpKey123" + echo "Using --restrict-key for reproducible dumps (PostgreSQL $PSQL_VERSION)" + else + echo "Skipping --restrict-key (version: $PSQL_VERSION)" + fi + + if $dump_cmd > "./db/schema.sql"; then return 0 fi @@ -257,7 +271,6 @@ EOSQL echo "CURRENT_SYSTEM: $CURRENT_SYSTEM" if [ -f "./db/schema.sql" ]; then - trim_schema cp "./db/schema.sql" "./migrations/schema-$PSQL_VERSION.sql" echo "Schema file moved to ./migrations/schema-$PSQL_VERSION.sql" echo "PSQLBIN is $PSQLBIN" From 55b011d86cd955bf10d45dad2bea75eaef67c2f3 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Wed, 3 Sep 2025 18:59:46 +0100 Subject: [PATCH 076/134] fix: new admin mgr and admin api for recovery target immediate (#1777) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 6c04ad83d..b508cfc75 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.018-orioledb" - postgres17: "17.6.1.000" - postgres15: "15.14.1.000" + postgresorioledb-17: "17.5.1.022-orioledb" + postgres17: "17.6.1.001" + postgres15: "15.14.1.001" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,8 +52,8 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.84.1 -adminmgr_release: 0.25.1 +adminapi_release: 0.92.0 +adminmgr_release: 0.32.1 supabase_admin_agent_release: 1.4.38 supabase_admin_agent_splay: 30 From 6102e105c679938a8af1081b5362eff34d92c627 Mon Sep 17 00:00:00 2001 From: Crispy <12525875+Crispy1975@users.noreply.github.com> Date: Thu, 4 Sep 2025 13:20:11 +0100 Subject: [PATCH 077/134] fix: bump pg version for new admin mgr and admin api (#1780) --- ansible/vars.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index b508cfc75..96dc3da07 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.022-orioledb" - postgres17: "17.6.1.001" - postgres15: "15.14.1.001" + postgresorioledb-17: "17.5.1.023-orioledb" + postgres17: "17.6.1.002" + postgres15: "15.14.1.002" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -52,7 +52,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.92.0 +adminapi_release: 0.92.1 adminmgr_release: 0.32.1 supabase_admin_agent_release: 1.4.38 supabase_admin_agent_splay: 30 From fae5be1808b69c092f2afc98b313939ee1e923b4 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 5 Sep 2025 09:39:06 -0400 Subject: [PATCH 078/134] Multi version ext/pg cron (#1737)w MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: pg_cron multi-version with new pattern * feat: pg_cron using the new multi-version pattern not yet complete * fix: bring in some function from previous version to test * chore: move pg_cron extension package to its own directory * feat: add nixos test for pg_cron extension * feat: refactor pg_cron to use buildEnv Fix upgrade nixos tests that was broken. Move overlays and switch-ext-version script to package. * feat: refactor pg_net according to previous refactoring * Refactor postgres extensions tests Keep the postgres extension tests DRY by extracting shared logic into a shared library. * chore: format python files using ruff * chore: rebase on develop and bump version for retsting * ore: bump version for deploy --------- Co-authored-by: Jean-François Roche --- ansible/vars.yml | 6 +- nix/checks.nix | 16 +- nix/ext/index_advisor.nix | 4 +- nix/ext/pg_cron.nix | 36 --- nix/ext/pg_cron/default.nix | 122 +++++++++ nix/ext/pg_cron/pg_cron-1.3.1-pg15.patch | 31 +++ nix/ext/pg_net.nix | 112 +-------- nix/ext/tests/default.nix | 190 ++++++++++++++ nix/ext/tests/index_advisor.nix | 147 ----------- nix/ext/tests/lib.py | 169 +++++++++++++ nix/ext/tests/pg_net.nix | 175 ------------- nix/ext/tests/wrappers.nix | 157 ------------ nix/ext/versions.json | 37 ++- nix/fmt.nix | 12 +- nix/overlays/default.nix | 1 + nix/packages/default.nix | 4 + nix/packages/overlayfs-on-package.nix | 49 ++++ nix/packages/postgres.nix | 2 +- nix/packages/switch-ext-version.nix | 64 +++++ testinfra/test_ami_nix.py | 306 ++++++++++++++--------- 20 files changed, 881 insertions(+), 759 deletions(-) delete mode 100644 nix/ext/pg_cron.nix create mode 100644 nix/ext/pg_cron/default.nix create mode 100644 nix/ext/pg_cron/pg_cron-1.3.1-pg15.patch create mode 100644 nix/ext/tests/default.nix delete mode 100644 nix/ext/tests/index_advisor.nix create mode 100644 nix/ext/tests/lib.py delete mode 100644 nix/ext/tests/pg_net.nix delete mode 100644 nix/ext/tests/wrappers.nix create mode 100644 nix/packages/overlayfs-on-package.nix create mode 100644 nix/packages/switch-ext-version.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 96dc3da07..011045f8a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.023-orioledb" - postgres17: "17.6.1.002" - postgres15: "15.14.1.002" + postgresorioledb-17: "17.5.1.024-orioledb" + postgres17: "17.6.1.003" + postgres15: "15.14.1.003" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/checks.nix b/nix/checks.nix index 43a0dd4ab..7e791b253 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -308,16 +308,14 @@ postgresql_17_src ; } - // pkgs.lib.optionalAttrs (system == "x86_64-linux") { - pg_net = import ./ext/tests/pg_net.nix { + // pkgs.lib.optionalAttrs (system == "x86_64-linux") ( + { + devShell = self'.devShells.default; + } + // (import ./ext/tests { inherit self; inherit pkgs; - }; - wrappers = import ./ext/tests/wrappers.nix { - inherit self; - inherit pkgs; - }; - devShell = self'.devShells.default; - }; + }) + ); }; } diff --git a/nix/ext/index_advisor.nix b/nix/ext/index_advisor.nix index 4e40214ec..9e6a54aea 100644 --- a/nix/ext/index_advisor.nix +++ b/nix/ext/index_advisor.nix @@ -4,6 +4,7 @@ stdenv, fetchFromGitHub, postgresql, + callPackage, }: let @@ -69,7 +70,8 @@ let in pkgs.buildEnv { name = pname; - paths = packages; + # Add dependency on hypopg for the extension to work + paths = packages ++ [ (callPackage ./hypopg.nix { inherit postgresql; }) ]; pathsToLink = [ "/lib" "/share/postgresql/extension" diff --git a/nix/ext/pg_cron.nix b/nix/ext/pg_cron.nix deleted file mode 100644 index bcaaf180c..000000000 --- a/nix/ext/pg_cron.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - postgresql, -}: - -stdenv.mkDerivation rec { - pname = "pg_cron"; - version = "1.6.4"; - - buildInputs = [ postgresql ]; - - src = fetchFromGitHub { - owner = "citusdata"; - repo = pname; - rev = "v${version}"; - hash = "sha256-t1DpFkPiSfdoGG2NgNT7g1lkvSooZoRoUrix6cBID40="; - }; - - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} - - cp *${postgresql.dlSuffix} $out/lib - cp *.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension - ''; - - meta = with lib; { - description = "Run Cron jobs through PostgreSQL"; - homepage = "https://github.com/citusdata/pg_cron"; - changelog = "https://github.com/citusdata/pg_cron/raw/v$%7Bversion%7D/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - }; -} diff --git a/nix/ext/pg_cron/default.nix b/nix/ext/pg_cron/default.nix new file mode 100644 index 000000000..75215d56a --- /dev/null +++ b/nix/ext/pg_cron/default.nix @@ -0,0 +1,122 @@ +{ + lib, + stdenv, + fetchFromGitHub, + postgresql, + buildEnv, + makeWrapper, + switch-ext-version, +}: +let + pname = "pg_cron"; + allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).${pname}; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + build = + version: versionData: + stdenv.mkDerivation rec { + inherit pname version; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "citusdata"; + repo = pname; + rev = versionData.rev or "v${version}"; + hash = versionData.hash; + }; + + patches = map (p: ./. + "/${p}") (versionData.patches or [ ]); + + buildPhase = '' + make PG_CONFIG=${postgresql}/bin/pg_config + ''; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + # Install versioned library + install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + + if [[ "${version}" == "${latestVersion}" ]]; then + cp ${pname}.sql $out/share/postgresql/extension/${pname}--1.0.0.sql + # Install upgrade scripts + find . -name 'pg_cron--*--*.sql' -exec install -Dm644 {} $out/share/postgresql/extension/ \; + mv $out/share/postgresql/extension/pg_cron--1.0--1.1.sql $out/share/postgresql/extension/pg_cron--1.0.0--1.1.0.sql + mv $out/share/postgresql/extension/pg_cron--1.1--1.2.sql $out/share/postgresql/extension/pg_cron--1.1.0--1.2.0.sql + mv $out/share/postgresql/extension/pg_cron--1.2--1.3.sql $out/share/postgresql/extension/pg_cron--1.2.0--1.3.1.sql + mv $out/share/postgresql/extension/pg_cron--1.3--1.4.sql $out/share/postgresql/extension/pg_cron--1.3.1--1.4.2.sql + mv $out/share/postgresql/extension/pg_cron--1.4--1.4-1.sql $out/share/postgresql/extension/pg_cron--1.4.0--1.4.1.sql + mv $out/share/postgresql/extension/pg_cron--1.4-1--1.5.sql $out/share/postgresql/extension/pg_cron--1.4.2--1.5.2.sql + mv $out/share/postgresql/extension/pg_cron--1.5--1.6.sql $out/share/postgresql/extension/pg_cron--1.5.2--1.6.4.sql + fi + + # Create versioned control file with modified module path + sed -e "/^default_version =/d" \ + -e "/^schema =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + ''; + + meta = with lib; { + description = "Run Cron jobs through PostgreSQL"; + homepage = "https://github.com/citusdata/pg_cron"; + changelog = "https://github.com/citusdata/pg_cron/raw/v$%7Bversion%7D/CHANGELOG.md"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + }; + packages = builtins.attrValues (lib.mapAttrs (name: value: build name value) supportedVersions); +in +buildEnv { + name = pname; + paths = packages; + nativeBuildInputs = [ makeWrapper ]; + + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + + postBuild = '' + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) + + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_pg_cron_version \ + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" + ''; + + meta = with lib; { + description = "Run Cron jobs through PostgreSQL (multi-version compatible)"; + homepage = "https://github.com/citusdata/pg_cron"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + + passthru = { + inherit versions numberOfVersions switch-ext-version; + pname = "${pname}-all"; + hasBackgroundWorker = true; + defaultSettings = { + shared_preload_libraries = [ "pg_cron" ]; + "cron.database_name" = "postgres"; + }; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); + }; +} diff --git a/nix/ext/pg_cron/pg_cron-1.3.1-pg15.patch b/nix/ext/pg_cron/pg_cron-1.3.1-pg15.patch new file mode 100644 index 000000000..6e496aabe --- /dev/null +++ b/nix/ext/pg_cron/pg_cron-1.3.1-pg15.patch @@ -0,0 +1,31 @@ +diff --git a/src/pg_cron.c b/src/pg_cron.c +index e0ca973..4d51b2c 100644 +--- a/src/pg_cron.c ++++ b/src/pg_cron.c +@@ -14,6 +14,8 @@ + #include + + #include "postgres.h" ++#include "commands/async.h" ++#include "miscadmin.h" + #include "fmgr.h" + + /* these are always necessary for a bgworker */ +@@ -1908,7 +1910,7 @@ CronBackgroundWorker(Datum main_arg) + /* Post-execution cleanup. */ + disable_timeout(STATEMENT_TIMEOUT, false); + CommitTransactionCommand(); +- ProcessCompletedNotifies(); ++ /* ProcessCompletedNotifies removed */ + pgstat_report_activity(STATE_IDLE, command); + pgstat_report_stat(true); + +@@ -2025,7 +2027,7 @@ ExecuteSqlString(const char *sql) + */ + oldcontext = MemoryContextSwitchTo(parsecontext); + #if PG_VERSION_NUM >= 100000 +- querytree_list = pg_analyze_and_rewrite(parsetree, sql, NULL, 0,NULL); ++ querytree_list = pg_analyze_and_rewrite_fixedparams(parsetree, sql, NULL, 0, NULL); + #else + querytree_list = pg_analyze_and_rewrite(parsetree, sql, NULL, 0); + #endif \ No newline at end of file diff --git a/nix/ext/pg_net.nix b/nix/ext/pg_net.nix index 3d406f49b..62dad4386 100644 --- a/nix/ext/pg_net.nix +++ b/nix/ext/pg_net.nix @@ -6,111 +6,11 @@ curl, postgresql, libuv, - writeShellApplication, makeWrapper, + switch-ext-version, }: let - enableOverlayOnPackage = writeShellApplication { - name = "enable_overlay_on_package"; - runtimeInputs = [ pkgs.coreutils ]; - text = '' - # This script enable overlayfs on a specific nix store path - set -euo pipefail - - if [ $# -ne 1 ]; then - echo "Usage: $0 " - exit 1 - fi - - PACKAGE_PATH="$1" - PACKAGE_NAME=$(basename "$1"|cut -c 34-) - - # Nixos compatibility: use systemd mount unit - #shellcheck disable=SC1091 - source /etc/os-release || true - if [[ "$ID" == "nixos" ]]; then - # This script is used in NixOS test only for the moment - SYSTEMD_DIR="/run/systemd/system" - else - SYSTEMD_DIR="/etc/systemd/system" - fi - - # Create required directories for overlay - echo "$PACKAGE_NAME" - mkdir -p "/var/lib/overlay/$PACKAGE_NAME/"{upper,work} - - PACKAGE_MOUNT_PATH=$(systemd-escape -p --suffix=mount "$PACKAGE_PATH") - - cat > "$SYSTEMD_DIR/$PACKAGE_MOUNT_PATH" <" - echo "Example: $0 0.10.0" - echo "" - echo "Optional environment variables:" - echo " NIX_PROFILE - Path to nix profile (default: /var/lib/postgresql/.nix-profile)" - echo " LIB_DIR - Override library directory" - echo " EXTENSION_DIR - Override extension directory" - exit 1 - fi - - VERSION="$1" - echo "$VERSION" - - # Enable overlay on the wrapper package to be able to switch version - ${lib.getExe enableOverlayOnPackage} "$EXT_WRAPPER" - - # Check if version exists - EXT_WRAPPER_LIB="$EXT_WRAPPER/lib" - PG_NET_LIB_TO_USE="$EXT_WRAPPER_LIB/pg_net-$VERSION${postgresql.dlSuffix}" - if [ ! -f "$PG_NET_LIB_TO_USE" ]; then - echo "Error: Version $VERSION not found in $EXT_WRAPPER_LIB" - echo "Available versions:" - #shellcheck disable=SC2012 - ls "$EXT_WRAPPER_LIB"/pg_net-*${postgresql.dlSuffix} 2>/dev/null | sed 's/.*pg_net-/ /' | sed 's/${postgresql.dlSuffix}$//' || echo " No versions found" - exit 1 - fi - - # Update library symlink - ln -sfnv "$PG_NET_LIB_TO_USE" "$EXT_WRAPPER_LIB/pg_net${postgresql.dlSuffix}" - - # Update control file - EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" - echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/pg_net.control" - cat "$EXT_WRAPPER_SHARE/pg_net--$VERSION.control" >> "$EXT_WRAPPER_SHARE/pg_net.control" - - echo "Successfully switched pg_net to version $VERSION" - ''; - }; pname = "pg_net"; build = version: hash: @@ -211,13 +111,17 @@ pkgs.buildEnv { }" ) - makeWrapper ${lib.getExe switchPgNetVersion} $out/bin/switch_pg_net_version \ - --prefix EXT_WRAPPER : "$out" + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_pg_net_version \ + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" ''; passthru = { - inherit versions numberOfVersions switchPgNetVersion; + inherit versions numberOfVersions; pname = "${pname}-all"; + hasBackgroundWorker = true; + defaultSettings = { + shared_preload_libraries = [ "pg_net" ]; + }; version = "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix new file mode 100644 index 000000000..a346fac62 --- /dev/null +++ b/nix/ext/tests/default.nix @@ -0,0 +1,190 @@ +{ self, pkgs }: +let + testsDir = ./.; + testFiles = builtins.attrNames (builtins.readDir testsDir); + nixFiles = builtins.filter ( + name: builtins.match ".*\\.nix$" name != null && name != "default.nix" + ) testFiles; + extTest = + extension_name: + let + pname = extension_name; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + in + self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + + services.postgresql = { + enable = true; + package = psql_15; + enableTCPIP = true; + initialScript = pkgs.writeText "init-postgres-with-password" '' + CREATE USER test WITH PASSWORD 'secret'; + ''; + authentication = '' + host test postgres samenet scram-sha-256 + ''; + settings = (installedExtension "15").defaultSettings or { }; + }; + + networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ]; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = psql_15; + newPostgresql = psql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + extension_name = "${pname}" + support_upgrade = True + pg17_configuration = "${pg17-configuration}" + ext_has_background_worker = ${ + if (installedExtension "15") ? hasBackgroundWorker then "True" else "False" + } + + ${builtins.readFile ./lib.py} + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) + + with subtest("Check upgrade path with postgresql 15"): + test.check_upgrade_path("15") + + last_version = None + with subtest("Check the install of the last version of the extension"): + last_version = test.check_install_last_version("15") + + if ext_has_background_worker: + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") + + with subtest("switch to postgresql 17"): + server.succeed( + f"{pg17_configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check last version of the extension after upgrade"): + test.assert_version_matches(last_version) + + with subtest("Check upgrade path with postgresql 17"): + test.check_upgrade_path("17") + ''; + }; +in +builtins.listToAttrs ( + map (file: { + name = "ext-" + builtins.replaceStrings [ ".nix" ] [ "" ] file; + value = import (testsDir + "/${file}") { inherit self pkgs; }; + }) nixFiles +) +// builtins.listToAttrs ( + map + (extName: { + name = "ext-${extName}"; + value = extTest extName; + }) + [ + "index_advisor" + "pg_cron" + "pg_net" + "wrappers" + ] +) diff --git a/nix/ext/tests/index_advisor.nix b/nix/ext/tests/index_advisor.nix deleted file mode 100644 index 9f4b22024..000000000 --- a/nix/ext/tests/index_advisor.nix +++ /dev/null @@ -1,147 +0,0 @@ -{ self, pkgs }: -let - pname = "index_advisor"; - inherit (pkgs) lib; - installedExtension = - postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; - versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; - postgresqlWithExtension = - postgresql: - let - majorVersion = lib.versions.major postgresql.version; - pkg = pkgs.buildEnv { - name = "postgresql-${majorVersion}-${pname}"; - paths = [ - postgresql - postgresql.lib - (installedExtension majorVersion) - self.packages.${pkgs.system}."psql_${majorVersion}/exts/hypopg" # dependency - ]; - passthru = { - inherit (postgresql) version psqlSchema; - lib = pkg; - withPackages = _: pkg; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - pathsToLink = [ - "/" - "/bin" - "/lib" - ]; - postBuild = '' - wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib - ''; - }; - in - pkg; -in -self.inputs.nixpkgs.lib.nixos.runTest { - name = pname; - hostPkgs = pkgs; - nodes.server = - { config, ... }: - { - virtualisation = { - forwardPorts = [ - { - from = "host"; - host.port = 13022; - guest.port = 22; - } - ]; - }; - - services.postgresql = { - enable = true; - package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - }; - - specialisation.postgresql17.configuration = { - services.postgresql = { - package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); - }; - - systemd.services.postgresql-migrate = { - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - User = "postgres"; - Group = "postgres"; - StateDirectory = "postgresql"; - WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; - }; - script = - let - oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; - oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; - newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; - in - '' - if [[ ! -d ${newDataDir} ]]; then - install -d -m 0700 -o postgres -g postgres "${newDataDir}" - ${newPostgresql}/bin/initdb -D "${newDataDir}" - ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ - --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" - else - echo "${newDataDir} already exists" - fi - ''; - }; - - systemd.services.postgresql = { - after = [ "postgresql-migrate.service" ]; - requires = [ "postgresql-migrate.service" ]; - }; - }; - }; - testScript = - { nodes, ... }: - let - pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; - in - '' - versions = { - "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], - "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], - } - - def run_sql(query): - return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() - - def check_upgrade_path(pg_version): - with subtest("Check ${pname} upgrade path"): - firstVersion = versions[pg_version][0] - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") - run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") - assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" - for version in versions[pg_version][1:]: - run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") - assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" - - start_all() - - server.wait_for_unit("multi-user.target") - server.wait_for_unit("postgresql.service") - - check_upgrade_path("15") - - with subtest("Check ${pname} latest extension version"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") - server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") - installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") - latestVersion = versions["15"][-1] - assert f"${pname},{latestVersion}" in installed_extensions - - with subtest("switch to postgresql 17"): - server.succeed( - "${pg17-configuration}/bin/switch-to-configuration test >&2" - ) - - check_upgrade_path("17") - ''; -} diff --git a/nix/ext/tests/lib.py b/nix/ext/tests/lib.py new file mode 100644 index 000000000..1e3956c9b --- /dev/null +++ b/nix/ext/tests/lib.py @@ -0,0 +1,169 @@ +"""PostgreSQL extension testing framework for multi-version compatibility. + +This module provides a test framework for PostgreSQL extensions that need to be +tested across multiple PostgreSQL versions and extension versions. It handles +installation, upgrades, and version verification of PostgreSQL extensions. +""" + +from typing import Sequence, Mapping +from pathlib import Path +from test_driver.machine import Machine + +Versions = Mapping[str, Sequence[str]] + + +class PostgresExtensionTest(object): + def __init__( + self, + vm: Machine, + extension_name: str, + versions: Versions, + support_upgrade: bool = True, + ): + """Initialize the PostgreSQL extension test framework. + + Args: + vm: Test machine instance for executing commands + extension_name: Name of the PostgreSQL extension to test + versions: Mapping of PostgreSQL versions to available extension versions + support_upgrade: Whether the extension supports in-place upgrades + """ + self.vm = vm + self.extension_name = extension_name + self.versions = versions + self.support_upgrade = support_upgrade + + def run_sql(self, query: str) -> str: + return self.vm.succeed( + f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """ + ).strip() + + def drop_extension(self): + self.run_sql(f"DROP EXTENSION IF EXISTS {self.extension_name};") + + def install_extension(self, version: str): + self.run_sql( + f"""CREATE EXTENSION {self.extension_name} WITH VERSION '{version}' CASCADE;""" + ) + # Verify version was installed correctly + self.assert_version_matches(version) + + def update_extension(self, version: str): + self.run_sql( + f"""ALTER EXTENSION {self.extension_name} UPDATE TO '{version}';""" + ) + # Verify version was installed correctly + self.assert_version_matches(version) + + def get_installed_version(self) -> str: + """Get the currently installed version of the extension. + + Returns: + Version string of the currently installed extension, + or empty string if extension is not installed + """ + return self.run_sql( + f"""SELECT extversion FROM pg_extension WHERE extname = '{self.extension_name}';""" + ) + + def assert_version_matches(self, expected_version: str): + """Check if the installed version matches the expected version. + + Args: + expected_version: Expected version string to verify against + + Raises: + AssertionError: If the installed version does not match the expected version + """ + installed_version = self.get_installed_version() + assert ( + installed_version == expected_version + ), f"Expected version {expected_version}, but found {installed_version}" + + def check_upgrade_path(self, pg_version: str): + """Test the complete upgrade path for a PostgreSQL version. + + This method tests all available extension versions for a given PostgreSQL + version, either through in-place upgrades or reinstallation depending on + the support_upgrade setting. + + Args: + pg_version: PostgreSQL version to test (e.g., "14", "15") + + Raises: + ValueError: If no versions are available for the specified PostgreSQL version + AssertionError: If version installation or upgrade fails + """ + available_versions = self.versions.get(pg_version, []) + if not available_versions: + raise ValueError( + f"No versions available for PostgreSQL version {pg_version}" + ) + + # Install and verify first version + firstVersion = available_versions[0] + self.drop_extension() + self.install_extension(firstVersion) + + # Test remaining versions + for version in available_versions[1:]: + if self.support_upgrade: + self.update_extension(version) + else: + self.drop_extension() + self.install_extension(version) + + def check_install_last_version(self, pg_version: str) -> str: + """Test if the install of the last version of the extension works for a given PostgreSQL version. + + Args: + pg_version: PostgreSQL version to check (e.g., "14", "15") + """ + available_versions = self.versions.get(pg_version, []) + if not available_versions: + raise ValueError( + f"No versions available for PostgreSQL version {pg_version}" + ) + last_version = available_versions[-1] + self.drop_extension() + self.install_extension(last_version) + return last_version + + def check_switch_extension_with_background_worker( + self, extension_lib_path: Path, pg_version: str + ): + """Test manual switching between two versions of an extension with a background worker. + + Args: + extension_lib_path: Path to the directory containing the extension shared library of the extension + pg_version: PostgreSQL version to check (e.g., "14", "15") + """ + # Check that we are using the last version first + ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() + available_versions = self.versions.get(pg_version, []) + if not available_versions: + raise ValueError( + f"No versions available for PostgreSQL version {pg_version}" + ) + last_version = available_versions[-1] + assert ext_version.endswith( + f"{self.extension_name}-{last_version}.so" + ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" + + # Switch to the first version + first_version = available_versions[0] + self.vm.succeed(f"switch_{self.extension_name}_version {first_version}") + + # Check that we are using the first version now + ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() + assert ext_version.endswith( + f"{self.extension_name}-{first_version}.so" + ), f"Expected {self.extension_name} version {first_version}, but found {ext_version}" + + # Switch to the first version + self.vm.succeed(f"switch_{self.extension_name}_version {last_version}") + # Check that we are using the last version now + ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() + assert ext_version.endswith( + f"{self.extension_name}-{last_version}.so" + ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" diff --git a/nix/ext/tests/pg_net.nix b/nix/ext/tests/pg_net.nix deleted file mode 100644 index 6ec9b92cf..000000000 --- a/nix/ext/tests/pg_net.nix +++ /dev/null @@ -1,175 +0,0 @@ -{ self, pkgs }: -let - inherit (pkgs) lib; - installedExtension = - postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/pg_net-all"; - versions = (installedExtension "17").versions; - firstVersion = lib.head versions; - latestVersion = lib.last versions; - postgresqlWithExtension = - postgresql: - let - majorVersion = lib.versions.major postgresql.version; - pkg = pkgs.buildEnv { - name = "postgresql-${majorVersion}-pg_net"; - paths = [ - postgresql - postgresql.lib - (installedExtension majorVersion) - ]; - passthru = { - inherit (postgresql) version psqlSchema; - lib = pkg; - withPackages = _: pkg; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - pathsToLink = [ - "/" - "/bin" - "/lib" - ]; - postBuild = '' - wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib - ''; - }; - in - pkg; - psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; -in -self.inputs.nixpkgs.lib.nixos.runTest { - name = "pg_net"; - hostPkgs = pkgs; - nodes.server = - { config, ... }: - { - virtualisation = { - forwardPorts = [ - { - from = "host"; - host.port = 13022; - guest.port = 22; - } - ]; - }; - services.openssh = { - enable = true; - }; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIo+ulCUfJjnCVgfM4946Ih5Nm8DeZZiayYeABHGPEl7 jfroche" - ]; - - services.postgresql = { - enable = true; - package = psql_15; - settings = { - shared_preload_libraries = "pg_net"; - }; - }; - - specialisation.postgresql17.configuration = { - services.postgresql = { - package = lib.mkForce psql_17; - }; - - environment.systemPackages = [ psql_17 ]; - - systemd.services.postgresql-migrate = { - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - User = "postgres"; - Group = "postgres"; - StateDirectory = "postgresql"; - WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; - }; - script = - let - oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; - oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; - newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; - in - '' - if [[ ! -d ${newDataDir} ]]; then - install -d -m 0700 -o postgres -g postgres "${newDataDir}" - ${newPostgresql}/bin/initdb -D "${newDataDir}" - ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ - --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" - else - echo "${newDataDir} already exists" - fi - ''; - }; - - systemd.services.postgresql = { - after = [ "postgresql-migrate.service" ]; - requires = [ "postgresql-migrate.service" ]; - }; - }; - }; - testScript = - { nodes, ... }: - let - pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; - in - '' - def run_sql(query): - return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() - - def check_upgrade_path(): - with subtest("Check pg_net upgrade path"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS pg_net;'") - run_sql(r"""CREATE EXTENSION pg_net WITH VERSION \"${firstVersion}\";""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'pg_net';""") - assert installed_version == "${firstVersion}", f"Expected pg_net version ${firstVersion}, but found {installed_version}" - for version in [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}][1:]: - run_sql(f"""ALTER EXTENSION pg_net UPDATE TO '{version}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = 'pg_net';""") - assert installed_version == version, f"Expected pg_net version {version}, but found {installed_version}" - - start_all() - - server.wait_for_unit("multi-user.target") - server.wait_for_unit("postgresql.service") - - check_upgrade_path() - - with subtest("Test switch_pg_net_version"): - # Check that we are using the last version first - pg_net_version = server.succeed("readlink -f ${psql_15}/lib/pg_net.so").strip() - print(f"Current pg_net version: {pg_net_version}") - assert pg_net_version.endswith("pg_net-${latestVersion}.so"), f"Expected pg_net version ${latestVersion}, but found {pg_net_version}" - - server.succeed( - "switch_pg_net_version ${firstVersion}" - ) - - pg_net_version = server.succeed("readlink -f ${psql_15}/lib/pg_net.so").strip() - assert pg_net_version.endswith("pg_net-${firstVersion}.so"), f"Expected pg_net version ${firstVersion}, but found {pg_net_version}" - - server.succeed( - "switch_pg_net_version ${latestVersion}" - ) - - with subtest("Check pg_net latest extension version"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION pg_net;'") - server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION pg_net;'") - installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") - assert "pg_net,${latestVersion}" in installed_extensions - - with subtest("switch to multiple node configuration"): - server.succeed( - "${pg17-configuration}/bin/switch-to-configuration test >&2" - ) - - with subtest("Check pg_net latest extension version"): - installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") - assert "pg_net,${latestVersion}" in installed_extensions - - check_upgrade_path() - - ''; -} diff --git a/nix/ext/tests/wrappers.nix b/nix/ext/tests/wrappers.nix deleted file mode 100644 index 54cc63944..000000000 --- a/nix/ext/tests/wrappers.nix +++ /dev/null @@ -1,157 +0,0 @@ -{ self, pkgs }: -let - pname = "wrappers"; - inherit (pkgs) lib; - installedExtension = - postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; - versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; - postgresqlWithExtension = - postgresql: - let - majorVersion = lib.versions.major postgresql.version; - pkg = pkgs.buildEnv { - name = "postgresql-${majorVersion}-${pname}"; - paths = [ - postgresql - postgresql.lib - (installedExtension majorVersion) - ]; - passthru = { - inherit (postgresql) version psqlSchema; - lib = pkg; - withPackages = _: pkg; - }; - nativeBuildInputs = [ pkgs.makeWrapper ]; - pathsToLink = [ - "/" - "/bin" - "/lib" - ]; - postBuild = '' - wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib - wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib - ''; - }; - in - pkg; -in -self.inputs.nixpkgs.lib.nixos.runTest { - name = pname; - hostPkgs = pkgs; - nodes.server = - { config, ... }: - { - virtualisation = { - forwardPorts = [ - { - from = "host"; - host.port = 13022; - guest.port = 22; - } - ]; - }; - services.openssh = { - enable = true; - }; - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIo+ulCUfJjnCVgfM4946Ih5Nm8DeZZiayYeABHGPEl7 jfroche" - ]; - - services.postgresql = { - enable = true; - package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - }; - - specialisation.postgresql17.configuration = { - services.postgresql = { - package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); - }; - - systemd.services.postgresql-migrate = { - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - User = "postgres"; - Group = "postgres"; - StateDirectory = "postgresql"; - WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; - }; - script = - let - oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; - newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; - oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; - newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; - in - '' - if [[ ! -d ${newDataDir} ]]; then - install -d -m 0700 -o postgres -g postgres "${newDataDir}" - ${newPostgresql}/bin/initdb -D "${newDataDir}" - ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ - --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" - else - echo "${newDataDir} already exists" - fi - ''; - }; - - systemd.services.postgresql = { - after = [ "postgresql-migrate.service" ]; - requires = [ "postgresql-migrate.service" ]; - }; - }; - }; - testScript = - { nodes, ... }: - let - pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; - in - '' - versions = { - "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], - "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], - } - - def run_sql(query): - return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() - - def check_upgrade_path(pg_version): - with subtest("Check ${pname} upgrade path"): - firstVersion = versions[pg_version][0] - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") - run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") - assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" - for version in versions[pg_version][1:]: - run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") - installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") - assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" - - start_all() - - server.wait_for_unit("multi-user.target") - server.wait_for_unit("postgresql.service") - - check_upgrade_path("15") - - with subtest("Check ${pname} latest extension version"): - server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") - server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname};'") - installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") - latestVersion = versions["15"][-1] - assert f"${pname},{latestVersion}" in installed_extensions - - with subtest("switch to postgresql 17"): - server.succeed( - "${pg17-configuration}/bin/switch-to-configuration test >&2" - ) - - with subtest("Check ${pname} latest extension version"): - installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") - latestVersion = versions["17"][-1] - assert f"${pname},{latestVersion}" in installed_extensions - - check_upgrade_path("17") - ''; -} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index b42d93b82..6d9c5a2db 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -21,7 +21,42 @@ "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" } }, - "pg_net": { + "pg_cron": { + "1.3.1": { + "postgresql": [ + "15" + ], + "rev": "v1.3.1", + "hash": "sha256-rXotNOtQNmA55ErNxGoNSKZ0pP1uxEVlDGITFHuqGG4=", + "patches": [ + "pg_cron-1.3.1-pg15.patch" + ] + }, + "1.4.2": { + "postgresql": [ + "15" + ], + "rev": "v1.4.2", + "hash": "sha256-P0Fd10Q1p+KrExb35G6otHpc6pD61WnMll45H2jkevM=" + }, + "1.5.2": { + "postgresql": [ + "15" + ], + "rev": "v1.5.2", + "hash": "sha256-+quVWbKJy6wXpL/zwTk5FF7sYwHA7I97WhWmPO/HSZ4=" + }, + "1.6.4": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "rev": "v1.6.4", + "hash": "sha256-t1DpFkPiSfdoGG2NgNT7g1lkvSooZoRoUrix6cBID40=" + } + }, + "pg_net": { "0.1": { "postgresql": [ "15" diff --git a/nix/fmt.nix b/nix/fmt.nix index 760cb5930..562c3b3c5 100644 --- a/nix/fmt.nix +++ b/nix/fmt.nix @@ -4,9 +4,13 @@ perSystem = { pkgs, ... }: { - treefmt.programs.deadnix.enable = true; - - treefmt.programs.nixfmt.enable = true; - treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style; + treefmt.programs = { + deadnix.enable = true; + nixfmt = { + enable = true; + package = pkgs.nixfmt-rfc-style; + }; + ruff-format.enable = true; + }; }; } diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index f6eda4243..a3fd52034 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -11,6 +11,7 @@ postgresql_17 postgresql_orioledb-17 supabase-groonga + switch-ext-version ; xmrig = throw "The xmrig package has been explicitly disabled in this flake."; diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 342763961..fca05a10a 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -37,6 +37,7 @@ supabase-groonga = pkgs.callPackage ./groonga { }; local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { }; migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; }; + overlayfs-on-package = pkgs.callPackage ./overlayfs-on-package.nix { }; packer = pkgs.callPackage ./packer.nix { inherit inputs; }; pg-restore = pkgs.callPackage ./pg-restore.nix { psql_15 = self'.packages."psql_15/bin"; }; pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; @@ -57,6 +58,9 @@ inherit pkgs; name = "start-postgres-server"; }; + switch-ext-version = pkgs.callPackage ./switch-ext-version.nix { + inherit (self'.packages) overlayfs-on-package; + }; sync-exts-versions = pkgs.callPackage ./sync-exts-versions.nix { inherit (inputs') nix-editor; }; trigger-nix-build = pkgs.callPackage ./trigger-nix-build.nix { }; update-readme = pkgs.callPackage ./update-readme.nix { }; diff --git a/nix/packages/overlayfs-on-package.nix b/nix/packages/overlayfs-on-package.nix new file mode 100644 index 000000000..2883c7a4e --- /dev/null +++ b/nix/packages/overlayfs-on-package.nix @@ -0,0 +1,49 @@ +{ writeShellApplication, coreutils }: +writeShellApplication { + name = "overlayfs-on-package"; + runtimeInputs = [ coreutils ]; + text = '' + # This script enable overlayfs on a specific nix store path + set -euo pipefail + + if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 + fi + + PACKAGE_PATH="$1" + PACKAGE_NAME=$(basename "$1"|cut -c 34-) + + # Nixos compatibility: use systemd mount unit + #shellcheck disable=SC1091 + source /etc/os-release || true + if [[ "$ID" == "nixos" ]]; then + # This script is used in NixOS test only for the moment + SYSTEMD_DIR="/run/systemd/system" + else + SYSTEMD_DIR="/etc/systemd/system" + fi + + # Create required directories for overlay + echo "$PACKAGE_NAME" + mkdir -p "/var/lib/overlay/$PACKAGE_NAME/"{upper,work} + + PACKAGE_MOUNT_PATH=$(systemd-escape -p --suffix=mount "$PACKAGE_PATH") + + cat > "$SYSTEMD_DIR/$PACKAGE_MOUNT_PATH" <" + echo "Example: $0 0.10.0" + echo "" + echo "Optional environment variables:" + echo " NIX_PROFILE - Path to nix profile (default: /var/lib/postgresql/.nix-profile)" + echo " LIB_DIR - Override library directory" + echo " EXTENSION_DIR - Override extension directory" + exit 1 + fi + + VERSION="$1" + echo "$VERSION" + + # Enable overlay on the wrapper package to be able to switch version + ${lib.getExe overlayfs-on-package} "$EXT_WRAPPER" + + # Check if version exists + EXT_WRAPPER_LIB="$EXT_WRAPPER/lib" + EXT_LIB_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-$VERSION${postgresql.dlSuffix}" + if [ ! -f "$EXT_LIB_TO_USE" ]; then + echo "Error: Version $VERSION not found in $EXT_WRAPPER_LIB" + echo "Available versions:" + #shellcheck disable=SC2012 + ls "$EXT_WRAPPER_LIB/$EXT_NAME"-*${postgresql.dlSuffix} 2>/dev/null | sed "s/.*$EXT_NAME-/ /" | sed 's/${postgresql.dlSuffix}$//' || echo " No versions found" + exit 1 + fi + + # Update library symlink + ln -sfnv "$EXT_LIB_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" + + # Update control file + EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" + echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/$EXT_NAME.control" + cat "$EXT_WRAPPER_SHARE/$EXT_NAME--$VERSION.control" >> "$EXT_WRAPPER_SHARE/$EXT_NAME.control" + + echo "Successfully switched $EXT_NAME to version $VERSION" + ''; +} diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 19219f74a..2325ff3d7 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -178,24 +178,27 @@ def get_ssh_connection(instance_ip, ssh_identity_file, max_retries=10): # Create SSH client ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - + # Connect with our working parameters ssh.connect( hostname=instance_ip, - username='ubuntu', + username="ubuntu", key_filename=ssh_identity_file, timeout=10, - banner_timeout=10 + banner_timeout=10, ) - + # Test the connection stdin, stdout, stderr = ssh.exec_command('echo "SSH test"') - if stdout.channel.recv_exit_status() == 0 and "SSH test" in stdout.read().decode(): + if ( + stdout.channel.recv_exit_status() == 0 + and "SSH test" in stdout.read().decode() + ): logger.info("SSH connection established successfully") return ssh else: raise Exception("SSH test command failed") - + except Exception as e: if attempt == max_retries - 1: raise @@ -210,9 +213,9 @@ def run_ssh_command(ssh, command, timeout=None): stdin, stdout, stderr = ssh.exec_command(command, timeout=timeout) exit_code = stdout.channel.recv_exit_status() return { - 'succeeded': exit_code == 0, - 'stdout': stdout.read().decode(), - 'stderr': stderr.read().decode() + "succeeded": exit_code == 0, + "stdout": stdout.read().decode(), + "stderr": stderr.read().decode(), } @@ -319,10 +322,10 @@ def gzip_then_base64_encode(s: str) -> str: # Check PostgreSQL data directory logger.info("Checking PostgreSQL data directory...") result = run_ssh_command(ssh, "ls -la /var/lib/postgresql") - if result['succeeded']: - logger.info("PostgreSQL data directory contents:\n" + result['stdout']) + if result["succeeded"]: + logger.info("PostgreSQL data directory contents:\n" + result["stdout"]) else: - logger.warning("Failed to list PostgreSQL data directory: " + result['stderr']) + logger.warning("Failed to list PostgreSQL data directory: " + result["stderr"]) # Wait for init.sh to complete logger.info("Waiting for init.sh to complete...") @@ -331,14 +334,16 @@ def gzip_then_base64_encode(s: str) -> str: while attempt < max_attempts: try: result = run_ssh_command(ssh, "test -f /var/lib/init-complete", timeout=5) - if result['succeeded']: + if result["succeeded"]: logger.info("init.sh has completed") break except Exception as e: logger.warning(f"Error checking init.sh status: {str(e)}") - + attempt += 1 - logger.warning(f"Waiting for init.sh to complete (attempt {attempt}/{max_attempts})") + logger.warning( + f"Waiting for init.sh to complete (attempt {attempt}/{max_attempts})" + ) sleep(5) if attempt >= max_attempts: @@ -349,9 +354,18 @@ def gzip_then_base64_encode(s: str) -> str: def is_healthy(ssh) -> bool: health_checks = [ ("postgres", "sudo -u postgres /usr/bin/pg_isready -U postgres"), - ("adminapi", f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'"), - ("postgrest", "curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready"), - ("gotrue", "curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health"), + ( + "adminapi", + f"curl -sf -k --connect-timeout 30 --max-time 60 https://localhost:8085/health -H 'apikey: {supabase_admin_key}'", + ), + ( + "postgrest", + "curl -sf --connect-timeout 30 --max-time 60 http://localhost:3001/ready", + ), + ( + "gotrue", + "curl -sf --connect-timeout 30 --max-time 60 http://localhost:8081/health", + ), ("kong", "sudo kong health"), ("fail2ban", "sudo fail2ban-client status"), ] @@ -359,7 +373,7 @@ def is_healthy(ssh) -> bool: for service, command in health_checks: try: result = run_ssh_command(ssh, command) - if not result['succeeded']: + if not result["succeeded"]: logger.warning(f"{service} not ready") return False except Exception: @@ -374,10 +388,7 @@ def is_healthy(ssh) -> bool: sleep(1) # Return both the SSH connection and instance IP for use in tests - yield { - 'ssh': ssh, - 'ip': instance.public_ip_address - } + yield {"ssh": ssh, "ip": instance.public_ip_address} # at the end of the test suite, destroy the instance instance.terminate() @@ -385,8 +396,10 @@ def is_healthy(ssh) -> bool: def test_postgrest_is_running(host): """Check if postgrest service is running using our SSH connection.""" - result = run_ssh_command(host['ssh'], "systemctl is-active postgrest") - assert result['succeeded'] and result['stdout'].strip() == 'active', "PostgREST service is not running" + result = run_ssh_command(host["ssh"], "systemctl is-active postgrest") + assert ( + result["succeeded"] and result["stdout"].strip() == "active" + ), "PostgREST service is not running" def test_postgrest_responds_to_requests(host): @@ -512,229 +525,280 @@ def test_postgrest_ending_empty_key_query_parameter_is_removed(host): def test_postgresql_version(host): """Print the PostgreSQL version being tested and ensure it's >= 14.""" - result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c 'SELECT version();'") - if result['succeeded']: + result = run_ssh_command( + host["ssh"], "sudo -u postgres psql -c 'SELECT version();'" + ) + if result["succeeded"]: print(f"\nPostgreSQL Version:\n{result['stdout']}") # Extract version number from the output - version_line = result['stdout'].strip().split('\n')[2] # Skip header and get the actual version + version_line = ( + result["stdout"].strip().split("\n")[2] + ) # Skip header and get the actual version # Extract major version number (e.g., "15.8" -> 15) import re - version_match = re.search(r'PostgreSQL (\d+)\.', version_line) + + version_match = re.search(r"PostgreSQL (\d+)\.", version_line) if version_match: major_version = int(version_match.group(1)) print(f"PostgreSQL major version: {major_version}") - assert major_version >= 14, f"PostgreSQL version {major_version} is less than 14" + assert ( + major_version >= 14 + ), f"PostgreSQL version {major_version} is less than 14" else: assert False, "Could not parse PostgreSQL version number" else: print(f"\nFailed to get PostgreSQL version: {result['stderr']}") assert False, "Failed to get PostgreSQL version" - + # Also get the version from the command line - result = run_ssh_command(host['ssh'], "sudo -u postgres psql --version") - if result['succeeded']: + result = run_ssh_command(host["ssh"], "sudo -u postgres psql --version") + if result["succeeded"]: print(f"PostgreSQL Client Version: {result['stdout'].strip()}") else: print(f"Failed to get PostgreSQL client version: {result['stderr']}") - + print("✓ PostgreSQL version is >= 14") def test_libpq5_version(host): """Print the libpq5 version installed and ensure it's >= 14.""" # Try different package managers to find libpq5 - result = run_ssh_command(host['ssh'], "dpkg -l | grep libpq5 || true") - if result['succeeded'] and result['stdout'].strip(): + result = run_ssh_command(host["ssh"], "dpkg -l | grep libpq5 || true") + if result["succeeded"] and result["stdout"].strip(): print(f"\nlibpq5 package info:\n{result['stdout']}") # Extract version from dpkg output (format: ii libpq5:arm64 17.5-1.pgdg20.04+1) import re - version_match = re.search(r'libpq5[^ ]* +(\d+)\.', result['stdout']) + + version_match = re.search(r"libpq5[^ ]* +(\d+)\.", result["stdout"]) if version_match: major_version = int(version_match.group(1)) print(f"libpq5 major version: {major_version}") - assert major_version >= 14, f"libpq5 version {major_version} is less than 14" + assert ( + major_version >= 14 + ), f"libpq5 version {major_version} is less than 14" else: print("Could not parse libpq5 version from dpkg output") else: print("\nlibpq5 not found via dpkg") - + # Also try to find libpq.so files - result = run_ssh_command(host['ssh'], "find /usr -name '*libpq*' -type f 2>/dev/null | head -10") - if result['succeeded'] and result['stdout'].strip(): + result = run_ssh_command( + host["ssh"], "find /usr -name '*libpq*' -type f 2>/dev/null | head -10" + ) + if result["succeeded"] and result["stdout"].strip(): print(f"\nlibpq files found:\n{result['stdout']}") else: print("\nNo libpq files found") - + # Check if we can get version from a libpq file - result = run_ssh_command(host['ssh'], "ldd /usr/bin/psql | grep libpq || true") - if result['succeeded'] and result['stdout'].strip(): + result = run_ssh_command(host["ssh"], "ldd /usr/bin/psql | grep libpq || true") + if result["succeeded"] and result["stdout"].strip(): print(f"\npsql libpq dependency:\n{result['stdout']}") else: print("\nCould not find libpq dependency for psql") - + # Try to get version from libpq directly - result = run_ssh_command(host['ssh'], "psql --version 2>&1 | head -1") - if result['succeeded'] and result['stdout'].strip(): + result = run_ssh_command(host["ssh"], "psql --version 2>&1 | head -1") + if result["succeeded"] and result["stdout"].strip(): print(f"\npsql version output: {result['stdout'].strip()}") # The psql version should match the libpq version import re - version_match = re.search(r'psql \(PostgreSQL\) (\d+)\.', result['stdout']) + + version_match = re.search(r"psql \(PostgreSQL\) (\d+)\.", result["stdout"]) if version_match: major_version = int(version_match.group(1)) print(f"psql/libpq major version: {major_version}") - assert major_version >= 14, f"psql/libpq version {major_version} is less than 14" + assert ( + major_version >= 14 + ), f"psql/libpq version {major_version} is less than 14" else: print("Could not parse psql version") - + print("✓ libpq5 version is >= 14") def test_postgrest_read_only_session_attrs(host): """Test PostgREST with target_session_attrs=read-only and check for session errors.""" # First, check if PostgreSQL is configured for read-only mode - result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW default_transaction_read_only;\"") - if result['succeeded']: - default_read_only = result['stdout'].strip() + result = run_ssh_command( + host["ssh"], 'sudo -u postgres psql -c "SHOW default_transaction_read_only;"' + ) + if result["succeeded"]: + default_read_only = result["stdout"].strip() print(f"PostgreSQL default_transaction_read_only: {default_read_only}") else: print("Could not check PostgreSQL read-only setting") default_read_only = "unknown" - + # Check if PostgreSQL is in recovery mode (standby) - result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SELECT pg_is_in_recovery();\"") - if result['succeeded']: - in_recovery = result['stdout'].strip() + result = run_ssh_command( + host["ssh"], 'sudo -u postgres psql -c "SELECT pg_is_in_recovery();"' + ) + if result["succeeded"]: + in_recovery = result["stdout"].strip() print(f"PostgreSQL pg_is_in_recovery: {in_recovery}") else: print("Could not check PostgreSQL recovery status") in_recovery = "unknown" - + # Find PostgreSQL configuration file - result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW config_file;\"") - if result['succeeded']: - config_file = result['stdout'].strip().split('\n')[2].strip() # Skip header and get the actual path + result = run_ssh_command( + host["ssh"], 'sudo -u postgres psql -c "SHOW config_file;"' + ) + if result["succeeded"]: + config_file = ( + result["stdout"].strip().split("\n")[2].strip() + ) # Skip header and get the actual path print(f"PostgreSQL config file: {config_file}") else: print("Could not find PostgreSQL config file") config_file = "/etc/postgresql/15/main/postgresql.conf" # Default fallback - + # Backup PostgreSQL config - result = run_ssh_command(host['ssh'], f"sudo cp {config_file} {config_file}.backup") - assert result['succeeded'], "Failed to backup PostgreSQL config" - + result = run_ssh_command(host["ssh"], f"sudo cp {config_file} {config_file}.backup") + assert result["succeeded"], "Failed to backup PostgreSQL config" + # Add read-only setting to PostgreSQL config - result = run_ssh_command(host['ssh'], f"echo 'default_transaction_read_only = on' | sudo tee -a {config_file}") - assert result['succeeded'], "Failed to add read-only setting to PostgreSQL config" - + result = run_ssh_command( + host["ssh"], + f"echo 'default_transaction_read_only = on' | sudo tee -a {config_file}", + ) + assert result["succeeded"], "Failed to add read-only setting to PostgreSQL config" + # Restart PostgreSQL to apply the new configuration - result = run_ssh_command(host['ssh'], "sudo systemctl restart postgresql") - assert result['succeeded'], "Failed to restart PostgreSQL" - + result = run_ssh_command(host["ssh"], "sudo systemctl restart postgresql") + assert result["succeeded"], "Failed to restart PostgreSQL" + # Wait for PostgreSQL to start up sleep(5) - + # Verify the change took effect - result = run_ssh_command(host['ssh'], "sudo -u postgres psql -c \"SHOW default_transaction_read_only;\"") - if result['succeeded']: - new_default_read_only = result['stdout'].strip() - print(f"PostgreSQL default_transaction_read_only after change: {new_default_read_only}") + result = run_ssh_command( + host["ssh"], 'sudo -u postgres psql -c "SHOW default_transaction_read_only;"' + ) + if result["succeeded"]: + new_default_read_only = result["stdout"].strip() + print( + f"PostgreSQL default_transaction_read_only after change: {new_default_read_only}" + ) else: print("Could not verify PostgreSQL read-only setting change") - + # First, backup the current PostgREST config - result = run_ssh_command(host['ssh'], "sudo cp /etc/postgrest/base.conf /etc/postgrest/base.conf.backup") - assert result['succeeded'], "Failed to backup PostgREST config" - + result = run_ssh_command( + host["ssh"], "sudo cp /etc/postgrest/base.conf /etc/postgrest/base.conf.backup" + ) + assert result["succeeded"], "Failed to backup PostgREST config" + try: # Read the current config to get the db-uri - result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'") - assert result['succeeded'], "Failed to read current db-uri" - - current_db_uri = result['stdout'].strip() + result = run_ssh_command( + host["ssh"], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'" + ) + assert result["succeeded"], "Failed to read current db-uri" + + current_db_uri = result["stdout"].strip() print(f"Current db-uri: {current_db_uri}") - + # Extract just the URI part (remove the db-uri = " prefix and trailing quote) uri_start = current_db_uri.find('"') + 1 uri_end = current_db_uri.rfind('"') base_uri = current_db_uri[uri_start:uri_end] - + # Modify the URI to add target_session_attrs=read-only - if '?' in base_uri: + if "?" in base_uri: # URI already has parameters, add target_session_attrs modified_uri = base_uri + "&target_session_attrs=read-only" else: # URI has no parameters, add target_session_attrs modified_uri = base_uri + "?target_session_attrs=read-only" - + print(f"Modified URI: {modified_uri}") - + # Use awk to replace the db-uri line more reliably - result = run_ssh_command(host['ssh'], f"sudo awk '{{if ($1 == \"db-uri\") print \"db-uri = \\\"{modified_uri}\\\"\"; else print $0}}' /etc/postgrest/base.conf > /tmp/new_base.conf && sudo mv /tmp/new_base.conf /etc/postgrest/base.conf") - assert result['succeeded'], "Failed to update db-uri in config" - + result = run_ssh_command( + host["ssh"], + f'sudo awk \'{{if ($1 == "db-uri") print "db-uri = \\"{modified_uri}\\""; else print $0}}\' /etc/postgrest/base.conf > /tmp/new_base.conf && sudo mv /tmp/new_base.conf /etc/postgrest/base.conf', + ) + assert result["succeeded"], "Failed to update db-uri in config" + # Verify the change was made correctly - result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'") + result = run_ssh_command( + host["ssh"], "sudo cat /etc/postgrest/base.conf | grep '^db-uri'" + ) print(f"Updated db-uri line: {result['stdout'].strip()}") - + # Also show the full config to debug - result = run_ssh_command(host['ssh'], "sudo cat /etc/postgrest/base.conf") + result = run_ssh_command(host["ssh"], "sudo cat /etc/postgrest/base.conf") print(f"Full config after change:\n{result['stdout']}") - + # Restart PostgREST to apply the new configuration - result = run_ssh_command(host['ssh'], "sudo systemctl restart postgrest") - assert result['succeeded'], "Failed to restart PostgREST" - + result = run_ssh_command(host["ssh"], "sudo systemctl restart postgrest") + assert result["succeeded"], "Failed to restart PostgREST" + # Wait a moment for PostgREST to start up sleep(5) - + # Check if PostgREST is running - result = run_ssh_command(host['ssh'], "sudo systemctl is-active postgrest") - if not (result['succeeded'] and result['stdout'].strip() == 'active'): + result = run_ssh_command(host["ssh"], "sudo systemctl is-active postgrest") + if not (result["succeeded"] and result["stdout"].strip() == "active"): # If PostgREST failed to start, check the logs to see why - log_result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' --no-pager") + log_result = run_ssh_command( + host["ssh"], + "sudo journalctl -u postgrest --since '5 seconds ago' --no-pager", + ) print(f"PostgREST failed to start. Recent logs:\n{log_result['stdout']}") assert False, "PostgREST failed to start after config change" - + # Make a test request to trigger any potential session errors try: response = requests.get( f"http://{host['ip']}/rest/v1/", headers={"apikey": anon_key, "authorization": f"Bearer {anon_key}"}, - timeout=10 + timeout=10, ) print(f"Test request status: {response.status_code}") except Exception as e: print(f"Test request failed: {str(e)}") - + # Check PostgREST logs for "session is not read-only" errors - result = run_ssh_command(host['ssh'], "sudo journalctl -u postgrest --since '5 seconds ago' | grep -i 'session is not read-only' || true") - - if result['stdout'].strip(): - print(f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}") + result = run_ssh_command( + host["ssh"], + "sudo journalctl -u postgrest --since '5 seconds ago' | grep -i 'session is not read-only' || true", + ) + + if result["stdout"].strip(): + print( + f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}" + ) assert False, "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode" else: print("\nNo 'session is not read-only' errors found in PostgREST logs") - + finally: # Restore the original configuration - result = run_ssh_command(host['ssh'], "sudo cp /etc/postgrest/base.conf.backup /etc/postgrest/base.conf") - if result['succeeded']: - result = run_ssh_command(host['ssh'], "sudo systemctl restart postgrest") - if result['succeeded']: + result = run_ssh_command( + host["ssh"], + "sudo cp /etc/postgrest/base.conf.backup /etc/postgrest/base.conf", + ) + if result["succeeded"]: + result = run_ssh_command(host["ssh"], "sudo systemctl restart postgrest") + if result["succeeded"]: print("Restored original PostgREST configuration") else: print("Warning: Failed to restart PostgREST after restoring config") else: print("Warning: Failed to restore original PostgREST configuration") - + # Restore PostgreSQL to original configuration - result = run_ssh_command(host['ssh'], f"sudo cp {config_file}.backup {config_file}") - if result['succeeded']: - result = run_ssh_command(host['ssh'], "sudo systemctl restart postgresql") - if result['succeeded']: + result = run_ssh_command( + host["ssh"], f"sudo cp {config_file}.backup {config_file}" + ) + if result["succeeded"]: + result = run_ssh_command(host["ssh"], "sudo systemctl restart postgresql") + if result["succeeded"]: print("Restored PostgreSQL to original configuration") else: print("Warning: Failed to restart PostgreSQL after restoring config") else: print("Warning: Failed to restore PostgreSQL configuration") - From fe64b086f7aa0c631cc093dcec2f6416abea2e61 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Wed, 10 Sep 2025 10:04:02 -0400 Subject: [PATCH 079/134] feat(systemd): configure the systemd pager to make debugging via journalctl easier (#1784) --- ansible/tasks/setup-system.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/tasks/setup-system.yml b/ansible/tasks/setup-system.yml index c1285bf6c..c0653811d 100644 --- a/ansible/tasks/setup-system.yml +++ b/ansible/tasks/setup-system.yml @@ -146,6 +146,16 @@ group: root when: debpkg_mode or nixpkg_mode +- name: configure systemd's pager + copy: + content: | + export SYSTEMD_LESS=FRXMK + dest: /etc/profile.d/10-systemd-pager.sh + mode: 0644 + owner: root + group: root + when: debpkg_mode or nixpkg_mode + - name: set hosts file copy: content: | From 86fe049cda880e9b2db275e488bdb81be01f516c Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 10 Sep 2025 13:47:46 -0400 Subject: [PATCH 080/134] feat: update various git-hosted runners with blacksmith runners (#1785) * feat: update various git-hosted runners with blacksmith runners adjusting size for appropriate operations on machine * fix: lower cpu for these builds * fix: we will try to lower cpu on this one too * chore: one more bump down --- .github/workflows/ami-release-nix.yml | 4 ++-- .github/workflows/dockerhub-release-matrix.yml | 2 +- .github/workflows/manual-docker-release.yml | 10 +++++----- .github/workflows/nix-build.yml | 4 ++-- .github/workflows/publish-migrations-prod.yml | 2 +- .github/workflows/publish-migrations-staging.yml | 2 +- .../publish-nix-pgupgrade-bin-flake-version.yml | 2 +- .github/workflows/publish-nix-pgupgrade-scripts.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/testinfra-ami-build.yml | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 405deeeb4..27a1c0eb1 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -17,7 +17,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-4vcpu-ubuntu-2404 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -44,7 +44,7 @@ jobs: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: large-linux-arm + - runner: blacksmith-2vcpu-ubuntu-2404-arm runs-on: ${{ matrix.runner }} timeout-minutes: 150 diff --git a/.github/workflows/dockerhub-release-matrix.yml b/.github/workflows/dockerhub-release-matrix.yml index 263b0112a..5862df8a5 100644 --- a/.github/workflows/dockerhub-release-matrix.yml +++ b/.github/workflows/dockerhub-release-matrix.yml @@ -16,7 +16,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-4vcpu-ubuntu-2404 outputs: matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} steps: diff --git a/.github/workflows/manual-docker-release.yml b/.github/workflows/manual-docker-release.yml index 3f86643ff..6cc5a396c 100644 --- a/.github/workflows/manual-docker-release.yml +++ b/.github/workflows/manual-docker-release.yml @@ -13,7 +13,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-8vcpu-ubuntu-2404 outputs: matrix_config: ${{ steps.set-matrix.outputs.matrix_config }} steps: @@ -46,7 +46,7 @@ jobs: needs: prepare strategy: matrix: ${{ fromJson(needs.prepare.outputs.matrix_config) }} - runs-on: large-linux-x86 + runs-on: blacksmith-8vcpu-ubuntu-2404 outputs: build_args: ${{ steps.args.outputs.result }} steps: @@ -72,7 +72,7 @@ jobs: matrix: postgres: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} arch: [amd64, arm64] - runs-on: ${{ matrix.arch == 'amd64' && 'large-linux-x86' || 'large-linux-arm' }} + runs-on: ${{ matrix.arch == 'amd64' && 'blacksmith-8vcpu-ubuntu-2404' || 'large-linux-arm' }} timeout-minutes: 180 steps: - name: Checkout Repo @@ -141,7 +141,7 @@ jobs: strategy: matrix: include: ${{ fromJson(needs.prepare.outputs.matrix_config).include }} - runs-on: large-linux-x86 + runs-on: blacksmith-8vcpu-ubuntu-2404 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD @@ -185,7 +185,7 @@ jobs: ${{ steps.get_version.outputs.pg_version }}_arm64 combine_results: needs: [prepare, merge_manifest] - runs-on: large-linux-x86 + runs-on: blacksmith-8vcpu-ubuntu-2404 steps: - name: Checkout Repo uses: supabase/postgres/.github/actions/shared-checkout@HEAD diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 058d9087b..c2f383961 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -20,9 +20,9 @@ jobs: fail-fast: false matrix: include: - - runner: large-linux-x86 + - runner: blacksmith-32vcpu-ubuntu-2404 arch: amd64 - - runner: large-linux-arm + - runner: blacksmith-32vcpu-ubuntu-2404-arm arch: arm64 - runner: macos-latest-xlarge arch: arm64 diff --git a/.github/workflows/publish-migrations-prod.yml b/.github/workflows/publish-migrations-prod.yml index ffb633683..81c686db7 100644 --- a/.github/workflows/publish-migrations-prod.yml +++ b/.github/workflows/publish-migrations-prod.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: large-linux-arm + runs-on: blacksmith-2vcpu-ubuntu-2404-arm timeout-minutes: 15 permissions: id-token: write diff --git a/.github/workflows/publish-migrations-staging.yml b/.github/workflows/publish-migrations-staging.yml index 7acb46d22..2ed25f84a 100644 --- a/.github/workflows/publish-migrations-staging.yml +++ b/.github/workflows/publish-migrations-staging.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: large-linux-arm + runs-on: blacksmith-2vcpu-ubuntu-2404-arm timeout-minutes: 15 permissions: id-token: write diff --git a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml index c8b3abe46..f4e71260a 100644 --- a/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml +++ b/.github/workflows/publish-nix-pgupgrade-bin-flake-version.yml @@ -12,7 +12,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-2vcpu-ubuntu-2404 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: diff --git a/.github/workflows/publish-nix-pgupgrade-scripts.yml b/.github/workflows/publish-nix-pgupgrade-scripts.yml index c58e90d83..d828e819a 100644 --- a/.github/workflows/publish-nix-pgupgrade-scripts.yml +++ b/.github/workflows/publish-nix-pgupgrade-scripts.yml @@ -19,7 +19,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-2vcpu-ubuntu-2404 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6be368784..766e50b72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-4vcpu-ubuntu-2404 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index a468b6860..0cb0cd483 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -14,7 +14,7 @@ permissions: jobs: prepare: - runs-on: large-linux-x86 + runs-on: blacksmith-2vcpu-ubuntu-2404 outputs: postgres_versions: ${{ steps.set-versions.outputs.postgres_versions }} steps: @@ -42,7 +42,7 @@ jobs: matrix: postgres_version: ${{ fromJson(needs.prepare.outputs.postgres_versions) }} include: - - runner: large-linux-arm + - runner: blacksmith-2vcpu-ubuntu-2404-arm arch: arm64 ubuntu_release: noble ubuntu_version: 24.04 From 07758cd5fd36cf12fba6f3a5845bb404f117a2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Fri, 12 Sep 2025 21:32:54 +0200 Subject: [PATCH 081/134] feat: support multiple versions of the vector extension (#1750) * feat: multiple versions for the vector extension Build multiple versions of the vector extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * chore: add release suffix for testing * fix: rebase to develop * chore: bump version for release * chore: refactor to run default nixos test --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +-- nix/ext/pgvector.nix | 100 +++++++++++++++++++++++++++++--------- nix/ext/tests/default.nix | 1 + nix/ext/versions.json | 50 +++++++++++++++++++ 4 files changed, 132 insertions(+), 25 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 011045f8a..23d447c15 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.024-orioledb" - postgres17: "17.6.1.003" - postgres15: "15.14.1.003" + postgresorioledb-17: "17.5.1.025-orioledb" + postgres17: "17.6.1.004" + postgres15: "15.14.1.004" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/pgvector.nix b/nix/ext/pgvector.nix index 60a8efea3..c49a02e71 100644 --- a/nix/ext/pgvector.nix +++ b/nix/ext/pgvector.nix @@ -1,36 +1,92 @@ { + pkgs, lib, stdenv, fetchFromGitHub, postgresql, }: +let + pname = "vector"; -stdenv.mkDerivation rec { - pname = "pgvector"; - version = "0.8.0"; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - buildInputs = [ postgresql ]; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; - src = fetchFromGitHub { - owner = "pgvector"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-JsZV+I4eRMypXTjGmjCtMBXDVpqTIPHQa28ogXncE/Q="; - }; + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); + + # Build function for individual versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "pgvector"; + repo = "pgvector"; + rev = "refs/tags/v${version}"; + inherit hash; + }; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + # Install shared library with version suffix + mv ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + # Create version-specific control file + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # Copy SQL file to install the specific version + cp sql/${pname}.sql $out/share/postgresql/extension/${pname}--${version}.sql + + # For the latest version, copy sql upgrade script, default control file and symlink + if [[ "${version}" == "${latestVersion}" ]]; then + cp sql/*.sql $out/share/postgresql/extension + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + runHook postInstall + ''; - cp *${postgresql.dlSuffix} $out/lib - cp sql/*.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension - ''; + meta = with lib; { + description = "Open-source vector similarity search for Postgres"; + homepage = "https://github.com/$%7Bsrc.owner%7D/$%7Bsrc.repo%7D"; + maintainers = with maintainers; [ olirice ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + }; +in +pkgs.buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; - meta = with lib; { - description = "Open-source vector similarity search for Postgres"; - homepage = "https://github.com/$%7Bsrc.owner%7D/$%7Bsrc.repo%7D"; - maintainers = with maintainers; [ olirice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index a346fac62..8032851f7 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -185,6 +185,7 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_net" + "vector" "wrappers" ] ) diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 6d9c5a2db..4b81c60cd 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -127,5 +127,55 @@ ], "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } + }, + "vector": { + "0.4.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-bOckX7zvHhgJDDhoAm+VZVIeVIf2hG/3oWZWuTtnZPo=" + }, + "0.5.1": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-ZNzq+dATZn9LUgeOczsaadr5hwdbt9y/+sAOPIdr77U=" + }, + "0.6.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-hXm+k0BZ9xZP1Tnek14jPoKCPQkA5ovscu9IX2mW7Kc=" + }, + "0.6.2": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-r+TpFJg6WrMn0L2B7RpmSRvw3XxpHzMRtpFWDCzLvgs=" + }, + "0.7.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-vFn7sNphOYyig6Jl1HILMaC2t9strFQBQ8ywL8Ibx1M=" + }, + "0.7.4": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-qwPaguQUdDHV8q6GDneLq5MuhVroPizpbqt7f08gKJI=" + }, + "0.8.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-JsZV+I4eRMypXTjGmjCtMBXDVpqTIPHQa28ogXncE/Q=" + } } } From 9898ced5c7e830839b3eb0d9a4dafb33133f89c7 Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 15 Sep 2025 11:54:19 -0400 Subject: [PATCH 082/134] docs: update readme and tool to generate (#1789) --- README.md | 38 ++++++++--------- nix/tools/update_readme.nu | 83 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 98 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index a176ccec5..0fa889e86 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to modify Postgres, but to provide some of the most common extensions with a one-click install. ## Primary Features -- ✅ Postgres [postgresql-15.8](https://www.postgresql.org/docs/15/index.html) -- ✅ Postgres [postgresql-17.4](https://www.postgresql.org/docs/17/index.html) -- ✅ Postgres [orioledb-postgresql-17_6](https://github.com/orioledb/orioledb) +- ✅ Postgres [postgresql-15.14](https://www.postgresql.org/docs/15/index.html) +- ✅ Postgres [postgresql-17.6](https://www.postgresql.org/docs/17/index.html) +- ✅ Postgres [orioledb-postgresql-17_11](https://github.com/orioledb/orioledb) - ✅ Ubuntu 24.04 (Noble Numbat). - ✅ [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) = logical and [max_replication_slots](https://www.postgresql.org/docs/current/runtime-config-replication.html) = 5. Ready for replication. - ✅ [Large Systems Extensions](https://github.com/aws/aws-graviton-getting-started#building-for-graviton-and-graviton2). Enabled for ARM images. @@ -15,13 +15,13 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | Extension | Version | Description | | ------------- | :-------------: | ------------- | | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | -| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | +| [index_advisor]() | [0.2.0]() | | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_cron]() | [1.6.4]() | Run Cron jobs through PostgreSQL (multi-version compatible) | | [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | | [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | -| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_net]() | [0.8.0]() | | | [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | | [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | @@ -34,28 +34,28 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | | [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | -| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [plv8](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | [3.1.10](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | V8 Engine Javascript Procedural Language add-on for PostgreSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [timescaledb-apache](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | [2.16.1](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | Scales PostgreSQL for time-series data via automatic partitioning across time and space | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | +| [vector]() | [0.8.0]() | | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | +| [wrappers]() | [0.5.4]() | | ### PostgreSQL 17 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | -| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | +| [index_advisor]() | [0.2.0]() | | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_cron]() | [1.6.4]() | Run Cron jobs through PostgreSQL (multi-version compatible) | | [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | | [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | -| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_net]() | [0.19.5]() | | | [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | | [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | @@ -68,27 +68,27 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | | [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | -| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | +| [vector]() | [0.8.0]() | | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | +| [wrappers]() | [0.5.4]() | | ### PostgreSQL orioledb-17 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | | [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | -| [index_advisor](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | [0.2.0](https://github.com/olirice/index_advisor/archive/v0.2.0.tar.gz) | Recommend indexes to improve query performance in PostgreSQL | -| [orioledb](https://github.com/orioledb/orioledb/archive/beta10.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta10.tar.gz) | orioledb | +| [index_advisor]() | [0.2.0]() | | +| [orioledb](https://github.com/orioledb/orioledb/archive/beta12.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta12.tar.gz) | orioledb | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | -| [pg_cron](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | [1.6.4](https://github.com/citusdata/pg_cron/archive/v1.6.4.tar.gz) | Run Cron jobs through PostgreSQL | +| [pg_cron]() | [1.6.4]() | Run Cron jobs through PostgreSQL (multi-version compatible) | | [pg_graphql](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | [1.5.11](https://github.com/supabase/pg_graphql/archive/v1.5.11.tar.gz) | GraphQL support for PostreSQL | | [pg_hashids](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | [cd0e1b31d52b394a0df64079406a14a4f7387cd6](https://github.com/iCyberon/pg_hashids/archive/cd0e1b31d52b394a0df64079406a14a4f7387cd6.tar.gz) | Generate short unique IDs in PostgreSQL | | [pg_jsonschema](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | [0.3.3](https://github.com/supabase/pg_jsonschema/archive/v0.3.3.tar.gz) | JSON Schema Validation for PostgreSQL | -| [pg_net](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | [0.14.0](https://github.com/supabase/pg_net/archive/refs/tags/v0.14.0.tar.gz) | Async networking for Postgres | +| [pg_net]() | [0.19.5]() | | | [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | [5081a7b5cb890876e67d8e7486b6a64c38c9a492](https://github.com/pgexperts/pg_plan_filter/archive/5081a7b5cb890876e67d8e7486b6a64c38c9a492.tar.gz) | Filter PostgreSQL statements by execution plans | | [pg_repack](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | [1.5.2](https://github.com/reorg/pg_repack/archive/ver_1.5.2.tar.gz) | Reorganize tables in PostgreSQL databases with minimal locks | | [pg_stat_monitor](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | [2.1.0](https://github.com/percona/pg_stat_monitor/archive/refs/tags/2.1.0.tar.gz) | Query Performance Monitoring Tool for PostgreSQL | @@ -101,14 +101,14 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | | [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | -| [pgvector](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | [0.8.0](https://github.com/pgvector/pgvector/archive/refs/tags/v0.8.0.tar.gz) | Open-source vector similarity search for Postgres | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | | [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | -| [supabase-wrappers](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | [0.5.0](https://github.com/supabase/wrappers/archive/v0.5.0.tar.gz) | Various Foreign Data Wrappers (FDWs) for PostreSQL | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | +| [vector]() | [0.8.0]() | | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | +| [wrappers]() | [0.5.4]() | | ## Additional Goodies *This is only available for our AWS EC2* diff --git a/nix/tools/update_readme.nu b/nix/tools/update_readme.nu index b19c266a3..0b233ebce 100755 --- a/nix/tools/update_readme.nu +++ b/nix/tools/update_readme.nu @@ -57,6 +57,55 @@ def get_src_url [pkg_attr] { } } +def get_latest_version_for_pg [ext_name, pg_info] { + # Load versions.json to get the latest version for multi-version extensions + let versions_file = ([$env.PWD "nix/ext/versions.json"] | path join) + + if not ($versions_file | path exists) { + return null + } + + let versions_data = (open $versions_file) + + # Extract the base extension name (remove -all suffix) + let base_name = if ($ext_name | str ends-with "-all") { + $ext_name | str replace "-all" "" + } else { + $ext_name + } + + # Check if this extension exists in versions.json + if not ($versions_data | columns | any {|col| $col == $base_name}) { + return null + } + + let ext_versions = ($versions_data | get $base_name) + let pg_major = $pg_info.version + + # For orioledb, use "17" as the PostgreSQL version for lookups + let pg_type = if $pg_info.is_orioledb { + "17" # Use regular PG 17 for orioledb multi-version lookups + } else { + $pg_major + } + + # Find versions that support this PostgreSQL version + let supported_versions = ($ext_versions + | transpose version info + | where {|row| + $row.info.postgresql | any {|pg| $pg == $pg_type} + } + | get version + ) + + if ($supported_versions | is-empty) { + return null + } + + # Return the latest version (last in the sorted list) + $supported_versions | sort | last +} + def get_extension_info [flake_json, pg_info] { let major_version = ($pg_info.version | split row "." | first) let version_prefix = if $pg_info.is_orioledb { @@ -76,19 +125,45 @@ def get_extension_info [flake_json, pg_info] { let all_exts = ($ext_names | each {|ext_name| let ext_info = ($sys_packages | get $ext_name) - let name = ($ext_name | str replace $version_prefix "") - let version = if $name == "orioledb" { + let raw_name = ($ext_name | str replace $version_prefix "") + + # Remove -all suffix from the display name + let display_name = if ($raw_name | str ends-with "-all") { + $raw_name | str replace "-all" "" + } else { + $raw_name + } + + # Check if this is a multi-version extension + let version = if ($raw_name | str ends-with "-all") { + let latest_ver = (get_latest_version_for_pg $raw_name $pg_info) + if $latest_ver != null { + $latest_ver + } else if $raw_name == "orioledb" { + $ext_info.name # Use name directly for orioledb + } else if ($ext_info.name | str contains "-") { + $ext_info.name | split row "-" | last + } else { + $ext_info.name + } + } else if $raw_name == "orioledb" { $ext_info.name # Use name directly for orioledb } else if ($ext_info.name | str contains "-") { $ext_info.name | split row "-" | last } else { $ext_info.name } + let src_url = (get_src_url $ext_name) + let description = if ($ext_info | columns | any {|col| $col == "description"}) { + $ext_info.description + } else { + "" # Default to empty string if description field doesn't exist + } { - name: $name, + name: $display_name, # Use the cleaned name without -all suffix version: $version, - description: $ext_info.description, + description: $description, url: $src_url } }) From 8a8fac455df4e1321e50911958bb5d0858987539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 17 Sep 2025 00:02:00 +0200 Subject: [PATCH 083/134] feat: support multiple versions of the hypopg extension (#1760) * feat(hypopg): build multiple versions of the hypopg extension Build multiple versions of the hypopg extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * chore: add release suffix for testing * chore: refactor hypopg test Reuse the common nixos test for testing PostgreSQL extensions. * chore: bump version for release --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +-- nix/ext/hypopg.nix | 98 +++++++++++++++++++++++++++++++-------- nix/ext/tests/default.nix | 1 + nix/ext/versions.json | 35 ++++++++++---- 4 files changed, 108 insertions(+), 32 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 23d447c15..a32c56d7a 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.025-orioledb" - postgres17: "17.6.1.004" - postgres15: "15.14.1.004" + postgresorioledb-17: "17.5.1.026-orioledb" + postgres17: "17.6.1.005" + postgres15: "15.14.1.005" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/hypopg.nix b/nix/ext/hypopg.nix index 1e38b11c6..28e847d46 100644 --- a/nix/ext/hypopg.nix +++ b/nix/ext/hypopg.nix @@ -1,35 +1,95 @@ { lib, stdenv, + buildEnv, fetchFromGitHub, postgresql, }: -stdenv.mkDerivation rec { +let pname = "hypopg"; - version = "1.4.1"; + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; - buildInputs = [ postgresql ]; + buildInputs = [ postgresql ]; - src = fetchFromGitHub { - owner = "HypoPG"; - repo = pname; - rev = "refs/tags/${version}"; - hash = "sha256-88uKPSnITRZ2VkelI56jZ9GWazG/Rn39QlyHKJKSKMM="; - }; + src = fetchFromGitHub { + owner = "HypoPG"; + repo = pname; + rev = "refs/tags/${version}"; + inherit hash; + }; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + mv ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + create_sql_files() { + echo "Creating SQL files for previous versions..." + if [[ "${version}" == "${latestVersion}" ]]; then + cp *.sql $out/share/postgresql/extension + fi + } + + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi + } - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + create_sql_files + create_control_files + ''; - cp *${postgresql.dlSuffix} $out/lib - cp *.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + meta = with lib; { + description = "Hypothetical Indexes for PostgreSQL"; + homepage = "https://github.com/HypoPG/$%7Bpname%7D"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + }; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); +in +buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) ''; - meta = with lib; { - description = "Hypothetical Indexes for PostgreSQL"; - homepage = "https://github.com/HypoPG/$%7Bpname%7D"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 8032851f7..afea82fc8 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -182,6 +182,7 @@ builtins.listToAttrs ( value = extTest extName; }) [ + "hypopg" "index_advisor" "pg_cron" "pg_net" diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 4b81c60cd..a5a289d45 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -1,24 +1,27 @@ { - "wrappers": { - "0.5.4": { + "index_advisor": { + "0.2.0": { "postgresql": [ "15", "17", "orioledb-17" ], - "hash": "sha256-W1RokXH4Vfj2FIuEzGEP5SzzWsv2Pbzfa816nXKnSoc=", - "pgrx": "0.14.3", - "rust": "1.87.0" + "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" } }, - "index_advisor": { - "0.2.0": { + "hypopg": { + "1.3.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-AIBXy+LxyHUo+1hd8gQTwaBdFiTEzKaCVc4cx5tZgME=" + }, + "1.4.1": { "postgresql": [ "15", - "17", - "orioledb-17" + "17" ], - "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" + "hash": "sha256-88uKPSnITRZ2VkelI56jZ9GWazG/Rn39QlyHKJKSKMM=" } }, "pg_cron": { @@ -177,5 +180,17 @@ ], "hash": "sha256-JsZV+I4eRMypXTjGmjCtMBXDVpqTIPHQa28ogXncE/Q=" } + }, + "wrappers": { + "0.5.4": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "hash": "sha256-W1RokXH4Vfj2FIuEzGEP5SzzWsv2Pbzfa816nXKnSoc=", + "pgrx": "0.14.3", + "rust": "1.87.0" + } } } From 493bd39a5e75228d34573ae3ecb010d2784e478a Mon Sep 17 00:00:00 2001 From: Chris Stockton <180184+cstockton@users.noreply.github.com> Date: Wed, 17 Sep 2025 07:48:52 -0700 Subject: [PATCH 084/134] feat: tighten gotrue.service deps and startup behavior (#1783) * systemd: tighten gotrue.service deps and startup behavior Add stronger ordering and dependency constraints to reduce startup race conditions and noisy flapping: - Wait for `cloud-init`, `supabase-admin-agent_salt`, `apparmor`, `systemd-sysctl`, and `ufw` to complete before starting. - Require `network-online.target` and `systemd-resolved` for stable DNS resolution; note Go's resolver can race with early boot DNS. - Ensure `postgresql.service` is online before starting auth to avoid misleading error noise during slow boots. - Lower `StartLimitIntervalSec` and `StartLimitBurst` to reduce repeated restarts in failure scenarios. - Switch service type to `exec` instead of `simple`. This removes the tiny window in which systemd is supervising the wrapper process instead of the Go binary. These changes aim to rule out capability changes, socket reuse races, and incomplete firewall/network config as causes of EADDRINUSE errors and unstable startup. * chore: add newline to end of file * feat: enable notify support and cleanup for v3 support. * chore: add testing suffix for local infra test * feat: add info commands for when health checks fail * fix: better approach for this test * fix: formatting I believe is why test failed * chore: add a little more log output and remove -r * chore: fmt * chore: strip deps to see if orioledb test passes * chore: restore gotrue service unit deps --------- Co-authored-by: Chris Stockton Co-authored-by: Sam Rose --- ansible/files/gotrue.service.j2 | 77 ++++++++++++++++++++++++++++++--- testinfra/test_ami_nix.py | 10 ++++- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/ansible/files/gotrue.service.j2 b/ansible/files/gotrue.service.j2 index 2478e99e6..144448cc6 100644 --- a/ansible/files/gotrue.service.j2 +++ b/ansible/files/gotrue.service.j2 @@ -1,14 +1,56 @@ [Unit] Description=Gotrue +# Avoid starting gotrue while cloud-init is running. It makes a lot of changes +# and I would like to rule out side effects of it running concurrently along +# side services. +After=cloud-init.service +Wants=cloud-init.target + +# Given the fact that auth uses SO_REUSEADDR, I want to rule out capabilities +# being modified between restarts early in boot. This plugs up the scenario that +# EADDRINUSE errors originate from a previous gotrue process starting without +# the SO_REUSEADDR flag (due to lacking capability at that point in boot proc) +# so when the next gotrue starts it can't re-use a slow releasing socket. +After=apparmor.service + +# We want sysctl's to be applied +After=systemd-sysctl.service + +# UFW Is modified by cloud init, but started non-blocking, so configuration +# could be in-flight while gotrue is starting. I want to ensure future rules +# that are relied on for security posture are applied before gotrue runs. +After=ufw.service + +# We need networking & resolution, auth uses the Go DNS resolver (not libc) +# so it's possible `localhost` resolution could be unstable early in startup. We +# care about this because SO_REUSEADDR eligibility checks the tuple +# (proto, family, addr, port) meaning the AF_INET (ipv4, ipv6) could affect the +# binding resulting in a second way for EADDRINUSE errors to surface. +# +# Note: We should consider removing localhost usage given `localhost` resolution +# can often be racey early in boot, can be difficult to debug and offers no real +# advantage in our infra. At the very least avoiding DNS resolved binding would +# be a good idea. +Wants=network-online.target systemd-resolved.service +After=network-online.target systemd-resolved.service + +# Auth server can't start unless postgres is online, lets remove a lot of auth +# server noise during slow starts by requiring it. +Wants=postgresql.service +After=postgresql.service + +# Lower start limit ival and burst to prevent the noisy flapping +StartLimitIntervalSec=10 +StartLimitBurst=5 + [Service] -Type=simple +Type=exec WorkingDirectory=/opt/gotrue -{% if qemu_mode is defined and qemu_mode %} -ExecStart=/opt/gotrue/gotrue -{% else %} + +# Both v2 & v3 need a config-dir for reloading support. ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d -{% endif %} +ExecReload=/bin/kill -10 $MAINPID User=gotrue Restart=always @@ -17,11 +59,36 @@ RestartSec=3 MemoryAccounting=true MemoryMax=50% +# These are the historical location of env files. The /etc/auth.d dir will +# override them when present. EnvironmentFile=-/etc/gotrue.generated.env EnvironmentFile=/etc/gotrue.env EnvironmentFile=-/etc/gotrue.overrides.env +# Both v2 & v3 support reloading via signals, on linux this is SIGUSR1. +Environment=GOTRUE_RELOADING_SIGNAL_ENABLED=true +Environment=GOTRUE_RELOADING_SIGNAL_NUMBER=10 + +# Both v2 & v3 disable the poller. While gotrue sets it to off by default we +# defensively set it to false here. +Environment=GOTRUE_RELOADING_POLLER_ENABLED=false + +# Determines how much idle time must pass before triggering a reload. This +# ensures only 1 reload operation occurs during a burst of config updates. +Environment=GOTRUE_RELOADING_GRACE_PERIOD_INTERVAL=2s + +{% if qemu_mode is defined and qemu_mode %} +# v3 does not use filesystem notifications for config reloads. +Environment=GOTRUE_RELOADING_NOTIFY_ENABLED=false +{% else %} +# v2 currently relies on notify support, so we will enable it until both v2 / v3 +# have migrated to strictly use signals across all projects. The default is true +# in gotrue but we will set it defensively here. +Environment=GOTRUE_RELOADING_NOTIFY_ENABLED=true +{% endif %} + Slice=services.slice [Install] WantedBy=multi-user.target + diff --git a/testinfra/test_ami_nix.py b/testinfra/test_ami_nix.py index 2325ff3d7..42442de18 100644 --- a/testinfra/test_ami_nix.py +++ b/testinfra/test_ami_nix.py @@ -374,12 +374,18 @@ def is_healthy(ssh) -> bool: try: result = run_ssh_command(ssh, command) if not result["succeeded"]: - logger.warning(f"{service} not ready") + info_text = "" + info_command = f"sudo journalctl -b -u {service} -n 20 --no-pager" + info_result = run_ssh_command(ssh, info_command) + if info_result["succeeded"]: + info_text = "\n" + info_result["stdout"].strip() + + logger.warning(f"{service} not ready{info_text}") return False + except Exception: logger.warning(f"Connection failed during {service} check") return False - return True while True: From b97ce59c98c54d82211e8d159746581afe5da86c Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Mon, 22 Sep 2025 17:14:37 +0100 Subject: [PATCH 085/134] fix: permissions fix for correct sudoers (#1797) --- ansible/tasks/internal/admin-api.yml | 2 +- ansible/tasks/internal/supabase-admin-agent.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/tasks/internal/admin-api.yml b/ansible/tasks/internal/admin-api.yml index 5844b3f54..1770433e4 100644 --- a/ansible/tasks/internal/admin-api.yml +++ b/ansible/tasks/internal/admin-api.yml @@ -21,7 +21,7 @@ copy: src: files/adminapi.sudoers.conf dest: /etc/sudoers.d/adminapi - mode: "0644" + mode: "0440" - name: perms for adminapi shell: | diff --git a/ansible/tasks/internal/supabase-admin-agent.yml b/ansible/tasks/internal/supabase-admin-agent.yml index ef5c948b5..0826462e2 100644 --- a/ansible/tasks/internal/supabase-admin-agent.yml +++ b/ansible/tasks/internal/supabase-admin-agent.yml @@ -29,7 +29,7 @@ copy: src: files/supabase_admin_agent_config/supabase-admin-agent.sudoers.conf dest: /etc/sudoers.d/supabase-admin-agent - mode: "0644" + mode: "0440" - name: Setting arch (x86) set_fact: From 20dc72e81ba4c79eb2f091664f65942114b8d501 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Tue, 23 Sep 2025 17:53:33 +0200 Subject: [PATCH 086/134] feat: multiple versions for the `timescaledb-apache` extension (#1749) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chores: opted-out nix-fast-build * chores: set up nix-github-actions * chores: comment out vestigal testinfra-ami-build * chores: use custom github runners * feat: multiple versions for the timescaledb-apache extension * feat: multiversion timescaledb * fix: refactor a bit to complete the extension * test: remove older version of integration test * fix: make sure integration tests do not run timescaledb tests on pg > 15 * test: revert to use test in nix/tests for timescale * fix: integrtion tests * Move timescaledb nixos test to nix/ext/tests * chore: bump for test * fix: need to also handle timescaledb-loader * chore: bump version for fix * fix: didn't need "loader" * chore: bump version for testing * fix: does need loader * feat: switch both timescaledb and its loader when switching versions Also reuse default tests defined in lib.py to test extension upgrade paths and switching extension versions. * chore: bump to test * fix: must symlink to timescaledb.so on switch * chore: bump for release --------- Co-authored-by: Sam Rose Co-authored-by: samrose Co-authored-by: Jean-François Roche --- ansible/vars.yml | 6 +- nix/ext/tests/lib.py | 6 +- nix/ext/tests/timescaledb.nix | 78 +++++++++++++ nix/ext/timescaledb-2.9.1.nix | 65 ----------- nix/ext/timescaledb.nix | 174 +++++++++++++++++++++------- nix/ext/versions.json | 14 +++ nix/packages/postgres.nix | 1 - nix/packages/switch-ext-version.nix | 6 + 8 files changed, 238 insertions(+), 112 deletions(-) create mode 100644 nix/ext/tests/timescaledb.nix delete mode 100644 nix/ext/timescaledb-2.9.1.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index a32c56d7a..742527b7f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.026-orioledb" - postgres17: "17.6.1.005" - postgres15: "15.14.1.005" + postgresorioledb-17: "17.5.1.027-orioledb" + postgres17: "17.6.1.006" + postgres15: "15.14.1.006" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/tests/lib.py b/nix/ext/tests/lib.py index 1e3956c9b..35c5b0e04 100644 --- a/nix/ext/tests/lib.py +++ b/nix/ext/tests/lib.py @@ -147,7 +147,7 @@ def check_switch_extension_with_background_worker( ) last_version = available_versions[-1] assert ext_version.endswith( - f"{self.extension_name}-{last_version}.so" + f"{last_version}.so" ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" # Switch to the first version @@ -157,7 +157,7 @@ def check_switch_extension_with_background_worker( # Check that we are using the first version now ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() assert ext_version.endswith( - f"{self.extension_name}-{first_version}.so" + f"{first_version}.so" ), f"Expected {self.extension_name} version {first_version}, but found {ext_version}" # Switch to the first version @@ -165,5 +165,5 @@ def check_switch_extension_with_background_worker( # Check that we are using the last version now ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() assert ext_version.endswith( - f"{self.extension_name}-{last_version}.so" + f"{last_version}.so" ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" diff --git a/nix/ext/tests/timescaledb.nix b/nix/ext/tests/timescaledb.nix new file mode 100644 index 000000000..597fe9e0d --- /dev/null +++ b/nix/ext/tests/timescaledb.nix @@ -0,0 +1,78 @@ +{ self, pkgs }: +let + pname = "timescaledb"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = (installedExtension "15").versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = "timescaledb"; + hostPkgs = pkgs; + nodes.server = + { ... }: + { + services.postgresql = { + enable = true; + package = (postgresqlWithExtension psql_15); + settings = { + shared_preload_libraries = "timescaledb"; + }; + }; + }; + testScript = + { ... }: + '' + ${builtins.readFile ./lib.py} + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}], + } + extension_name = "${pname}" + support_upgrade = True + + test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) + + with subtest("Check upgrade path with postgresql 15"): + test.check_upgrade_path("15") + + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") + ''; +} diff --git a/nix/ext/timescaledb-2.9.1.nix b/nix/ext/timescaledb-2.9.1.nix deleted file mode 100644 index 0df743671..000000000 --- a/nix/ext/timescaledb-2.9.1.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - cmake, - postgresql, - openssl, - libkrb5, -}: - -stdenv.mkDerivation rec { - pname = "timescaledb-apache"; - version = "2.9.1"; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ - postgresql - openssl - libkrb5 - ]; - - src = fetchFromGitHub { - owner = "timescale"; - repo = "timescaledb"; - rev = version; - hash = "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8="; - }; - - cmakeFlags = [ - "-DSEND_TELEMETRY_DEFAULT=OFF" - "-DREGRESS_CHECKS=OFF" - "-DTAP_CHECKS=OFF" - "-DAPACHE_ONLY=1" - ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; - - # Fix the install phase which tries to install into the pgsql extension dir, - # and cannot be manually overridden. This is rather fragile but works OK. - postPatch = '' - for x in CMakeLists.txt sql/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" - done - - for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" - done - ''; - - # timescaledb-2.9.1.so already exists in the lib directory - # we have no need for the timescaledb.so or control file - postInstall = '' - rm $out/lib/timescaledb.so - rm $out/share/postgresql/extension/timescaledb.control - ''; - - meta = with lib; { - description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; - homepage = "https://www.timescale.com/"; - changelog = "https://github.com/timescale/timescaledb/blob/$%7Bversion%7D/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.asl20; - broken = versionOlder postgresql.version "13"; - }; -} diff --git a/nix/ext/timescaledb.nix b/nix/ext/timescaledb.nix index 6f5681546..a58e8e2b4 100644 --- a/nix/ext/timescaledb.nix +++ b/nix/ext/timescaledb.nix @@ -6,53 +6,147 @@ postgresql, openssl, libkrb5, + buildEnv, + makeWrapper, + switch-ext-version, + coreutils, + writeShellApplication, }: -stdenv.mkDerivation rec { - pname = "timescaledb-apache"; - version = "2.16.1"; +let + pname = "timescaledb"; + build = + version: hash: _revision: + stdenv.mkDerivation rec { + inherit pname version; - nativeBuildInputs = [ cmake ]; - buildInputs = [ - postgresql - openssl - libkrb5 - ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ + postgresql + openssl + libkrb5 + ]; + + src = fetchFromGitHub { + owner = "timescale"; + repo = "timescaledb"; + rev = version; + inherit hash; + }; + + cmakeFlags = [ + "-DSEND_TELEMETRY_DEFAULT=OFF" + "-DREGRESS_CHECKS=OFF" + "-DTAP_CHECKS=OFF" + "-DAPACHE_ONLY=1" + ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; + + postPatch = '' + for x in CMakeLists.txt sql/CMakeLists.txt; do + if [ -f "$x" ]; then + substituteInPlace "$x" \ + --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" + fi + done + + for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do + if [ -f "$x" ]; then + substituteInPlace "$x" \ + --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" + fi + done + ''; + + installPhase = '' + # Run cmake install first + cmake --install . --prefix=$out + + # TimescaleDB creates two libraries: + # 1. timescaledb.so (loader) -> rename to timescaledb--loader.so + # 2. timescaledb-.so (actual extension) -> keep as is + + # Rename the loader library to be version-specific + if [ -f $out/lib/timescaledb${postgresql.dlSuffix} ]; then + mv $out/lib/timescaledb${postgresql.dlSuffix} $out/lib/timescaledb-loader-${version}${postgresql.dlSuffix} + fi - src = fetchFromGitHub { - owner = "timescale"; - repo = "timescaledb"; - rev = version; - hash = "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w="; + # The versioned library (timescaledb-VERSION.so) is already correctly named + + # Create versioned control file with default_version removed and module_pathname pointing to symlink + if [ -f $out/share/postgresql/extension/timescaledb.control ]; then + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/timescaledb'|" \ + $out/share/postgresql/extension/timescaledb.control > $out/share/postgresql/extension/timescaledb--${version}.control + rm $out/share/postgresql/extension/timescaledb.control + fi + ''; + + meta = with lib; { + description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; + homepage = "https://www.timescale.com/"; + changelog = "https://github.com/timescale/timescaledb/blob/$%7Bversion%7D/CHANGELOG.md"; + license = licenses.asl20; + inherit (postgresql.meta) platforms; + }; + }; + + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).timescaledb; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash (value.revision or name)) supportedVersions + ); + switch-timescaledb-loader = writeShellApplication { + name = "switch_timescaledb_loader"; + runtimeInputs = [ coreutils ]; + text = '' + EXT_LOADER_TO_USE="$EXT_WRAPPER_LIB/$EXT_NAME-loader-$VERSION${postgresql.dlSuffix}" + if [ -f "$EXT_LOADER_TO_USE" ]; then + ln -sfnv "$EXT_LOADER_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" + fi + ''; }; +in +buildEnv { + name = pname; + paths = packages; + nativeBuildInputs = [ makeWrapper ]; + postBuild = '' + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + + # Create symlink from the latest versioned loader to timescaledb.so + ln -sfn ${pname}-loader-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} - cmakeFlags = [ - "-DSEND_TELEMETRY_DEFAULT=OFF" - "-DREGRESS_CHECKS=OFF" - "-DTAP_CHECKS=OFF" - "-DAPACHE_ONLY=1" - ] ++ lib.optionals stdenv.isDarwin [ "-DLINTER=OFF" ]; - - # Fix the install phase which tries to install into the pgsql extension dir, - # and cannot be manually overridden. This is rather fragile but works OK. - postPatch = '' - for x in CMakeLists.txt sql/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION "''${PG_SHAREDIR}/extension"' "DESTINATION \"$out/share/postgresql/extension\"" - done - - for x in src/CMakeLists.txt src/loader/CMakeLists.txt tsl/src/CMakeLists.txt; do - substituteInPlace "$x" \ - --replace 'DESTINATION ''${PG_PKGLIBDIR}' "DESTINATION \"$out/lib\"" - done + # The versioned extension libraries (timescaledb-VERSION.so) are already in place + + # checks - we should have loader files and versioned extension files + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" -gt 0 + ) + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_timescaledb_version \ + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" --prefix EXTRA_STEPS : ${lib.getExe switch-timescaledb-loader} ''; - meta = with lib; { - description = "Scales PostgreSQL for time-series data via automatic partitioning across time and space"; - homepage = "https://www.timescale.com/"; - changelog = "https://github.com/timescale/timescaledb/blob/$%7Bversion%7D/CHANGELOG.md"; - platforms = postgresql.meta.platforms; - license = licenses.asl20; - broken = versionOlder postgresql.version "13"; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + + passthru = { + inherit versions numberOfVersions switch-ext-version; + pname = "${pname}-all"; + hasBackgroundWorker = true; + defaultSettings = { + shared_preload_libraries = [ "timescaledb" ]; + }; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/versions.json b/nix/ext/versions.json index a5a289d45..756acb2b3 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -130,6 +130,20 @@ ], "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } + }, + "timescaledb": { + "2.9.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-fvVSxDiGZAewyuQ2vZDb0I6tmlDXl6trjZp8+qDBtb8=" + }, + "2.16.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-sLxWdBmih9mgiO51zLLxn9uwJVYc5JVHJjSWoADoJ+w=" + } }, "vector": { "0.4.0": { diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index f8795476e..54c674775 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -19,7 +19,6 @@ ourExtensions = [ ../ext/rum.nix ../ext/timescaledb.nix - ../ext/timescaledb-2.9.1.nix ../ext/pgroonga.nix ../ext/index_advisor.nix ../ext/wal2json.nix diff --git a/nix/packages/switch-ext-version.nix b/nix/packages/switch-ext-version.nix index 1b0354a26..e3d211bbb 100644 --- a/nix/packages/switch-ext-version.nix +++ b/nix/packages/switch-ext-version.nix @@ -54,6 +54,12 @@ writeShellApplication { # Update library symlink ln -sfnv "$EXT_LIB_TO_USE" "$EXT_WRAPPER_LIB/$EXT_NAME${postgresql.dlSuffix}" + # Handle extension specific steps + if [ -x "''${EXTRA_STEPS:-}" ]; then + #shellcheck disable=SC1090 + source "''${EXTRA_STEPS}" + fi + # Update control file EXT_WRAPPER_SHARE="$EXT_WRAPPER/share/postgresql/extension" echo "default_version = '$VERSION'" > "$EXT_WRAPPER_SHARE/$EXT_NAME.control" From c6002c4c1e9e9856973074b79c3e80c9d51314ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 24 Sep 2025 04:04:40 +0200 Subject: [PATCH 087/134] feat: support multiple versions of the rum extension (#1692) * feat: support multiple versions of the rum extension Build multiple versions of the rum extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * feat: multiversion rum * chore: bump for test * chore: bump to release --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +-- nix/checks.nix | 2 +- nix/ext/rum.nix | 107 ++++++++++++++++++++++++++++++++++-------- nix/ext/versions.json | 10 ++++ 4 files changed, 101 insertions(+), 24 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 742527b7f..e5bf6bf78 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.027-orioledb" - postgres17: "17.6.1.006" - postgres15: "15.14.1.006" + postgresorioledb-17: "17.5.1.028-orioledb" + postgres17: "17.6.1.007" + postgres15: "15.14.1.007" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/checks.nix b/nix/checks.nix index 7e791b253..d6d3aa59f 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -27,7 +27,7 @@ pgpkg: let pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP; - pg_regress = self'.packages.pg_regress; + inherit (self'.packages) pg_regress; getkey-script = pkgs.stdenv.mkDerivation { name = "pgsodium-getkey"; buildCommand = '' diff --git a/nix/ext/rum.nix b/nix/ext/rum.nix index 9dc5d9525..f0839241f 100644 --- a/nix/ext/rum.nix +++ b/nix/ext/rum.nix @@ -3,33 +3,100 @@ stdenv, fetchFromGitHub, postgresql, + buildEnv, }: - -stdenv.mkDerivation rec { +let pname = "rum"; - version = "1.3.14"; - src = fetchFromGitHub { - owner = "postgrespro"; - repo = "rum"; - rev = version; - hash = "sha256-VsfpxQqRBu9bIAP+TfMRXd+B3hSjuhU2NsutocNiCt8="; - }; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; + + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash value.revision) supportedVersions + ); + + # Build function for individual versions + build = + version: hash: revision: + stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "postgrespro"; + repo = "rum"; + rev = revision; + inherit hash; + }; + + buildInputs = [ postgresql ]; + + makeFlags = [ "USE_PGXS=1" ]; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + # Install shared library with version suffix + mv ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + # Create version-specific control file + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}-${version}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # For the latest version, create default control file and symlink and copy SQL upgrade scripts + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${version}'" + cat $out/share/postgresql/extension/${pname}--${version}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + cp *.sql $out/share/postgresql/extension + fi + ''; + + meta = with lib; { + description = "Full text search index method for PostgreSQL"; + homepage = "https://github.com/postgrespro/rum"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + }; +in +buildEnv { + name = pname; + paths = packages; - buildInputs = [ postgresql ]; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; - makeFlags = [ "USE_PGXS=1" ]; + postBuild = '' + # Verify all expected library files are present + expectedFiles=${toString (numberOfVersions + 1)} + actualFiles=$(ls -l $out/lib/${pname}*${postgresql.dlSuffix} | wc -l) - installPhase = '' - install -D -t $out/lib *${postgresql.dlSuffix} - install -D -t $out/share/postgresql/extension *.control - install -D -t $out/share/postgresql/extension *.sql + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/*${postgresql.dlSuffix} || true + exit 1 + fi ''; - meta = with lib; { - description = "Full text search index method for PostgreSQL"; - homepage = "https://github.com/postgrespro/rum"; - license = licenses.postgresql; - platforms = postgresql.meta.platforms; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 756acb2b3..81c2fb706 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -130,6 +130,16 @@ ], "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } + }, + "rum": { + "1.3": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-VsfpxQqRBu9bIAP+TfMRXd+B3hSjuhU2NsutocNiCt8=", + "revision": "1.3.14" + } }, "timescaledb": { "2.9.1": { From dd54146a1153a12fbb7667bccf739e081f506a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 24 Sep 2025 18:52:52 +0200 Subject: [PATCH 088/134] feat: multiple versions for the pgsodium extension (#1660) * feat: multiple versions for the pgsodium extension Build multiple versions of the pgsodium extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * fix: cleanup after rebase * feat: multiversion pgsodium * fix: update package name in test * chore: bump version for release --------- Co-authored-by: Sam Rose Co-authored-by: samrose --- ansible/vars.yml | 6 +- nix/ext/pgsodium.nix | 118 +++++++++++++++++++++------ nix/ext/tests/pgsodium.nix | 158 +++++++++++++++++++++++++++++++++++++ nix/ext/versions.json | 39 ++++++++- 4 files changed, 293 insertions(+), 28 deletions(-) create mode 100644 nix/ext/tests/pgsodium.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index e5bf6bf78..e7e15a78d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.028-orioledb" - postgres17: "17.6.1.007" - postgres15: "15.14.1.007" + postgresorioledb-17: "17.5.1.029" + postgres17: "17.6.1.008" + postgres15: "15.14.1.008" # Non Postgres Extensions pgbouncer_release: "1.19.0" diff --git a/nix/ext/pgsodium.nix b/nix/ext/pgsodium.nix index d843d434f..5c8b07df6 100644 --- a/nix/ext/pgsodium.nix +++ b/nix/ext/pgsodium.nix @@ -1,39 +1,109 @@ { + pkgs, lib, stdenv, fetchFromGitHub, - libsodium, postgresql, + libsodium, }: - -stdenv.mkDerivation rec { +let pname = "pgsodium"; - version = "3.1.8"; - buildInputs = [ - libsodium - postgresql - ]; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - src = fetchFromGitHub { - owner = "michelp"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4="; - }; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); + + # Build function for individual pgsodium versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + + buildInputs = [ + libsodium + postgresql + ]; + + src = fetchFromGitHub { + owner = "michelp"; + repo = pname; + rev = "refs/tags/v${version}"; + inherit hash; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{lib,share/postgresql/extension} + + # Install shared library with version suffix + mv ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + # Create version-specific control file + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # For the latest version, create default control file and symlink + if [[ "${version}" == "${latestVersion}" ]]; then + # sql/pgsodium--3.1.5--3.1.6.sql isn't a proper upgrade sql file + cp sql/pgsodium--3.1.4--3.1.5.sql sql/pgsodium--3.1.5--3.1.6.sql + cp sql/*.sql $out/share/postgresql/extension + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi + + runHook postInstall + ''; + + meta = with lib; { + description = "Modern cryptography for PostgreSQL"; + homepage = "https://github.com/michelp/$%7Bpname%7D"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + }; +in +pkgs.buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + postBuild = '' + # Verify all expected library files are present + expectedFiles=${toString (numberOfVersions + 1)} + actualFiles=$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l) - cp *${postgresql.dlSuffix} $out/lib - cp sql/*.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/${pname}*${postgresql.dlSuffix} || true + exit 1 + fi ''; - meta = with lib; { - description = "Modern cryptography for PostgreSQL"; - homepage = "https://github.com/michelp/$%7Bpname%7D"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/pgsodium.nix b/nix/ext/tests/pgsodium.nix new file mode 100644 index 000000000..9ad1aec4b --- /dev/null +++ b/nix/ext/tests/pgsodium.nix @@ -0,0 +1,158 @@ +{ self, pkgs }: +let + pname = "pgsodium"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + self.packages.${pkgs.system}."psql_${majorVersion}/exts/hypopg-all" + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + pgsodiumGetKey = lib.getExe ( + pkgs.writeShellScriptBin "pgsodium-getkey" '' + echo 0000000000000000000000000000000000000000000000000000000000000000 + '' + ); +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + settings = { + "shared_preload_libraries" = pname; + "pgsodium.getkey_script" = pgsodiumGetKey; + }; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + echo "shared_preload_libraries = '${pname}'" >> "${newDataDir}/postgresql.conf" + echo "pgsodium.getkey_script = '${pgsodiumGetKey}'" >> "${newDataDir}/postgresql.conf"; + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(pg_version): + with subtest("Check ${pname} upgrade path"): + firstVersion = versions[pg_version][0] + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") + run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" + for version in versions[pg_version][1:]: + run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path("15") + + with subtest("Check ${pname} latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["15"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + with subtest("switch to postgresql 17"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + check_upgrade_path("17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 81c2fb706..7fc75a7f8 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -131,7 +131,44 @@ "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } }, - "rum": { + "pgsodium": { + "3.0.4": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-GbUUkSbQe05x7JssSyCdMrP6Uk9ix0JmO+JB1MsFMSg=" + }, + "3.1.5": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-Rv7y0gPEDHeZ+KLD+M/pUQI8Ye5GdaV144Xq05z29Sk=" + }, + "3.1.6": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-D07r/yF50JNihvG/0X7R+1bXnlK1z0dt+/Xbic6W1Hs=" + }, + "3.1.7": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-0QOh21kKtoM1L38pvkVumr4dyMdINaaMLI6z1RE8540=" + }, + "3.1.8": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4=" + } + }, + "rum": { "1.3": { "postgresql": [ "15", From 1d68e3b771259c339d516f92395fc154e57e8ae5 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Wed, 24 Sep 2025 12:28:17 +0800 Subject: [PATCH 089/134] feat: supply a slightly different supabase-admin-agent configuration for qemu artifacts --- .../supabase-admin-agent_salt.service | 6 ++++++ .../supabase-admin-agent_salt.timer.j2 | 10 +++++++++- ansible/qemu-vars.yaml | 1 + ansible/tasks/internal/supabase-admin-agent.yml | 7 +++++++ ansible/vars.yml | 8 ++++---- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 6 ++++-- 6 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 ansible/qemu-vars.yaml diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service index 969a588e6..948c65e45 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service @@ -6,9 +6,15 @@ Requires=local-fs.target [Service] Type=oneshot +{% if qemu_mode is defined and qemu_mode %} +ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result --salt-archive configmainv3-main.tar.gz +User=root +Group=root +{% else %} ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result User=supabase-admin-agent Group=supabase-admin-agent +{% endif %} StandardOutput=journal StandardError=journal StateDirectory=supabase-admin-agent diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 index 1c59cdc7c..390e6da57 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.timer.j2 @@ -3,11 +3,19 @@ Description=Run Supabase supabase-admin-agent salt on a schedule Requires=supabase-admin-agent_salt.service [Timer] +{# We're using a significantly lower frequency for triggering this agent on qemu images for the moment. Once we've performed additional validations re: the aggregate impact of running it more frequently, the frequency can be increased. #} +{% if qemu_mode is defined and qemu_mode %} +OnCalendar=*-*-* 0,6,12,18:00:00 +RandomizedDelaySec={{ supabase_admin_agent_splay }} +AccuracySec=1h +OnBootSec=5m +Persistent=true +{% else %} OnCalendar=*:0/10 -# Random delay up to {{ supabase_admin_agent_splay }} seconds splay RandomizedDelaySec={{ supabase_admin_agent_splay }} AccuracySec=1s Persistent=true +{% endif %} [Install] WantedBy=timers.target diff --git a/ansible/qemu-vars.yaml b/ansible/qemu-vars.yaml new file mode 100644 index 000000000..ad06a2a01 --- /dev/null +++ b/ansible/qemu-vars.yaml @@ -0,0 +1 @@ +supabase_admin_agent_splay_secs: 2h diff --git a/ansible/tasks/internal/supabase-admin-agent.yml b/ansible/tasks/internal/supabase-admin-agent.yml index 0826462e2..39756b674 100644 --- a/ansible/tasks/internal/supabase-admin-agent.yml +++ b/ansible/tasks/internal/supabase-admin-agent.yml @@ -41,6 +41,13 @@ arch: "arm64" when: platform == "arm64" +- name: install gpg explicitly for qemu artifacts + become: yes + apt: + pkg: + - gpg + when: qemu_mode is defined + - name: Download supabase-admin-agent archive get_url: url: "https://supabase-public-artifacts-bucket.s3.amazonaws.com/supabase-admin-agent/v%7B%7B%20supabase_admin_agent_release%20%7D%7D/supabase-admin-agent-%7B%7B%20supabase_admin_agent_release%20%7D%7D-linux-%7B%7B%20arch%20%7D%7D.tar.gz" diff --git a/ansible/vars.yml b/ansible/vars.yml index e7e15a78d..42778a185 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -9,9 +9,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.029" - postgres17: "17.6.1.008" - postgres15: "15.14.1.008" + postgresorioledb-17: "17.5.1.030-orioledb" + postgres17: "17.6.1.009" + postgres15: "15.14.1.009" # Non Postgres Extensions pgbouncer_release: "1.19.0" @@ -55,7 +55,7 @@ postgres_exporter_release_checksum: adminapi_release: 0.92.1 adminmgr_release: 0.32.1 supabase_admin_agent_release: 1.4.38 -supabase_admin_agent_splay: 30 +supabase_admin_agent_splay: 30s vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" vector_arm_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb" diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index e74617801..81bd13229 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -39,7 +39,8 @@ EOF --extra-vars "postgresql_version=postgresql_${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \ - --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" + --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \ + --extra-vars @./ansible/qemu-vars.yml } function setup_postgesql_env { @@ -101,7 +102,8 @@ EOF --extra-vars "postgresql_version=postgresql_${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \ - --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" + --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \ + --extra-vars @./ansible/qemu-vars.yml } function clean_legacy_things { From 9a4fbfdc28fb8d967d1b4582431e8ed98db4a3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 25 Sep 2025 22:41:39 +0200 Subject: [PATCH 090/134] feat: support multiple versions of the http extension (#1664) * feat: support multiple versions of the http extension Build multiple versions of the http extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * feat: http multiversion extension and pg_regress tests * chore: bump to test * tests: local mock http server for http regress tests * fix: a better way to handle http server for tests * chore: bump to release --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 25 +-- nix/checks.nix | 46 ++++++ nix/ext/pgsql-http.nix | 118 +++++++++++--- nix/ext/tests/http.nix | 154 ++++++++++++++++++ nix/ext/versions.json | 25 ++- nix/packages/default.nix | 1 + nix/packages/http-mock-server.nix | 35 ++++ nix/tests/expected/http.out | 105 ++++++++++++ nix/tests/expected/z_17_rum.out | 41 +++++ nix/tests/http-mock-server.py | 259 ++++++++++++++++++++++++++++++ nix/tests/sql/http.sql | 65 ++++++++ nix/tests/sql/z_17_rum.sql | 40 +++++ 12 files changed, 873 insertions(+), 41 deletions(-) create mode 100644 nix/ext/tests/http.nix create mode 100644 nix/packages/http-mock-server.nix create mode 100644 nix/tests/expected/http.out create mode 100644 nix/tests/expected/z_17_rum.out create mode 100644 nix/tests/http-mock-server.py create mode 100644 nix/tests/sql/http.sql create mode 100644 nix/tests/sql/z_17_rum.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index e7e15a78d..0fd92cab1 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -1,3 +1,4 @@ +--- supabase_internal: true ebssurrogate_mode: true async_mode: true @@ -5,33 +6,33 @@ async_mode: true postgres_major: - "15" - "17" - - "orioledb-17" + - orioledb-17 # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.029" - postgres17: "17.6.1.008" - postgres15: "15.14.1.008" + postgresorioledb-17: 17.5.1.030-orioledb + postgres17: 17.6.1.009 + postgres15: 15.14.1.009 # Non Postgres Extensions -pgbouncer_release: "1.19.0" +pgbouncer_release: 1.19.0 pgbouncer_release_checksum: sha256:af0b05e97d0e1fd9ad45fe00ea6d2a934c63075f67f7e2ccef2ca59e3d8ce682 # The checksum can be found under "Assets", in the GitHub release page for each version. # The binaries used are: ubuntu-aarch64 and linux-static. # https://github.com/PostgREST/postgrest/releases -postgrest_release: "13.0.5" +postgrest_release: 13.0.5 postgrest_arm_release_checksum: sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4 postgrest_x86_release_checksum: sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5 gotrue_release: 2.179.0 gotrue_release_checksum: sha1:e985fce00b2720b747e6a04420910015c4967121 -aws_cli_release: "2.23.11" +aws_cli_release: 2.23.11 salt_minion_version: 3007 -golang_version: "1.22.11" +golang_version: 1.22.11 golang_version_checksum: arm64: sha256:0fc88d966d33896384fbde56e9a8d80a305dc17a9f48f1832e061724b1719991 amd64: sha256:9ebfcab26801fa4cf0627c6439db7a4da4d3c6766142a3dd83508240e4f21031 @@ -52,10 +53,10 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.92.1 -adminmgr_release: 0.32.1 +adminapi_release: "0.92.1" +adminmgr_release: "0.32.1" supabase_admin_agent_release: 1.4.38 supabase_admin_agent_splay: 30 -vector_x86_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb" -vector_arm_deb: "https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb" +vector_x86_deb: https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_amd64.deb +vector_arm_deb: https://packages.timber.io/vector/0.48.X/vector_0.48.0-1_arm64.deb diff --git a/nix/checks.nix b/nix/checks.nix index d6d3aa59f..74b50a84f 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -163,11 +163,43 @@ which getkey-script supabase-groonga + python3 + netcat ]; } '' set -e + # Start HTTP mock server for http extension tests + # Use a build-specific directory for coordination + BUILD_TMP=$(mktemp -d) + HTTP_MOCK_PORT_FILE="$BUILD_TMP/http-mock-port" + + echo "Starting HTTP mock server (will find free port)..." + HTTP_MOCK_PORT_FILE="$HTTP_MOCK_PORT_FILE" ${pkgs.python3}/bin/python3 ${./tests/http-mock-server.py} & + HTTP_MOCK_PID=$! + + # Clean up on exit + trap "kill $HTTP_MOCK_PID 2>/dev/null || true; rm -rf '$BUILD_TMP'" EXIT + + # Wait for server to start and write port file + for i in {1..10}; do + if [ -f "$HTTP_MOCK_PORT_FILE" ]; then + HTTP_MOCK_PORT=$(cat "$HTTP_MOCK_PORT_FILE") + echo "HTTP mock server started on port $HTTP_MOCK_PORT" + break + fi + sleep 1 + done + + if [ ! -f "$HTTP_MOCK_PORT_FILE" ]; then + echo "Failed to start HTTP mock server" + exit 1 + fi + + # Export the port for use in SQL tests + export HTTP_MOCK_PORT + #First we need to create a generic pg cluster for pgtap tests and run those export GRN_PLUGINS_DIR=${pkgs.supabase-groonga}/lib/groonga/plugins PGTAP_CLUSTER=$(mktemp -d) @@ -228,6 +260,13 @@ pg_ctl -D "$PGTAP_CLUSTER" stop exit 1 fi + + # Create a table to store test configuration + psql -p ${pgPort} -h ${self.supabase.defaults.host} --username=supabase_admin -d testing -c " + CREATE TABLE IF NOT EXISTS test_config (key TEXT PRIMARY KEY, value TEXT); + INSERT INTO test_config (key, value) VALUES ('http_mock_port', '$HTTP_MOCK_PORT') + ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value; + " SORTED_DIR=$(mktemp -d) for t in $(printf "%s\n" ${builtins.concatStringsSep " " sortedTestList}); do psql -p ${pgPort} -h ${self.supabase.defaults.host} --username=supabase_admin -d testing -f "${./tests/sql}/$t.sql" || true @@ -261,6 +300,13 @@ exit 1 fi + # Create a table to store test configuration for pg_regress tests + psql -p ${pgPort} -h ${self.supabase.defaults.host} --no-password --username=supabase_admin -d postgres -c " + CREATE TABLE IF NOT EXISTS test_config (key TEXT PRIMARY KEY, value TEXT); + INSERT INTO test_config (key, value) VALUES ('http_mock_port', '$HTTP_MOCK_PORT') + ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value; + " + mkdir -p $out/regression_output if ! pg_regress \ --use-existing \ diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index 9f4bae789..6b9394e55 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -1,39 +1,109 @@ { + pkgs, lib, stdenv, fetchFromGitHub, - curl, postgresql, + curl, }: +let + pname = "http"; -stdenv.mkDerivation rec { - pname = "pgsql-http"; - version = "1.6.1"; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - buildInputs = [ - curl - postgresql - ]; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; - src = fetchFromGitHub { - owner = "pramsey"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-C8eqi0q1dnshUAZjIsZFwa5FTYc7vmATF3vv2CReWPM="; - }; + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); + + # Build function for individual versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + + buildInputs = [ + curl + postgresql + ]; + + src = fetchFromGitHub { + owner = "pramsey"; + repo = "pgsql-http"; + rev = "refs/tags/v${version}"; + inherit hash; + }; + + installPhase = '' + runHook preInstall - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + mkdir -p $out/{lib,share/postgresql/extension} + + # Install versioned library + install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}--${version}${postgresql.dlSuffix} + + cp ${pname}--${version}.sql $out/share/postgresql/extension/${pname}--${version}.sql + + # Create versioned control file with modified module path + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # For the latest version, create default control file and symlink and copy SQL upgrade scripts + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${version}'" + cat $out/share/postgresql/extension/${pname}--${version}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}--${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + cp *.sql $out/share/postgresql/extension + fi + + runHook postInstall + ''; + + meta = with lib; { + description = "HTTP client for Postgres"; + homepage = "https://github.com/pramsey/$%7Bpname%7D"; + inherit (postgresql.meta) platforms; + license = licenses.postgresql; + }; + }; +in +pkgs.buildEnv { + name = pname; + paths = packages; + + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + # Verify all expected library files are present + expectedFiles=${toString (numberOfVersions + 1)} + actualFiles=$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l) - cp *${postgresql.dlSuffix} $out/lib - cp *.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/${pname}*${postgresql.dlSuffix} || true + exit 1 + fi ''; - meta = with lib; { - description = "HTTP client for Postgres"; - homepage = "https://github.com/pramsey/$%7Bpname%7D"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/http.nix b/nix/ext/tests/http.nix new file mode 100644 index 000000000..100fdcd00 --- /dev/null +++ b/nix/ext/tests/http.nix @@ -0,0 +1,154 @@ +{ self, pkgs }: +let + pname = "http"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(pg_version): + with subtest("Check ${pname} upgrade path"): + firstVersion = versions[pg_version][0] + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") + run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" + for version in versions[pg_version][1:]: + run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path("15") + + with subtest("Check ${pname} latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["15"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + with subtest("switch to postgresql 17"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check ${pname} latest extension version after upgrade"): + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["17"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + check_upgrade_path("17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 7fc75a7f8..53666e1cd 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -1,12 +1,17 @@ { - "index_advisor": { - "0.2.0": { + "http": { + "1.5": { + "postgresql": [ + "15" + ], + "hash": "sha256-+N/CXm4arRgvhglanfvO0FNOBUWV5RL8mn/9FpNvcjY=" + }, + "1.6": { "postgresql": [ "15", - "17", - "orioledb-17" + "17" ], - "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" + "hash": "sha256-C8eqi0q1dnshUAZjIsZFwa5FTYc7vmATF3vv2CReWPM=" } }, "hypopg": { @@ -24,6 +29,16 @@ "hash": "sha256-88uKPSnITRZ2VkelI56jZ9GWazG/Rn39QlyHKJKSKMM=" } }, + "index_advisor": { + "0.2.0": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" + } + }, "pg_cron": { "1.3.1": { "postgresql": [ diff --git a/nix/packages/default.nix b/nix/packages/default.nix index fca05a10a..f297c8359 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -35,6 +35,7 @@ dbmate-tool = pkgs.callPackage ./dbmate-tool.nix { inherit (self.supabase) defaults; }; docs = pkgs.callPackage ./docs.nix { }; supabase-groonga = pkgs.callPackage ./groonga { }; + http-mock-server = pkgs.callPackage ./http-mock-server.nix { }; local-infra-bootstrap = pkgs.callPackage ./local-infra-bootstrap.nix { }; migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; }; overlayfs-on-package = pkgs.callPackage ./overlayfs-on-package.nix { }; diff --git a/nix/packages/http-mock-server.nix b/nix/packages/http-mock-server.nix new file mode 100644 index 000000000..67a4af520 --- /dev/null +++ b/nix/packages/http-mock-server.nix @@ -0,0 +1,35 @@ +{ + pkgs, + lib, + stdenv, +}: + +stdenv.mkDerivation { + pname = "http-mock-server"; + version = "1.0.0"; + + src = ../tests/http-mock-server.py; + + nativeBuildInputs = with pkgs; [ + python3 + makeWrapper + ]; + + dontUnpack = true; + + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/http-mock-server.py + chmod +x $out/bin/http-mock-server.py + + # Create a wrapper script + makeWrapper ${pkgs.python3}/bin/python3 $out/bin/http-mock-server \ + --add-flags "$out/bin/http-mock-server.py" + ''; + + meta = with lib; { + description = "Simple HTTP mock server for testing"; + license = licenses.mit; + platforms = platforms.all; + }; +} diff --git a/nix/tests/expected/http.out b/nix/tests/expected/http.out new file mode 100644 index 000000000..d83488006 --- /dev/null +++ b/nix/tests/expected/http.out @@ -0,0 +1,105 @@ +-- Test for http extension +-- Basic HTTP functionality tests +-- Test basic HTTP GET request +SELECT status FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get'); + status +-------- + 200 +(1 row) + +-- Test HTTP GET with headers +SELECT status, content_type +FROM http(( + 'GET', + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers', + ARRAY[http_header('User-Agent', 'pg_http_test')], + NULL, + NULL +)::http_request); + status | content_type +--------+--------------------------------- + 200 | application/json; charset=utf-8 +(1 row) + +-- Test HTTP POST request with JSON body +SELECT status FROM http_post( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post', + '{"test": "data"}', + 'application/json' +); + status +-------- + 200 +(1 row) + +-- Test HTTP PUT request +SELECT status FROM http_put( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put', + '{"update": "data"}', + 'application/json' +); + status +-------- + 200 +(1 row) + +-- Test HTTP DELETE request +SELECT status FROM http_delete('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete'); + status +-------- + 200 +(1 row) + +-- Test HTTP PATCH request +SELECT status FROM http_patch( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch', + '{"patch": "data"}', + 'application/json' +); + status +-------- + 200 +(1 row) + +-- Test HTTP HEAD request +SELECT status FROM http_head('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get'); + status +-------- + 200 +(1 row) + +-- Test response headers parsing +WITH response AS ( + SELECT * FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain') +) +SELECT + status, + content_type, + headers IS NOT NULL as has_headers +FROM response; + status | content_type | has_headers +--------+--------------+------------- + 200 | text/plain | t +(1 row) + +-- Test timeout handling (using a delay endpoint) +-- This should complete successfully with reasonable timeout +SELECT status FROM http(( + 'GET', + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1', + ARRAY[]::http_header[], + 'application/json', + 2000 -- 2 second timeout +)::http_request); + status +-------- + 200 +(1 row) + +-- Test URL encoding +SELECT status FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123'); + status +-------- + 200 +(1 row) + diff --git a/nix/tests/expected/z_17_rum.out b/nix/tests/expected/z_17_rum.out new file mode 100644 index 000000000..1296befa7 --- /dev/null +++ b/nix/tests/expected/z_17_rum.out @@ -0,0 +1,41 @@ +/* +This extension is excluded from oriole-17 because it uses an unsupported index type +*/ +create schema v; +create table v.test_rum( + t text, + a tsvector +); +create trigger tsvectorupdate + before update or insert on v.test_rum + for each row + execute procedure + tsvector_update_trigger( + 'a', + 'pg_catalog.english', + 't' + ); +insert into v.test_rum(t) +values + ('the situation is most beautiful'), + ('it is a beautiful'), + ('it looks like a beautiful place'); +create index rumidx on v.test_rum using rum (a rum_tsvector_ops); +select + t, + round(a <=> to_tsquery('english', 'beautiful | place')) as rank +from + v.test_rum +where + a @@ to_tsquery('english', 'beautiful | place') +order by + a <=> to_tsquery('english', 'beautiful | place'); + t | rank +---------------------------------+------ + it looks like a beautiful place | 8 + the situation is most beautiful | 16 + it is a beautiful | 16 +(3 rows) + +drop schema v cascade; +NOTICE: drop cascades to table v.test_rum diff --git a/nix/tests/http-mock-server.py b/nix/tests/http-mock-server.py new file mode 100644 index 000000000..fedeb40ad --- /dev/null +++ b/nix/tests/http-mock-server.py @@ -0,0 +1,259 @@ +#!/usr/bin/env python3 +""" +Simple HTTP mock server for testing pg_http extension offline. +Mimics basic endpoints similar to httpbingo/postman-echo services. +""" + +from http.server import HTTPServer, BaseHTTPRequestHandler +import json +import urllib.parse +import time + + +class MockHTTPHandler(BaseHTTPRequestHandler): + def _send_json_response(self, status_code=200, data=None): + """Send a JSON response""" + self.send_response(status_code) + self.send_header("Content-Type", "application/json; charset=utf-8") + self.end_headers() + response_data = data or {} + self.wfile.write(json.dumps(response_data).encode("utf-8")) + + def _send_text_response( + self, status_code=200, content="", content_type="text/plain" + ): + """Send a text response""" + self.send_response(status_code) + self.send_header("Content-Type", content_type) + self.end_headers() + self.wfile.write(content.encode("utf-8")) + + def _get_request_info(self): + """Get request information""" + parsed_path = urllib.parse.urlparse(self.path) + query_params = urllib.parse.parse_qs(parsed_path.query) + + # Read body if present + content_length = int(self.headers.get("Content-Length", 0)) + body = ( + self.rfile.read(content_length).decode("utf-8") + if content_length > 0 + else "" + ) + + return { + "method": self.command, + "url": self.path, + "path": parsed_path.path, + "query": query_params, + "headers": dict(self.headers), + "body": body, + } + + def do_GET(self): + """Handle GET requests""" + request_info = self._get_request_info() + path = request_info["path"] + + if path == "/get": + response = { + "args": request_info["query"], + "headers": request_info["headers"], + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + } + self._send_json_response(200, response) + + elif path == "/headers": + response = {"headers": request_info["headers"]} + self._send_json_response(200, response) + + elif path == "/response-headers": + # Check if Content-Type is specified in query params + query_params = request_info["query"] + if "Content-Type" in query_params: + content_type = query_params["Content-Type"][0] + self._send_text_response( + 200, "Response with custom content type", content_type + ) + else: + self._send_json_response(200, {"message": "response-headers endpoint"}) + + elif path.startswith("/delay/"): + # Extract delay time from path + try: + delay = int(path.split("/delay/")[1]) + time.sleep(min(delay, 5)) # Cap at 5 seconds + self._send_json_response(200, {"delay": delay}) + except (ValueError, IndexError): + self._send_json_response(400, {"error": "Invalid delay value"}) + + elif path == "/anything" or path.startswith("/anything"): + response = { + "method": "GET", + "args": request_info["query"], + "headers": request_info["headers"], + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + "data": "", + "json": None, + } + self._send_json_response(200, response) + + else: + self._send_json_response(404, {"error": "Not found"}) + + def do_POST(self): + """Handle POST requests""" + request_info = self._get_request_info() + path = request_info["path"] + + if path == "/post": + response = { + "args": request_info["query"], + "data": request_info["body"], + "headers": request_info["headers"], + "json": None, + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + } + + # Try to parse JSON if content-type is json + if "application/json" in request_info["headers"].get("Content-Type", ""): + try: + response["json"] = json.loads(request_info["body"]) + except json.JSONDecodeError: + pass + + self._send_json_response(200, response) + else: + self._send_json_response(404, {"error": "Not found"}) + + def do_PUT(self): + """Handle PUT requests""" + request_info = self._get_request_info() + path = request_info["path"] + + if path == "/put": + response = { + "args": request_info["query"], + "data": request_info["body"], + "headers": request_info["headers"], + "json": None, + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + } + + # Try to parse JSON if content-type is json + if "application/json" in request_info["headers"].get("Content-Type", ""): + try: + response["json"] = json.loads(request_info["body"]) + except json.JSONDecodeError: + pass + + self._send_json_response(200, response) + else: + self._send_json_response(404, {"error": "Not found"}) + + def do_DELETE(self): + """Handle DELETE requests""" + request_info = self._get_request_info() + path = request_info["path"] + + if path == "/delete": + response = { + "args": request_info["query"], + "headers": request_info["headers"], + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + } + self._send_json_response(200, response) + else: + self._send_json_response(404, {"error": "Not found"}) + + def do_PATCH(self): + """Handle PATCH requests""" + request_info = self._get_request_info() + path = request_info["path"] + + if path == "/patch": + response = { + "args": request_info["query"], + "data": request_info["body"], + "headers": request_info["headers"], + "json": None, + "url": f"http://{self.headers.get(/'Host', 'localhost:8080')}{self.path}", + } + + # Try to parse JSON if content-type is json + if "application/json" in request_info["headers"].get("Content-Type", ""): + try: + response["json"] = json.loads(request_info["body"]) + except json.JSONDecodeError: + pass + + self._send_json_response(200, response) + else: + self._send_json_response(404, {"error": "Not found"}) + + def do_HEAD(self): + """Handle HEAD requests""" + path = urllib.parse.urlparse(self.path).path + + if path == "/get": + self.send_response(200) + self.send_header("Content-Type", "application/json; charset=utf-8") + self.end_headers() + else: + self.send_response(404) + self.end_headers() + + def log_message(self, format, *args): + """Suppress default logging""" + pass + + +def find_free_port(start_port=8880, end_port=8899): + """Find a free port within the given range""" + import socket + + for port in range(start_port, end_port + 1): + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + try: + s.bind(("0.0.0.0", port)) + return port + except OSError: + continue + + raise RuntimeError(f"No free port found in range {start_port}-{end_port}") + + +def run_server(port=None): + """Run the mock HTTP server""" + if port is None: + port = find_free_port() + + try: + server = HTTPServer(("0.0.0.0", port), MockHTTPHandler) + print(f"Mock HTTP server running on port {port}") + + # Write port to a file that can be read by the test environment + import os + + port_file = os.environ.get("HTTP_MOCK_PORT_FILE", "/tmp/http-mock-port") + try: + with open(port_file, "w") as f: + f.write(str(port)) + except: + pass # Ignore if we can't write the port file + + server.serve_forever() + except OSError as e: + if port is not None: + # If specific port was requested but failed, try to find a free one + print(f"Port {port} not available, finding free port...") + run_server(None) + else: + raise e + + +if __name__ == "__main__": + import sys + + port = int(sys.argv[1]) if len(sys.argv) > 1 else None + run_server(port) diff --git a/nix/tests/sql/http.sql b/nix/tests/sql/http.sql new file mode 100644 index 000000000..df80feb52 --- /dev/null +++ b/nix/tests/sql/http.sql @@ -0,0 +1,65 @@ +-- Test for http extension +-- Basic HTTP functionality tests + +-- Test basic HTTP GET request +SELECT status FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get'); + +-- Test HTTP GET with headers +SELECT status, content_type +FROM http(( + 'GET', + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/headers', + ARRAY[http_header('User-Agent', 'pg_http_test')], + NULL, + NULL +)::http_request); + +-- Test HTTP POST request with JSON body +SELECT status FROM http_post( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/post', + '{"test": "data"}', + 'application/json' +); + +-- Test HTTP PUT request +SELECT status FROM http_put( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/put', + '{"update": "data"}', + 'application/json' +); + +-- Test HTTP DELETE request +SELECT status FROM http_delete('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delete'); + +-- Test HTTP PATCH request +SELECT status FROM http_patch( + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/patch', + '{"patch": "data"}', + 'application/json' +); + +-- Test HTTP HEAD request +SELECT status FROM http_head('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/get'); + +-- Test response headers parsing +WITH response AS ( + SELECT * FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/response-headers?Content-Type=text/plain') +) +SELECT + status, + content_type, + headers IS NOT NULL as has_headers +FROM response; + +-- Test timeout handling (using a delay endpoint) +-- This should complete successfully with reasonable timeout +SELECT status FROM http(( + 'GET', + 'http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/delay/1', + ARRAY[]::http_header[], + 'application/json', + 2000 -- 2 second timeout +)::http_request); + +-- Test URL encoding +SELECT status FROM http_get('http://localhost/' || (SELECT value FROM test_config WHERE key = 'http_mock_port') || '/anything?param=value%20with%20spaces&another=123'); diff --git a/nix/tests/sql/z_17_rum.sql b/nix/tests/sql/z_17_rum.sql new file mode 100644 index 000000000..6ae945975 --- /dev/null +++ b/nix/tests/sql/z_17_rum.sql @@ -0,0 +1,40 @@ +/* +This extension is excluded from oriole-17 because it uses an unsupported index type +*/ +create schema v; + +create table v.test_rum( + t text, + a tsvector +); + +create trigger tsvectorupdate + before update or insert on v.test_rum + for each row + execute procedure + tsvector_update_trigger( + 'a', + 'pg_catalog.english', + 't' + ); + +insert into v.test_rum(t) +values + ('the situation is most beautiful'), + ('it is a beautiful'), + ('it looks like a beautiful place'); + +create index rumidx on v.test_rum using rum (a rum_tsvector_ops); + +select + t, + round(a <=> to_tsquery('english', 'beautiful | place')) as rank +from + v.test_rum +where + a @@ to_tsquery('english', 'beautiful | place') +order by + a <=> to_tsquery('english', 'beautiful | place'); + + +drop schema v cascade; From beede0b69c2e8c7e88e80dd7c59d83e66a3d6e15 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 25 Sep 2025 14:02:36 -0400 Subject: [PATCH 091/134] refactor(ansible): bring our ansible up to modern ansible-lint standards --- ansible/tasks/clean-build-dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/tasks/clean-build-dependencies.yml b/ansible/tasks/clean-build-dependencies.yml index 43ec05179..567398f5f 100644 --- a/ansible/tasks/clean-build-dependencies.yml +++ b/ansible/tasks/clean-build-dependencies.yml @@ -1,5 +1,6 @@ - name: Remove build dependencies - apt: + ansible.builtin.apt: + autoremove: true pkg: - bison - build-essential @@ -17,5 +18,4 @@ - ninja-build - patch - python2 - state: absent - autoremove: yes + state: 'absent' From c4feab7c7c8e23d09d8f8398b035ea127990482d Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 26 Sep 2025 07:02:24 +0800 Subject: [PATCH 092/134] fix: adjust the qemu vars filename --- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 4 ++-- qemu_artifact.md | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 81bd13229..0b21959c3 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -40,7 +40,7 @@ EOF --extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \ - --extra-vars @./ansible/qemu-vars.yml + --extra-vars @./ansible/qemu-vars.yaml } function setup_postgesql_env { @@ -103,7 +103,7 @@ EOF --extra-vars "postgresql_major_version=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "postgresql_major=${POSTGRES_MAJOR_VERSION}" \ --extra-vars "psql_version=psql_${POSTGRES_MAJOR_VERSION}" \ - --extra-vars @./ansible/qemu-vars.yml + --extra-vars @./ansible/qemu-vars.yaml } function clean_legacy_things { diff --git a/qemu_artifact.md b/qemu_artifact.md index 20a33f5c1..bc71d7009 100644 --- a/qemu_artifact.md +++ b/qemu_artifact.md @@ -45,11 +45,9 @@ For faster iteration, it's more convenient to build the image on an ubuntu bare- list of packages installed on the EKS to build images: ``` - apt-get install -y git emacs ripgrep vim-tiny byobu build-essential - wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list - apt-cache update - apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils awscli packer=1.11.2-1 + apt-get install -y git emacs ripgrep vim-tiny byobu build-essential unzip + curl -L "https://releases.hashicorp.com/packer/1.14.1/packer_1.14.1_linux_$(dpkg%20--print-architecture).zip" -o packer.zip && unzip packer.zip && rm -f packer.zip && sudo mv packer /usr/local/bin/ + apt-get install -y qemu-system qemu-system-arm qemu-utils qemu-efi-aarch64 libvirt-clients libvirt-daemon libqcow-utils software-properties-common git make libnbd-bin nbdkit fuse2fs cloud-image-utils ``` ### Dependencies note From 5da417f51b705182c827e5c3a12828f68eeb6e70 Mon Sep 17 00:00:00 2001 From: Div Arora Date: Fri, 26 Sep 2025 12:26:10 +0800 Subject: [PATCH 093/134] fix: templating of SAA service file --- ...t_salt.service => supabase-admin-agent_salt.service.j2} | 2 +- ansible/tasks/internal/supabase-admin-agent.yml | 4 ++-- ansible/tasks/setup-system.yml | 7 +++++++ ansible/vars.yml | 6 +++--- 4 files changed, 13 insertions(+), 6 deletions(-) rename ansible/files/supabase_admin_agent_config/{supabase-admin-agent_salt.service => supabase-admin-agent_salt.service.j2} (94%) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 similarity index 94% rename from ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service rename to ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 index 948c65e45..33b506df4 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 @@ -7,7 +7,7 @@ Requires=local-fs.target [Service] Type=oneshot {% if qemu_mode is defined and qemu_mode %} -ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result --salt-archive configmainv3-main.tar.gz +ExecStart=/opt/supabase-admin-agent/supabase-admin-agent --config /opt/supabase-admin-agent/config.yaml salt --apply --store-result --salt-archive configmanv3-main.tar.gz User=root Group=root {% else %} diff --git a/ansible/tasks/internal/supabase-admin-agent.yml b/ansible/tasks/internal/supabase-admin-agent.yml index 39756b674..0dfc4427a 100644 --- a/ansible/tasks/internal/supabase-admin-agent.yml +++ b/ansible/tasks/internal/supabase-admin-agent.yml @@ -78,8 +78,8 @@ dest: /etc/systemd/system/supabase-admin-agent_salt.timer - name: supabase-admin-agent - create salt service file - copy: - src: files/supabase_admin_agent_config/supabase-admin-agent_salt.service + template: + src: files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 dest: /etc/systemd/system/supabase-admin-agent_salt.service - name: supabase-admin-agent - reload systemd diff --git a/ansible/tasks/setup-system.yml b/ansible/tasks/setup-system.yml index c0653811d..1f8abec62 100644 --- a/ansible/tasks/setup-system.yml +++ b/ansible/tasks/setup-system.yml @@ -53,6 +53,13 @@ update_cache: yes when: debpkg_mode or nixpkg_mode +- name: Install other useful tools + apt: + pkg: + - less + update_cache: yes + when: qemu_mode is defined + - name: Configure sysstat copy: src: files/sysstat.sysstat diff --git a/ansible/vars.yml b/ansible/vars.yml index 37eb8341f..42c8cd3b5 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.031-orioledb - postgres17: 17.6.1.010 - postgres15: 15.14.1.010 + postgresorioledb-17: 17.5.1.032-orioledb + postgres17: 17.6.1.011 + postgres15: 15.14.1.011 # Non Postgres Extensions pgbouncer_release: 1.19.0 From 18473b4bc2f277637d2ea6758ab76cf8c5f698f2 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 26 Sep 2025 10:55:00 -0400 Subject: [PATCH 094/134] docs: getting started guide in README (#1805) * docs: getting started guide * docs: inline getting started into README * docs: run readme update for versions --- README.md | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 195 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 0fa889e86..204fb92dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,185 @@ -# Postgres + goodies +# Getting Started with Supabase Postgres + +This guide covers getting up and running with Supabase Postgres. After reading this guide, you will understand: + +* What Supabase Postgres provides and why you might want to use it +* How the project is organized and what each directory contains +* How to build and run Postgres with extensions locally +* The basics of working with the extension ecosystem + +--- + +## What is Supabase Postgres? + +Supabase Postgres is a batteries-included PostgreSQL distribution that provides unmodified PostgreSQL with a curated set of the most useful extensions pre-installed. Think of it as PostgreSQL with superpowers - you get the reliability and power of standard PostgreSQL, plus immediate access to extensions for tasks like: + +* Full-text search and indexing +* Geospatial data processing +* Time-series data management +* JSON validation and GraphQL support +* Cryptography and security +* Message queuing +* And much more + +The goal is simple: make it fast and easy to get started with a production-ready PostgreSQL setup without having to hunt down, compile, and configure dozens of extensions yourself. + +## Philosophy + +Supabase Postgres follows these core principles: + +1. **Unmodified PostgreSQL** - We don't fork or modify PostgreSQL itself. You get standard PostgreSQL with extensions. +2. **Curated Extensions** - We include well-maintained, production-tested extensions that solve real problems. +3. **Multi-version Support** - Currently supporting PostgreSQL 15, 17, and OrioleDB-17. +4. **Ready for Production** - Configured with sensible defaults for replication, security, and performance. +5. **Open Source** - Everything is open source and can be self-hosted. + +## Directory Structure + +Here's a comprehensive overview of the project's directory structure: + +| File/Directory | Purpose | +| -------------- | ------- | +| **nix/** | Core build system directory containing all Nix expressions for building PostgreSQL and extensions | +| nix/postgresql/ | PostgreSQL version configurations, patches, and base package definitions | +| nix/ext/ | Individual extension package definitions and build configurations | +| nix/ext/wrappers/ | Wrapper scripts and utilities for extensions | +| nix/ext/tests/ | Extension-specific test suites | +| nix/overlays/ | Nix overlays for customizing and overriding package definitions | +| nix/tools/ | Build tools, utilities, and helper scripts | +| nix/docker/ | Docker image build definitions using Nix | +| nix/tests/ | Comprehensive integration test suites for validating builds | +| nix/tests/smoke/ | Quick smoke tests for basic functionality | +| nix/tests/migrations/ | Migration and upgrade test scenarios | +| nix/tests/expected/ | Expected `pg_regress` test outputs for validation | +| nix/tests/sql/ | SQL test scripts that are run in `pg_regress` tests | +| nix/docs/ | Build system documentation | +| **ansible/** | Infrastructure as Code for server configuration and deployment of production hosted AWS AMI image | +| ansible/playbook.yml | Main Ansible playbook for PostgreSQL/PostgREST/pgbouncer/Auth server setup | +| ansible/tasks/ | Modular Ansible tasks for specific configuration steps | +| ansible/files/ | Static files, scripts, and templates used by Ansible | +| ansible/vars.yml | AMI version tracking, legacy package version tracking | +| **migrations/** | Database migration management and upgrade tools | +| migrations/db/ | Database schema migrations | +| migrations/db/migrations/ | Individual migration files | +| migrations/db/init-scripts/ | Database initialization scripts | +| migrations/tests/ | Migration testing infrastructure | +| migrations/tests/database/ | Database-specific migration tests | +| migrations/tests/storage/ | Storage-related migration tests | +| migrations/tests/extensions/ | Extension migration tests | +| **docker/** | Container definitions and Docker-related files | +| docker/nix/ | Nix-based Docker build configurations | +| Dockerfile-15 | Docker image definition for PostgreSQL 15 | +| Dockerfile-17 | Docker image definition for PostgreSQL 17 | +| **tests/** | Integration and system tests | +| testinfra/ | Infrastructure tests using pytest framework | +| tests/ | General integration test suites | +| **scripts/** | Utility scripts for development and deployment | +| **docs/** | Additional documentation, images, and resources | +| **ebssurrogate/** | AWS EBS surrogate building for AMI creation | +| **http/** | HTTP-related configurations and files | +| **rfcs/** | Request for Comments - design documents and proposals | +| **db/** | Database-related utilities and configurations | +| **.github/** | GitHub-specific configurations (Actions, templates, etc.) | +| **Root Config Files** | | +| .gitignore | Git ignore patterns | +| .envrc.recommended | Recommended environment variables for development | +| ansible.cfg | Ansible configuration | +| amazon-arm64-nix.pkr.hcl | Packer configuration for AWS ARM64 builds | +| common-nix.vars.pkr.hcl | Common Packer variables | +| development-arm.vars.pkr.hcl | ARM development environment variables | +| CONTRIBUTING.md | Contribution guidelines | +| README.md | Main project documentation | + +## Key Concepts + +### Extensions + +Extensions are the superpower of PostgreSQL. They add functionality without modifying the core database. Supabase Postgres includes dozens of pre-built extensions covering: + +* **Data Types & Validation** - pg_jsonschema, pg_hashids +* **Search & Indexing** - pgroonga, rum, hypopg +* **Geospatial** - PostGIS, pgrouting +* **Time-series** - TimescaleDB +* **Security** - pgsodium, vault, pgaudit +* **Development** - pgtap, plpgsql_check +* **And many more...** + +### Multi-version Support + +The project supports multiple PostgreSQL versions simultaneously: + +* **PostgreSQL 15** - Stable, battle-tested version +* **PostgreSQL 17** - Latest features and improvements +* **OrioleDB-17** - Experimental storage engine for PostgreSQL 17 + +Each version has its own set of compatible extensions defined in the Nix build system. + +### Build System (Nix) + +The project uses Nix as its build system, which provides: + +* **Reproducible Builds** - Same input always produces the same output +* **Declarative Configuration** - Define what you want, not how to build it +* **Dependency Management** - Automatic handling of complex dependency trees +* **Cross-platform Support** - Build for Linux, macOS, and more + +## Common Tasks + +### Building Locally + +To build PostgreSQL with extensions locally: + +```bash +# Build PostgreSQL 15 with extensions +nix build .#psql_15/bin + +# Build PostgreSQL 17 +nix build .#psql_17/bin + +# Build a specific extension +nix build .#psql_17/exts/pg_graphql +``` + +### Running Tests + +```bash +# Run all tests +nix flake check -L + +# Run specific test suite (for macos apple silicon for example) +nix build .#checks.aarch64-darwin.psql_17 -L +``` + +### Creating Docker Images + +```bash +# Build Docker image for PostgreSQL 15 +docker build -f Dockerfile-15 -t supabase-postgres:15 . + +# Build Docker image for PostgreSQL 17 +docker build -f Dockerfile-17 -t supabase-postgres:17 . +``` + +## Next Steps + +Now that you understand the basics of Supabase Postgres: + +* Check the [Installation Guide](https://github.com/supabase/postgres/wiki) for deployment options +* Explore the [Extension Documentation](#) to learn about available extensions +* Review [Contributing Guidelines](CONTRIBUTING.md) if you want to contribute +* Join the [Supabase Community](https://github.com/supabase/postgres/discussions) for questions and discussions + +## Getting Help + +* **GitHub Issues** - For bugs and feature requests +* **Discussions** - For questions and general discussion +* **Wiki** - For detailed documentation +* **Discord** - For real-time chat with the community + +--- + +This is the same PostgreSQL build that powers [Supabase](https://supabase.io), battle-tested in production by over one million projects. -Unmodified Postgres with some useful plugins. Our goal with this repo is not to modify Postgres, but to provide some of the most common extensions with a one-click install. ## Primary Features - ✅ Postgres [postgresql-15.14](https://www.postgresql.org/docs/15/index.html) @@ -14,7 +193,8 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to ### PostgreSQL 15 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | -| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [http]() | [1.6]() | | +| [hypopg]() | [1.4.1]() | | | [index_advisor]() | [0.2.0]() | | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | | [pg_cron]() | [1.6.4]() | Run Cron jobs through PostgreSQL (multi-version compatible) | @@ -31,15 +211,14 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | -| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | -| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgsodium]() | [3.1.8]() | | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [plv8](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | [3.1.10](https://github.com/plv8/plv8/archive/v3.1.10.tar.gz) | V8 Engine Javascript Procedural Language add-on for PostgreSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | -| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [rum]() | [1.3]() | | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | -| [timescaledb-apache](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | [2.16.1](https://github.com/timescale/timescaledb/archive/2.16.1.tar.gz) | Scales PostgreSQL for time-series data via automatic partitioning across time and space | +| [timescaledb]() | [2.9.1]() | | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [vector]() | [0.8.0]() | | | [wal2json](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | [2_6](https://github.com/eulerto/wal2json/archive/wal2json_2_6.tar.gz) | PostgreSQL JSON output plugin for changeset extraction | @@ -48,7 +227,8 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to ### PostgreSQL 17 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | -| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [http]() | [1.6]() | | +| [hypopg]() | [1.4.1]() | | | [index_advisor]() | [0.2.0]() | | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | | [pg_cron]() | [1.6.4]() | Run Cron jobs through PostgreSQL (multi-version compatible) | @@ -65,12 +245,11 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | -| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | -| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgsodium]() | [3.1.8]() | | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | -| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [rum]() | [1.3]() | | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [vector]() | [0.8.0]() | | @@ -80,7 +259,8 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to ### PostgreSQL orioledb-17 Extensions | Extension | Version | Description | | ------------- | :-------------: | ------------- | -| [hypopg](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | [1.4.1](https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz) | Hypothetical Indexes for PostgreSQL | +| [http]() | [1.6]() | | +| [hypopg]() | [1.4.1]() | | | [index_advisor]() | [0.2.0]() | | | [orioledb](https://github.com/orioledb/orioledb/archive/beta12.tar.gz) | [orioledb](https://github.com/orioledb/orioledb/archive/beta12.tar.gz) | orioledb | | [pg-safeupdate](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | [1.4](https://github.com/eradman/pg-safeupdate/archive/1.4.tar.gz) | A simple extension to PostgreSQL that requires criteria for UPDATE and DELETE | @@ -98,12 +278,11 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [pgmq](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | [1.4.4](https://github.com/tembo-io/pgmq/archive/v1.4.4.tar.gz) | A lightweight message queue. Like AWS SQS and RSMQ but on Postgres. | | [pgroonga](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | [3.2.5](https://packages.groonga.org/source/pgroonga/pgroonga-3.2.5.tar.gz) | A PostgreSQL extension to use Groonga as the index | | [pgrouting](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | [3.4.1](https://github.com/pgRouting/pgrouting/archive/v3.4.1.tar.gz) | A PostgreSQL/PostGIS extension that provides geospatial routing functionality | -| [pgsodium](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | [3.1.8](https://github.com/michelp/pgsodium/archive/refs/tags/v3.1.8.tar.gz) | Modern cryptography for PostgreSQL | -| [pgsql-http](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | [1.6.1](https://github.com/pramsey/pgsql-http/archive/refs/tags/v1.6.1.tar.gz) | HTTP client for Postgres | +| [pgsodium]() | [3.1.8]() | | | [pgtap](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | [1.2.0](https://github.com/theory/pgtap/archive/v1.2.0.tar.gz) | A unit testing framework for PostgreSQL | | [plpgsql-check](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | [2.7.11](https://github.com/okbob/plpgsql_check/archive/v2.7.11.tar.gz) | Linter tool for language PL/pgSQL | | [postgis](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | [3.3.7](https://download.osgeo.org/postgis/source/postgis-3.3.7.tar.gz) | Geographic Objects for PostgreSQL | -| [rum](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | [1.3.14](https://github.com/postgrespro/rum/archive/1.3.14.tar.gz) | Full text search index method for PostgreSQL | +| [rum]() | [1.3]() | | | [supautils](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | [2.9.4](https://github.com/supabase/supautils/archive/refs/tags/v2.9.4.tar.gz) | PostgreSQL extension for enhanced security | | [vault](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | [0.3.1](https://github.com/supabase/vault/archive/refs/tags/v0.3.1.tar.gz) | Store encrypted secrets in PostgreSQL | | [vector]() | [0.8.0]() | | @@ -118,6 +297,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to | [PostgREST](https://postgrest.org/en/stable/) | [v13.0.4](https://github.com/PostgREST/postgrest/releases/tag/v13.0.4) | Instantly transform your database into an RESTful API. | | [WAL-G](https://github.com/wal-g/wal-g#wal-g) | [v2.0.1](https://github.com/wal-g/wal-g/releases/tag/v2.0.1) | Tool for physical database backup and recovery. | --> + ## Install See all installation instructions in the [repo wiki](https://github.com/supabase/postgres/wiki). From f7ecf871862ae3965493beeab6aa0255d685dac3 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 26 Sep 2025 14:34:24 -0400 Subject: [PATCH 095/134] docs: small adjust (#1806) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 204fb92dc..28685b3b9 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,11 @@ Here's a comprehensive overview of the project's directory structure: | nix/postgresql/ | PostgreSQL version configurations, patches, and base package definitions | | nix/ext/ | Individual extension package definitions and build configurations | | nix/ext/wrappers/ | Wrapper scripts and utilities for extensions | -| nix/ext/tests/ | Extension-specific test suites | +| nix/ext/tests/ | Extension-specific integration test suites implemented using nixos-test| | nix/overlays/ | Nix overlays for customizing and overriding package definitions | | nix/tools/ | Build tools, utilities, and helper scripts | | nix/docker/ | Docker image build definitions using Nix | -| nix/tests/ | Comprehensive integration test suites for validating builds | +| nix/tests/ | postgres specific test suites for validating builds, including pg_regress tests | | nix/tests/smoke/ | Quick smoke tests for basic functionality | | nix/tests/migrations/ | Migration and upgrade test scenarios | | nix/tests/expected/ | Expected `pg_regress` test outputs for validation | From 7f77e52af4abde7c3381b582810bcc8e7ac1dac5 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Fri, 26 Sep 2025 14:57:52 -0400 Subject: [PATCH 096/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1804) --- ansible/tasks/finalize-ami.yml | 141 +++++++++++++++++++-------------- 1 file changed, 82 insertions(+), 59 deletions(-) diff --git a/ansible/tasks/finalize-ami.yml b/ansible/tasks/finalize-ami.yml index 7f0de3ac8..1cc729fc0 100644 --- a/ansible/tasks/finalize-ami.yml +++ b/ansible/tasks/finalize-ami.yml @@ -1,81 +1,104 @@ - name: PG logging conf - template: - src: files/postgresql_config/postgresql-csvlog.conf - dest: /etc/postgresql/logging.conf - group: postgres + ansible.builtin.template: + dest: '/etc/postgresql/logging.conf' + group: 'postgres' + src: 'files/postgresql_config/postgresql-csvlog.conf' - name: UFW - Allow SSH connections - ufw: - rule: allow - name: OpenSSH + community.general.ufw: + name: 'OpenSSH' + rule: 'allow' -- name: UFW - Allow connections to postgreSQL (5432) - ufw: - rule: allow - port: "5432" +- name: UFW - Allow SSH/PostgreSQL connections + community.general.ufw: + port: '5432' + rule: 'allow' -- name: UFW - Allow connections to postgreSQL (6543) - ufw: - rule: allow - port: "6543" +- name: UFW - Allow PgBouncer connections + community.general.ufw: + port: '6543' + rule: 'allow' tags: - install-pgbouncer -- name: UFW - Allow connections to http (80) - ufw: - rule: allow - port: http - tags: - - install-supabase-internal - -- name: UFW - Allow connections to https (443) - ufw: - rule: allow - port: https +- name: UFW - Allow HTTP/HTTPS connections + community.general.ufw: + port: "{{ port_item }}" + rule: 'allow' + loop: + - 'http' + - 'https' + loop_control: + loop_var: 'port_item' tags: - - install-supabase-internal + - install-supabase-internal - name: UFW - Deny all other incoming traffic by default - ufw: - state: enabled - policy: deny - direction: incoming + community.general.ufw: + direction: 'incoming' + policy: 'deny' + state: 'enabled' - name: Move logrotate files to /etc/logrotate.d/ - copy: - src: "files/logrotate_config/{{ item.file }}" - dest: "/etc/logrotate.d/{{ item.file }}" - mode: "0700" - owner: root + ansible.builtin.copy: + dest: "/etc/logrotate.d/{{ logrotate_item['file'] }}" + mode: '0700' + owner: 'root' + src: "files/logrotate_config/{{ logrotate_item['file'] }}" loop: - - { file: "logrotate-postgres-csv.conf" } - - { file: "logrotate-postgres.conf" } - - { file: "logrotate-walg.conf" } - - { file: "logrotate-postgres-auth.conf" } + - { file: 'logrotate-postgres.conf' } + - { file: 'logrotate-postgres-auth.conf' } + - { file: 'logrotate-postgres-csv.conf' } + - { file: 'logrotate-walg.conf' } + loop_control: + loop_var: 'logrotate_item' -- name: Ensure default Postgres logrotate config is removed - file: - path: /etc/logrotate.d/postgresql-common - state: absent +- name: Ensure default PostgreSQL logrotate config is removed + ansible.builtin.file: + path: '/etc/logrotate.d/postgresql-common' + state: 'absent' - name: Disable cron access copy: - src: files/cron.deny - dest: /etc/cron.deny + dest: '/etc/cron.deny' + src: 'files/cron.deny' + +- name: Create logrotate.timer.d overrides dir + become: true + ansible.builtin.file: + group: 'root' + mode: '0755' + owner: 'root' + path: '/etc/systemd/system/logrotate.timer.d' + state: 'directory' + +- name: Configure logrotate.timer.d overrides + become: true + community.general.ini_file: + group: 'root' + mode: '0644' + no_extra_spaces: true + option: 'OnCalendar' + owner: 'root' + path: '/etc/systemd/system/logrotate.timer.d/override.conf' + section: 'Timer' + state: 'present' + value: '*:0/5' -- name: Configure logrotation to run every hour - shell: - cmd: | - cp /usr/lib/systemd/system/logrotate.timer /etc/systemd/system/logrotate.timer - sed -i -e 's;daily;*:0/5;' /etc/systemd/system/logrotate.timer - systemctl reenable logrotate.timer - become: yes +- name: Reload systemd and start logrotate timer + become: true + ansible.builtin.systemd_service: + daemon_reload: true + enabled: true + name: 'logrotate.timer' + state: 'restarted' - name: import pgsodium_getkey script - template: - src: files/pgsodium_getkey_readonly.sh.j2 + ansible.builtin.template: dest: "{{ pg_bindir }}/pgsodium_getkey.sh" - owner: postgres - group: postgres - mode: 0700 - when: debpkg_mode or stage2_nix + group: 'postgres' + mode: '0700' + owner: 'postgres' + src: 'files/pgsodium_getkey_readonly.sh.j2' + when: + - (debpkg_mode or stage2_nix) From 6f30dc4dce7116f9213ac21ca9d1f602e3fead92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Sun, 28 Sep 2025 09:38:08 +0800 Subject: [PATCH 097/134] build: automatically cancel old tests/build on new push (#1808) Currently, whenever you push any commit to your branch, the old builds are still running and a new build is started. Once a new commit is added, the old test results no longer matter and it's just a waste of CI resources. Also reduces confusion with multiple builds running in parallel for the same branch/possibly blocking any merges. With this little change, we ensure that whenever a new commit is added, the previous build is immediately canceled/stopped and only the build (latest commit) runs. --- .github/workflows/check-shellscripts.yml | 4 ++++ .github/workflows/ci.yml | 4 ++++ .github/workflows/nix-build.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/check-shellscripts.yml b/.github/workflows/check-shellscripts.yml index aabf17413..9d1389e9e 100644 --- a/.github/workflows/check-shellscripts.yml +++ b/.github/workflows/check-shellscripts.yml @@ -7,6 +7,10 @@ on: pull_request: workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f10f5f58e..12abc8e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: check-release-version: timeout-minutes: 5 diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index c2f383961..695dc2abf 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -14,6 +14,10 @@ permissions: contents: write packages: write +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build-run-image: strategy: From c4d26b8055efbab18c9316d65aa7efad8fa68840 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Mon, 29 Sep 2025 10:52:18 -0400 Subject: [PATCH 098/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1807) --- ansible/tasks/fix-ipv6-ndisc.yml | 45 +++++++++++++++----------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/ansible/tasks/fix-ipv6-ndisc.yml b/ansible/tasks/fix-ipv6-ndisc.yml index 8953fd880..1ea01bfb4 100644 --- a/ansible/tasks/fix-ipv6-ndisc.yml +++ b/ansible/tasks/fix-ipv6-ndisc.yml @@ -1,33 +1,30 @@ --- -- name: fix Network - systemd timer file - copy: - dest: /etc/systemd/system/systemd-networkd-check-and-fix.timer - src: "files/systemd-networkd/systemd-networkd-check-and-fix.timer" - owner: root - group: root - mode: 0644 - -- name: fix Network - systemd service file - copy: - dest: /etc/systemd/system/systemd-networkd-check-and-fix.service - src: "files/systemd-networkd/systemd-networkd-check-and-fix.service" - owner: root - group: root - mode: 0644 +- name: fix Network - systemd timer and service file + ansible.builtin.copy: + dest: "/etc/systemd/system/systemd-networkd-check-and-fix.{{ network_item }}" + group: 'root' + mode: '0644' + owner: 'root' + src: "files/systemd-networkd/systemd-networkd-check-and-fix.{{ network_item }}" + loop: + - service + - timer + loop_control: + loop_var: 'network_item' - name: fix Network - detect script - copy: - dest: /usr/local/bin/systemd-networkd-check-and-fix.sh - src: "files/systemd-networkd/systemd-networkd-check-and-fix.sh" - owner: root - group: root - mode: 0700 + ansible.builtin.copy: + dest: '/usr/local/bin/systemd-networkd-check-and-fix.sh' + src: 'files/systemd-networkd/systemd-networkd-check-and-fix.sh' + owner: 'root' + group: 'root' + mode: '0700' - name: fix Network - reload systemd - systemd: + ansible.builtin.systemd_service: daemon_reload: false - name: fix Network - ensure systemd timer is installed but disabled - systemd: - name: systemd-networkd-check-and-fix.timer + ansible.builtin.systemd_service: + name: 'systemd-networkd-check-and-fix.timer' enabled: false From 77cbe8dc15e48045bb83f4d19389953aee9d32f6 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Tue, 30 Sep 2025 10:30:59 -0400 Subject: [PATCH 099/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1809) --- ansible/tasks/setup-docker.yml | 147 +++++++++++++++++---------------- 1 file changed, 77 insertions(+), 70 deletions(-) diff --git a/ansible/tasks/setup-docker.yml b/ansible/tasks/setup-docker.yml index 7b37f70cc..6a3a12cc4 100644 --- a/ansible/tasks/setup-docker.yml +++ b/ansible/tasks/setup-docker.yml @@ -1,80 +1,87 @@ -- name: Copy extension packages - copy: - src: files/extensions/ - dest: /tmp/extensions/ - when: debpkg_mode +- name: debpkg_mode actions + when: + - debpkg_mode + block: + - name: Copy extension packages + ansible.builtin.copy: + dest: '/tmp/extensions/' + src: 'files/extensions/' -# Builtin apt module does not support wildcard for deb paths -- name: Install extensions - shell: | - set -e - apt-get update - apt-get install -y --no-install-recommends /tmp/extensions/*.deb - when: debpkg_mode + - name: Install extensions + ansible.builtin.apt: + deb: "{{ deb_item }}" + force_apt_get: true + install_recommends: false + state: 'present' + update_cache: true + loop_control: + loop_var: 'deb_item' + with_fileglob: + - '/tmp/extensions/*.deb' -- name: pgsodium - determine postgres bin directory - shell: pg_config --bindir - register: pg_bindir_output - when: debpkg_mode - -- set_fact: - pg_bindir: "{{ pg_bindir_output.stdout }}" - when: debpkg_mode + - name: pgsodium - determine PostgreSQL bin directory + ansible.builtin.command: + cmd: pg_config --bindir + changed_when: false + register: 'pg_bindir_output' + + - name: store the PostgreSQL bin dir as a fact + ansible.builtin.set_fact: + pg_bindir: "{{ pg_bindir_output['stdout'] }}" -- name: pgsodium - set pgsodium.getkey_script - become: yes - lineinfile: - path: /etc/postgresql/postgresql.conf - state: present - # script is expected to be placed by finalization tasks for different target platforms - line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh' - when: debpkg_mode + - name: pgsodium - set pgsodium.getkey_script + ansible.builtin.lineinfile: + path: '/etc/postgresql/postgresql.conf' + # script is expected to be placed by finalization tasks for different target platforms + line: pgsodium.getkey_script= '{{ pg_bindir }}/pgsodium_getkey.sh' + state: 'present' + become: true -# supautils -- name: supautils - add supautils to session_preload_libraries - become: yes - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#session_preload_libraries = ''" - replace: session_preload_libraries = 'supautils' - when: debpkg_mode or stage2_nix +- name: debpkg_mode or stage2_nix actions + when: + - (debpkg_mode or stage2_nix) + block: + # supautils + - name: supautils - add supautils to session_preload_libraries + ansible.builtin.replace: + path: '/etc/postgresql/postgresql.conf' + regexp: "#session_preload_libraries = ''" + replace: "session_preload_libraries = 'supautils'" + become: true -- name: supautils - write custom supautils.conf - template: - src: "files/postgresql_config/supautils.conf.j2" - dest: /etc/postgresql-custom/supautils.conf - mode: 0664 - owner: postgres - group: postgres - when: debpkg_mode or stage2_nix + - name: supautils - write custom supautils.conf + ansible.builtin.template: + dest: '/etc/postgresql-custom/supautils.conf' + mode: '0664' + group: 'postgres' + owner: 'postgres' + src: 'files/postgresql_config/supautils.conf.j2' -- name: supautils - copy extension custom scripts - copy: - src: files/postgresql_extension_custom_scripts/ - dest: /etc/postgresql-custom/extension-custom-scripts - become: yes - when: debpkg_mode or stage2_nix + - name: supautils - copy extension custom scripts + ansible.builtin.copy: + dest: '/etc/postgresql-custom/extension-custom-scripts' + src: 'files/postgresql_extension_custom_scripts/' + become: true -- name: supautils - chown extension custom scripts - file: - mode: 0775 - owner: postgres - group: postgres - path: /etc/postgresql-custom/extension-custom-scripts - recurse: yes - become: yes - when: debpkg_mode or stage2_nix + - name: supautils - chown extension custom scripts + ansible.builtin.file: + group: 'postgres' + mode: '0775' + owner: 'postgres' + path: '/etc/postgresql-custom/extension-custom-scripts' + recurse: true + become: true -- name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf - become: yes - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#include = '/etc/postgresql-custom/supautils.conf'" - replace: "include = '/etc/postgresql-custom/supautils.conf'" - when: debpkg_mode or stage2_nix + - name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf + ansible.builtin.replace: + path: '/etc/postgresql/postgresql.conf' + regexp: "#include = '/etc/postgresql-custom/supautils.conf'" + replace: "include = '/etc/postgresql-custom/supautils.conf'" + become: true - name: Cleanup - extension packages - file: - path: /tmp/extensions - state: absent - when: debpkg_mode + ansible.builtin.file: + path: '/tmp/extensions' + state: 'absent' + when: + - debpkg_mode From bcceb7bf346a7422799ed8ef607b2b7d1f3ee9ba Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Wed, 1 Oct 2025 09:04:39 -0400 Subject: [PATCH 100/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1810) --- ansible/tasks/setup-envoy.yml | 63 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/ansible/tasks/setup-envoy.yml b/ansible/tasks/setup-envoy.yml index 9843b5546..1552393e2 100644 --- a/ansible/tasks/setup-envoy.yml +++ b/ansible/tasks/setup-envoy.yml @@ -1,60 +1,61 @@ - name: Envoy - system user ansible.builtin.user: - name: envoy + name: 'envoy' + state: 'present' - name: Envoy - download binary ansible.builtin.get_url: checksum: "{{ envoy_release_checksum }}" - dest: /opt/envoy - group: envoy - mode: u+x - owner: envoy + dest: '/opt/envoy' + group: 'envoy' + mode: '0700' + owner: 'envoy' # yamllint disable-line rule:line-length url: "https://github.com/envoyproxy/envoy/releases/download/v%7B%7B%20envoy_release%20%7D%7D/envoy-%7B%7B%20envoy_release%20%7D%7D-linux-aarch_64" - name: Envoy - download hot restarter script ansible.builtin.get_url: checksum: "{{ envoy_hot_restarter_release_checksum }}" - dest: /opt/envoy-hot-restarter.py - group: envoy - mode: u+x - owner: envoy + dest: '/opt/envoy-hot-restarter.py' + group: 'envoy' + mode: '0700' + owner: 'envoy' # yamllint disable-line rule:line-length - url: https://raw.githubusercontent.com/envoyproxy/envoy/v{{ envoy_release }}/restarter/hot-restarter.py + url: "https://raw.githubusercontent.com/envoyproxy/envoy/v%7B%7B%20envoy_release%20%7D%7D/restarter/hot-restarter.py" - name: Envoy - bump up ulimit community.general.pam_limits: - domain: envoy - limit_item: nofile - limit_type: soft - value: 4096 + domain: 'envoy' + limit_item: 'nofile' + limit_type: 'soft' + value: '4096' - name: Envoy - create script to start envoy ansible.builtin.copy: - dest: /opt/start-envoy.sh - group: envoy - mode: u+x - owner: envoy - src: files/start-envoy.sh + dest: '/opt/start-envoy.sh' + group: 'envoy' + mode: '0700' + owner: 'envoy' + src: 'files/start-envoy.sh' - name: Envoy - create configuration files ansible.builtin.copy: - dest: /etc/envoy/ - directory_mode: u=rwx,g=rwx,o=rx - group: envoy - mode: u=rw,g=rw,o=r - owner: envoy - src: files/envoy_config/ + dest: '/etc/envoy/' + directory_mode: '0775' + group: 'envoy' + mode: '0664' + owner: 'envoy' + src: 'files/envoy_config/' - name: Envoy - create service file ansible.builtin.copy: - dest: /etc/systemd/system/envoy.service - mode: u=rw,g=r,o=r - src: files/envoy.service + dest: '/etc/systemd/system/envoy.service' + mode: '0644' + src: 'files/envoy.service' - name: Envoy - disable service - ansible.builtin.systemd: + ansible.builtin.systemd_service: daemon_reload: true enabled: false - name: envoy - state: stopped + name: 'envoy' + state: 'stopped' From ea44fc53cf8f4fc84ffc0244f5fa1155b0bd1485 Mon Sep 17 00:00:00 2001 From: Tom Ashley Date: Wed, 1 Oct 2025 18:02:45 +0100 Subject: [PATCH 101/134] fix: move tmpdir for SAA to one that always exists (#1799) --- .../supabase-admin-agent_salt.service.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 index 33b506df4..344fe5b53 100644 --- a/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 +++ b/ansible/files/supabase_admin_agent_config/supabase-admin-agent_salt.service.j2 @@ -19,6 +19,8 @@ StandardOutput=journal StandardError=journal StateDirectory=supabase-admin-agent CacheDirectory=supabase-admin-agent +# set tempdir on permanent disk +Environment="TMPDIR=/var/tmp" [Install] WantedBy=multi-user.target From 6283679c0d18f7c6f8da65971e39ee7049ff5e96 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Wed, 1 Oct 2025 13:44:21 -0400 Subject: [PATCH 102/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1811) --- ansible/tasks/setup-fail2ban.yml | 125 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 64 deletions(-) diff --git a/ansible/tasks/setup-fail2ban.yml b/ansible/tasks/setup-fail2ban.yml index 7d9088d46..89c336029 100644 --- a/ansible/tasks/setup-fail2ban.yml +++ b/ansible/tasks/setup-fail2ban.yml @@ -1,73 +1,70 @@ # set default bantime to 1 hour -- name: extend bantime - become: yes - replace: - path: /etc/fail2ban/jail.conf - regexp: bantime = 10m - replace: bantime = 3600 - when: debpkg_mode or nixpkg_mode +- name: do debpkg_mode or nixpkg_mode tasks + when: + - (debpkg_mode or nixpkg_mode) + block: + - name: extend the default bantime to an hour + become: true + ansible.builtin.replace: + path: '/etc/fail2ban/jail.conf' + regexp: 'bantime = 10m' + replace: 'bantime = 3600' -- name: Configure journald - copy: - src: files/fail2ban_config/jail-ssh.conf - dest: /etc/fail2ban/jail.d/sshd.local - when: debpkg_mode or nixpkg_mode + - name: configure journald + ansible.builtin.copy: + dest: '/etc/fail2ban/jail.d/sshd.local' + src: 'files/fail2ban_config/jail-ssh.conf' -- name: configure fail2ban to use nftables - copy: - src: files/fail2ban_config/jail.local - dest: /etc/fail2ban/jail.local - when: debpkg_mode or nixpkg_mode + - name: configure fail2ban to use nftables + ansible.builtin.copy: + dest: '/etc/fail2ban/jail.local' + src: 'files/fail2ban_config/jail.local' -# postgresql -- name: import jail.d/postgresql.conf - template: - src: files/fail2ban_config/jail-postgresql.conf.j2 - dest: /etc/fail2ban/jail.d/postgresql.conf - become: yes - when: debpkg_mode or nixpkg_mode + # postgresql + - name: import jail.d/postgresql.conf + ansible.builtin.template: + dest: '/etc/fail2ban/jail.d/postgresql.conf' + src: 'files/fail2ban_config/jail-postgresql.conf.j2' + become: true -- name: import filter.d/postgresql.conf - template: - src: files/fail2ban_config/filter-postgresql.conf.j2 - dest: /etc/fail2ban/filter.d/postgresql.conf - become: yes - when: debpkg_mode or nixpkg_mode + - name: import filter.d/postgresql.conf + ansible.builtin.template: + dest: '/etc/fail2ban/filter.d/postgresql.conf' + src: 'files/fail2ban_config/filter-postgresql.conf.j2' + become: true -- name: create overrides dir - file: - state: directory - owner: root - group: root - path: /etc/systemd/system/fail2ban.service.d - mode: '0700' - when: debpkg_mode or nixpkg_mode + - name: create overrides dir + ansible.builtin.file: + group: 'root' + mode: '0700' + owner: 'root' + path: '/etc/systemd/system/fail2ban.service.d' + state: 'directory' -- name: Custom systemd overrides - copy: - src: files/fail2ban_config/fail2ban.service.conf - dest: /etc/systemd/system/fail2ban.service.d/overrides.conf - when: debpkg_mode or nixpkg_mode + - name: custom systemd overrides + ansible.builtin.copy: + dest: '/etc/systemd/system/fail2ban.service.d/overrides.conf' + src: 'files/fail2ban_config/fail2ban.service.conf' -- name: add in supabase specific ignore filters - lineinfile: - path: /etc/fail2ban/filter.d/postgresql.conf - state: present - line: "{{ item.line }}" - loop: - - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_admin".*$' } - - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_auth_admin".*$' } - - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_storage_admin".*$' } - - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""authenticator".*$' } - - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""pgbouncer".*$' } - become: yes - tags: - - install-supabase-internal - when: debpkg_mode or nixpkg_mode + - name: add in supabase specific ignore filters + ansible.builtin.lineinfile: + line: "{{ ignore_item['line'] }}" + path: /etc/fail2ban/filter.d/postgresql.conf + state: present + become: true + loop: + - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_admin".*$' } + - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_auth_admin".*$' } + - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""supabase_storage_admin".*$' } + - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""authenticator".*$' } + - { line: ' ^.*,.*,.*,.*,":.*password authentication failed for user ""pgbouncer".*$' } + loop_control: + loop_var: 'ignore_item' + tags: + - install-supabase-internal -- name: fail2ban - disable service - systemd: - name: fail2ban - enabled: no - daemon_reload: yes - when: debpkg_mode or nixpkg_mode + - name: fail2ban - disable service + ansible.builtin.systemd_service: + daemon_reload: true + enabled: false + name: 'fail2ban' From 4377de755097bb52a7e47b801a90021a48086188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20K=C4=B1l=C4=B1=C3=A7?= Date: Thu, 2 Oct 2025 15:22:43 +0200 Subject: [PATCH 103/134] feat: add retry policy for auth service routes (#1782) * feat: add retry policy for auth service routes * fix: no change for wellknown urls --- ansible/files/envoy_config/lds.supabase.yaml | 6 ++++++ ansible/files/envoy_config/lds.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ansible/files/envoy_config/lds.supabase.yaml b/ansible/files/envoy_config/lds.supabase.yaml index 6fdcb68c7..4a9a01668 100644 --- a/ansible/files/envoy_config/lds.supabase.yaml +++ b/ansible/files/envoy_config/lds.supabase.yaml @@ -259,6 +259,12 @@ resources: cluster: gotrue prefix_rewrite: / timeout: 35s + retry_policy: + retry_on: "connect-failure,refused-stream,gateway-error" + num_retries: 3 + retry_back_off: + base_interval: 1s + max_interval: 3s - match: prefix: /rest/v1/ query_parameters: diff --git a/ansible/files/envoy_config/lds.yaml b/ansible/files/envoy_config/lds.yaml index 97481c889..b5c2d6fd7 100644 --- a/ansible/files/envoy_config/lds.yaml +++ b/ansible/files/envoy_config/lds.yaml @@ -285,6 +285,12 @@ resources: cluster: gotrue prefix_rewrite: / timeout: 35s + retry_policy: + retry_on: "connect-failure,refused-stream,gateway-error" + num_retries: 3 + retry_back_off: + base_interval: 1s + max_interval: 3s - match: prefix: /rest/v1/ query_parameters: From 3eb98fd447e85f49e390d9bd29abd997201d5d51 Mon Sep 17 00:00:00 2001 From: Chris Gwilliams <517923+encima@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:40:41 +0300 Subject: [PATCH 104/134] Update pgsql-http to handle semver (#1816) * modified files to use major and minor version but pull full versions from repo * update http tests for major minor versions * chore: bump to test * chore: bump version to release * fix: replace lost text in name of checkharness * chore: also use semver with patch ver in 1.6 version --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +++--- nix/ext/pgsql-http.nix | 14 ++++++++------ nix/ext/tests/http.nix | 6 ++++-- nix/ext/versions.json | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 42c8cd3b5..6e3170cf3 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.032-orioledb - postgres17: 17.6.1.011 - postgres15: 15.14.1.011 + postgresorioledb-17: 17.5.1.033-orioledb + postgres17: 17.6.1.012 + postgres15: 15.14.1.012 # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/pgsql-http.nix b/nix/ext/pgsql-http.nix index 6b9394e55..ba669e22d 100644 --- a/nix/ext/pgsql-http.nix +++ b/nix/ext/pgsql-http.nix @@ -30,6 +30,8 @@ let version: hash: stdenv.mkDerivation rec { inherit pname version; + # Use major.minor version for filenames (e.g., 1.5 instead of 1.5.0) + fileVersion = lib.versions.majorMinor version; buildInputs = [ curl @@ -49,22 +51,22 @@ let mkdir -p $out/{lib,share/postgresql/extension} # Install versioned library - install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}--${version}${postgresql.dlSuffix} + install -Dm755 ${pname}${postgresql.dlSuffix} $out/lib/${pname}--${fileVersion}${postgresql.dlSuffix} - cp ${pname}--${version}.sql $out/share/postgresql/extension/${pname}--${version}.sql + cp ${pname}--${fileVersion}.sql $out/share/postgresql/extension/${pname}--${fileVersion}.sql # Create versioned control file with modified module path sed -e "/^default_version =/d" \ -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ - ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + ${pname}.control > $out/share/postgresql/extension/${pname}--${fileVersion}.control # For the latest version, create default control file and symlink and copy SQL upgrade scripts if [[ "${version}" == "${latestVersion}" ]]; then { - echo "default_version = '${version}'" - cat $out/share/postgresql/extension/${pname}--${version}.control + echo "default_version = '${fileVersion}'" + cat $out/share/postgresql/extension/${pname}--${fileVersion}.control } > $out/share/postgresql/extension/${pname}.control - ln -sfn ${pname}--${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + ln -sfn ${pname}--${fileVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} cp *.sql $out/share/postgresql/extension fi diff --git a/nix/ext/tests/http.nix b/nix/ext/tests/http.nix index 100fdcd00..09075c374 100644 --- a/nix/ext/tests/http.nix +++ b/nix/ext/tests/http.nix @@ -103,11 +103,13 @@ self.inputs.nixpkgs.lib.nixos.runTest { { nodes, ... }: let pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + # Convert versions to major.minor format (e.g., "1.5.0" -> "1.5") + toMajorMinor = map (v: lib.versions.majorMinor v); in '' versions = { - "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], - "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (toMajorMinor (versions "15")))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (toMajorMinor (versions "17")))}], } def run_sql(query): diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 53666e1cd..f786fc3f5 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -1,12 +1,12 @@ { "http": { - "1.5": { + "1.5.0": { "postgresql": [ "15" ], "hash": "sha256-+N/CXm4arRgvhglanfvO0FNOBUWV5RL8mn/9FpNvcjY=" }, - "1.6": { + "1.6.1": { "postgresql": [ "15", "17" From e4308280107035cf7a2590d696aed0e9713bed3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Fri, 3 Oct 2025 02:26:50 +0200 Subject: [PATCH 105/134] feat: support multiple versions of the postgis extension (#1667) * feat: support multiple versions of the postgis extension Build multiple versions of the postgis extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * chore: correct formatting * fix: symbolic linking removal * chore: bump version to retest * fix: This fix ensures that the control files reference $libdir/$ext-$MIN_MAJ_VERSION (e.g., $libdir/postgis-3.3) which matches the actual library names built with the --with-library-minor-version flag. This allows: 1. Multiple PostGIS versions to coexist (3.3.2 and 3.3.7 both use postgis-3.3.so) 2. Extensions to properly find their libraries during upgrades 3. The multi-version functionality to work correctly * chore: bump to test * fix: handling of versions --------- Co-authored-by: Sam Rose --- ansible/tasks/stage2-setup-postgres.yml | 15 +- ansible/vars.yml | 6 +- nix/ext/postgis.nix | 242 +++++++++++++++++------- nix/ext/tests/postgis.nix | 156 +++++++++++++++ nix/ext/versions.json | 14 ++ 5 files changed, 351 insertions(+), 82 deletions(-) create mode 100644 nix/ext/tests/postgis.nix diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index d3209fc04..74da50a57 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -217,19 +217,8 @@ recurse: yes when: stage2_nix -- name: Check psql_version and run postgis linking if not oriole-xx - block: - - name: Check if psql_version is psql_orioledb-17 - set_fact: - is_psql_oriole: "{{ psql_version == 'psql_orioledb-17' }}" - - - name: Recursively create symbolic links and set permissions for the contrib/postgis-* dir - shell: > - sudo mkdir -p /usr/lib/postgresql/share/postgresql/contrib && \ - sudo find /var/lib/postgresql/.nix-profile/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do sudo ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ - && chown -R postgres:postgres "/usr/lib/postgresql/share/postgresql/contrib/" - become: yes - when: stage2_nix and not is_psql_oriole +# PostGIS contrib linking removed - PostGIS doesn't install to contrib directory +# It installs extensions to /share/postgresql/extension/ which is already linked above - name: Create symbolic links from /var/lib/postgresql/.nix-profile/share/postgresql/timezonesets to /usr/lib/postgresql/share/postgresql/timeszonesets shell: >- diff --git a/ansible/vars.yml b/ansible/vars.yml index 6e3170cf3..2fc0ff36f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.033-orioledb - postgres17: 17.6.1.012 - postgres15: 15.14.1.012 + postgresorioledb-17: 17.5.1.034-orioledb + postgres17: 17.6.1.013 + postgres15: 15.14.1.013 # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/postgis.nix b/nix/ext/postgis.nix index 27a449210..6a152ef43 100644 --- a/nix/ext/postgis.nix +++ b/nix/ext/postgis.nix @@ -15,88 +15,198 @@ pcre2, nixosTests, callPackage, + buildEnv, }: let sfcgal = callPackage ./sfcgal/sfcgal.nix { }; gdal = callPackage ./gdal.nix { inherit postgresql; }; -in -stdenv.mkDerivation rec { pname = "postgis"; - version = "3.3.7"; - outputs = [ - "out" - "doc" - ]; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - src = fetchurl { - url = "https://download.osgeo.org/postgis/source/postgis-$%7Bversion%7D.tar.gz"; - sha256 = "sha256-UHJKDd5JrcJT5Z4CTYsY/va+ToU0GUPG1eHhuXTkP84="; - }; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); - buildInputs = [ - libxml2 - postgresql - geos - proj - gdal - json_c - protobufc - pcre2.dev - sfcgal - ] ++ lib.optional stdenv.isDarwin libiconv; - nativeBuildInputs = [ - perl - pkg-config + # List of C extensions to be included in the build + cExtensions = [ + "address_standardizer" + "postgis" + "postgis_raster" + "postgis_sfcgal" + "postgis_topology" ]; - dontDisableStatic = true; - env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib"; + sqlExtensions = [ + "address_standardizer_data_us" + "postgis_tiger_geocoder" + ]; - preConfigure = '' - sed -i 's@/usr/bin/file@${file}/bin/file@' configure - configureFlags="--datadir=$out/share/postgresql --datarootdir=$out/share/postgresql --bindir=$out/bin --docdir=$doc/share/doc/${pname} --with-gdalconfig=${gdal}/bin/gdal-config --with-jsondir=${json_c.dev} --disable-extension-upgrades-install --with-sfcgal" + # Build function for individual versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; - makeFlags="PERL=${perl}/bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin docdir=$doc/share/doc/${pname}" - ''; + outputs = [ + "out" + "doc" + ]; - postConfigure = '' - sed -i "s|@mkdir -p \$(DESTDIR)\$(PGSQL_BINDIR)||g ; - s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g - " \ - "raster/loader/Makefile"; - sed -i "s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g - " \ - "raster/scripts/python/Makefile"; - mkdir -p $out/bin - ln -s ${postgresql}/bin/postgres $out/bin/postgres - ''; + src = fetchurl { + url = "https://download.osgeo.org/postgis/source/postgis-$%7Bversion%7D.tar.gz"; + inherit hash; + }; - postInstall = '' - rm $out/bin/postgres - for prog in $out/bin/*; do # */ - ln -s $prog $prog-${version} - done - # Add function definition and usage to tiger geocoder files - for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do - sed -i "/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');" "$file" - done - # Original topology patching - for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do - sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" - done - mkdir -p $doc/share/doc/postgis - mv doc/* $doc/share/doc/postgis/ - ''; + buildInputs = [ + libxml2 + postgresql + geos + proj + gdal + json_c + protobufc + pcre2.dev + sfcgal + ] ++ lib.optional stdenv.isDarwin libiconv; + nativeBuildInputs = [ + perl + pkg-config + ]; + dontDisableStatic = true; + + env.NIX_LDFLAGS = "-L${lib.getLib json_c}/lib"; + + preConfigure = '' + sed -i 's@/usr/bin/file@${file}/bin/file@' configure + configureFlags="--datadir=$out/share/postgresql --datarootdir=$out/share/postgresql --bindir=$out/bin --docdir=$doc/share/doc/${pname} --with-gdalconfig=${gdal}/bin/gdal-config --with-jsondir=${json_c.dev} --with-sfcgal" + + makeFlags="PERL=${perl}/bin/perl datadir=$out/share/postgresql pkglibdir=$out/lib bindir=$out/bin docdir=$doc/share/doc/${pname}" + ''; + + postConfigure = '' + sed -i "s|@mkdir -p \$(DESTDIR)\$(PGSQL_BINDIR)||g ; + s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g + " \ + "raster/loader/Makefile"; + sed -i "s|\$(DESTDIR)\$(PGSQL_BINDIR)|$prefix/bin|g + " \ + "raster/scripts/python/Makefile"; + mkdir -p $out/bin + ln -s ${postgresql}/bin/postgres $out/bin/postgres + ''; + + postInstall = '' + MIN_MAJ_VERSION=${lib.concatStringsSep "." (lib.take 2 (builtins.splitVersion version))} + rm $out/bin/postgres + + # Rename C extension libraries with full version suffix + for ext in ${lib.concatStringsSep " " cExtensions}; do + if [ -f "$out/lib/$ext-3${postgresql.dlSuffix}" ]; then + mv $out/lib/$ext-3${postgresql.dlSuffix} $out/lib/$ext-${version}${postgresql.dlSuffix} + fi + done - passthru.tests.postgis = nixosTests.postgis; + # Create version-specific control files (without default_version, pointing to unversioned library) + for ext in ${lib.concatStringsSep " " (cExtensions ++ sqlExtensions)}; do + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/$ext-3'|" \ + $out/share/postgresql/extension/$ext.control > $out/share/postgresql/extension/$ext--${version}.control + rm $out/share/postgresql/extension/$ext.control + done + + # Add function definition and usage to tiger geocoder files + for file in $out/share/postgresql/extension/postgis_tiger_geocoder*--${version}.sql; do + sed -i "/SELECT postgis_extension_AddToSearchPath('tiger');/a SELECT postgis_extension_AddToSearchPath('extensions');" "$file" + done + # Original topology patching + for file in $out/share/postgresql/extension/postgis_topology*--${version}.sql; do + sed -i "/SELECT topology.AddToSearchPath('topology');/i SELECT topology.AddToSearchPath('extensions');" "$file" + done + + # For the latest version, create default control file and library symlinks + if [[ "${version}" == "${latestVersion}" ]]; then + # Copy all SQL upgrade scripts only for latest version + cp $out/share/postgresql/extension/*.sql $out/share/postgresql/extension/ 2>/dev/null || true + + for ext in ${lib.concatStringsSep " " (cExtensions ++ sqlExtensions)}; do + { + echo "default_version = '${version}'" + cat $out/share/postgresql/extension/$ext--${version}.control + } > $out/share/postgresql/extension/$ext.control + done + + # Create symlinks for C extension libraries (latest version becomes the default) + for ext in ${lib.concatStringsSep " " cExtensions}; do + ln -sfn $ext-${version}${postgresql.dlSuffix} $out/lib/$ext-3${postgresql.dlSuffix} + done + + for prog in $out/bin/*; do # */ + ln -s $prog $prog-${version} + done + else + # remove migration scripts for non-latest version + find $out/share/postgresql/extension -regex '.*--.*--.*\.sql' -delete + + for prog in $out/bin/*; do # */ + mv $prog $prog-${version} + done + fi + + mkdir -p $doc/share/doc/postgis + mv doc/* $doc/share/doc/postgis/ + ''; + + passthru.tests.postgis = nixosTests.postgis; + + meta = with lib; { + description = "Geographic Objects for PostgreSQL"; + homepage = "https://postgis.net/"; + changelog = "https://git.osgeo.org/gitea/postgis/postgis/raw/tag/$%7Bversion%7D/NEWS"; + license = licenses.gpl2; + inherit (postgresql.meta) platforms; + }; + }; +in +buildEnv { + name = pname; + paths = packages; + + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + # Verify all expected library files are present + # We expect: (numberOfVersions * cExtensions) versioned libraries + cExtensions symlinks + expectedFiles=${ + toString ((numberOfVersions * builtins.length cExtensions) + builtins.length cExtensions) + } + actualFiles=$(ls -A $out/lib/*${postgresql.dlSuffix} | wc -l) + + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/*${postgresql.dlSuffix} || true + exit 1 + fi + ''; - meta = with lib; { - description = "Geographic Objects for PostgreSQL"; - homepage = "https://postgis.net/"; - changelog = "https://git.osgeo.org/gitea/postgis/postgis/raw/tag/$%7Bversion%7D/NEWS"; - license = licenses.gpl2; - inherit (postgresql.meta) platforms; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/postgis.nix b/nix/ext/tests/postgis.nix new file mode 100644 index 000000000..ab6a4b3f8 --- /dev/null +++ b/nix/ext/tests/postgis.nix @@ -0,0 +1,156 @@ +{ self, pkgs }: +let + pname = "postgis"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def check_upgrade_path(pg_version): + with subtest("Check ${pname} upgrade path"): + firstVersion = versions[pg_version][0] + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") + run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" + for version in versions[pg_version][1:]: + run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path("15") + + with subtest("Check ${pname} latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension where extname = '${pname}';""") + latestVersion = versions["15"][-1] + majMinVersion = ".".join(latestVersion.split('.')[:1]) + assert f"${pname},{majMinVersion}" in installed_extensions, f"Expected ${pname} version {latestVersion}, but found {installed_extensions}" + + with subtest("switch to postgresql 17"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check ${pname} latest extension version after upgrade"): + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["17"][-1] + majMinVersion = ".".join(latestVersion.split('.')[:1]) + assert f"${pname},{majMinVersion}" in installed_extensions + + check_upgrade_path("17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index f786fc3f5..fe34cb814 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -183,6 +183,20 @@ "hash": "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4=" } }, + "postgis": { + "3.3.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-miohnaAFoXMKOdGVmhx87GGbHvsAm2W+gP/CW60pkGg=" + }, + "3.3.7": { + "postgresql": [ + "17" + ], + "hash": "sha256-UHJKDd5JrcJT5Z4CTYsY/va+ToU0GUPG1eHhuXTkP84=" + } + }, "rum": { "1.3": { "postgresql": [ From e3a91a7830c24847f526a9789793f1d4f4cf5d5d Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Fri, 3 Oct 2025 08:58:29 -0400 Subject: [PATCH 106/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1813) * refactor(ansible): bring our ansible up to modern ansible-lint standards * fix(setup-gotrue.yml): here, you dropped this: / --- ansible/tasks/setup-gotrue.yml | 83 +++++++++++++++++----------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/ansible/tasks/setup-gotrue.yml b/ansible/tasks/setup-gotrue.yml index 786f9a767..70bbbf85f 100644 --- a/ansible/tasks/setup-gotrue.yml +++ b/ansible/tasks/setup-gotrue.yml @@ -1,48 +1,47 @@ - name: UFW - Allow connections to GoTrue metrics exporter - ufw: - rule: allow - port: "9122" + community.general.ufw: + port: '9122' + rule: 'allow' # use this user for the Gotrue build and for running the service - name: Gotrue - system user - user: name=gotrue + ansible.builtin.user: + name: 'gotrue' + state: 'present' -- name: Setting arch (x86) - set_fact: - arch: "x86" - when: platform == "amd64" - -- name: Setting arch (arm) - set_fact: - arch: "arm64" - when: platform == "arm64" +- name: Setting arch as a fact + ansible.builtin.set_fact: + arch: >- + {%- if platform == 'amd64' -%} + x86 + {%- elif platform == 'arm64' -%} + arm64 + {%- endif -%} - name: gotrue - download commit archive - get_url: - url: "https://github.com/supabase/gotrue/releases/download/v%7B%7B%20gotrue_release%20%7D%7D/auth-v%7B%7B%20gotrue_release%20%7D%7D-%7B%7B%20arch%20%7D%7D.tar.gz" - dest: /tmp/gotrue.tar.gz + ansible.builtin.get_url: checksum: "{{ gotrue_release_checksum }}" + dest: '/tmp/gotrue.tar.gz' + url: "https://github.com/supabase/gotrue/releases/download/v%7B%7B%20gotrue_release%20%7D%7D/auth-v%7B%7B%20gotrue_release%20%7D%7D-%7B%7B%20arch%20%7D%7D.tar.gz" -- name: gotrue - create /opt/gotrue - file: - path: /opt/gotrue - state: directory - owner: gotrue - mode: 0775 - -- name: gotrue - create /etc/auth.d - file: - path: /etc/auth.d - state: directory - owner: gotrue - mode: 0775 +- name: gotrue - create /opt/gotrue and /etc/auth.d + ansible.builtin.file: + mode: '0775' + owner: 'gotrue' + path: "{{ gotrue_dir_item }}" + state: 'directory' + loop: + - '/etc/auth.d' + - '/opt/gotrue' + loop_control: + loop_var: 'gotrue_dir_item' - name: gotrue - unpack archive in /opt/gotrue - unarchive: - remote_src: yes - src: /tmp/gotrue.tar.gz - dest: /opt/gotrue - owner: gotrue + ansible.builtin.unarchive: + dest: '/opt/gotrue' + owner: 'gotrue' + remote_src: true + src: '/tmp/gotrue.tar.gz' # libpq is a C library that enables user programs to communicate with # the PostgreSQL database server. @@ -52,15 +51,15 @@ # - libpq-dev - name: gotrue - create service file - template: - src: files/gotrue.service.j2 - dest: /etc/systemd/system/gotrue.service + ansible.builtin.template: + dest: '/etc/systemd/system/gotrue.service' + src: 'files/gotrue.service.j2' - name: gotrue - create optimizations file - template: - src: files/gotrue-optimizations.service.j2 - dest: /etc/systemd/system/gotrue-optimizations.service + ansible.builtin.template: + dest: '/etc/systemd/system/gotrue-optimizations.service' + src: 'files/gotrue-optimizations.service.j2' - name: gotrue - reload systemd - systemd: - daemon_reload: yes + ansible.builtin.systemd_service: + daemon_reload: true From a935464aa2a63b59f723882f38fde9906690a843 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 3 Oct 2025 09:34:52 -0400 Subject: [PATCH 107/134] fix: update Dockerfiles for changes to postgis multiversion (#1817) * fix: do not create links to contrib * chore: rm comment here too --- Dockerfile-15 | 4 ---- Dockerfile-17 | 2 +- Dockerfile-orioledb-17 | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile-15 b/Dockerfile-15 index f1b0f4558..28f5122c0 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -90,10 +90,6 @@ RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/s RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ RUN chown -R postgres:postgres /usr/share/postgresql/ -# Create symbolic links for contrib directory -RUN mkdir -p /usr/lib/postgresql/share/postgresql/contrib \ - && find /nix/var/nix/profiles/default/share/postgresql/contrib/ -mindepth 1 -type d -exec sh -c 'for dir do ln -s "$dir" "/usr/lib/postgresql/share/postgresql/contrib/$(basename "$dir")"; done' sh {} + \ - && chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/contrib/ RUN chown -R postgres:postgres /usr/lib/postgresql diff --git a/Dockerfile-17 b/Dockerfile-17 index 7db870ad8..3ad03b37c 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -91,7 +91,7 @@ RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/s RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ RUN chown -R postgres:postgres /usr/share/postgresql/ -# Create symbolic links for contrib directory + RUN tree /nix > /tmp/tree.txt && cat /tmp/tree.txt && cat /tmp/tree.txt >&2 RUN chown -R postgres:postgres /usr/lib/postgresql diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 0df0b9df0..29f2fa527 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -91,7 +91,7 @@ RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/lib/postgresql/s RUN ln -s /nix/var/nix/profiles/default/share/postgresql/* /usr/share/postgresql/ RUN chown -R postgres:postgres /usr/lib/postgresql/share/postgresql/ RUN chown -R postgres:postgres /usr/share/postgresql/ -# Create symbolic links for contrib directory + RUN tree /nix > /tmp/tree.txt && cat /tmp/tree.txt && cat /tmp/tree.txt >&2 RUN chown -R postgres:postgres /usr/lib/postgresql From 4d7f384f1a581d63e1226fc1dc92fb23275d4e11 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Fri, 3 Oct 2025 16:22:14 -0400 Subject: [PATCH 108/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1818) --- ansible/tasks/setup-kong.yml | 68 +++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/ansible/tasks/setup-kong.yml b/ansible/tasks/setup-kong.yml index b34f96e78..22a34897b 100644 --- a/ansible/tasks/setup-kong.yml +++ b/ansible/tasks/setup-kong.yml @@ -1,62 +1,64 @@ - name: Kong - system user - user: name=kong + ansible.builtin.user: + name: 'kong' + state: 'present' # Kong installation steps from http://archive.vn/3HRQx - name: Kong - system dependencies - apt: + ansible.builtin.apt: pkg: - - openssl - libpcre3 - - procps + - openssl - perl + - procps - name: Kong - download deb package get_url: - url: "https://packages.konghq.com/public/gateway-28/deb/ubuntu/pool/%7B%7B%20kong_release_target%20%7D%7D/main/k/ko/kong_2.8.1/%7B%7B%20kong_deb%20%7D%7D" - dest: /tmp/kong.deb checksum: "{{ kong_deb_checksum }}" + dest: '/tmp/kong.deb' + url: "https://packages.konghq.com/public/gateway-28/deb/ubuntu/pool/%7B%7B%20kong_release_target%20%7D%7D/main/k/ko/kong_2.8.1/%7B%7B%20kong_deb%20%7D%7D" - name: Kong - deb installation - apt: deb=file:///tmp/kong.deb + ansible.builtin.apt: + deb: '/tmp/kong.deb' - name: Kong - ensure it is NOT autoremoved - shell: | - set -e - apt-mark manual kong zlib1g* + ansible.builtin.command: + cmd: apt-mark manual kong zlib1g* - name: Kong - configuration - template: - src: files/kong_config/kong.conf.j2 - dest: /etc/kong/kong.conf + ansible.builtin.template: + dest: '/etc/kong/kong.conf' + src: 'files/kong_config/kong.conf.j2' - name: Kong - hand over ownership of /usr/local/kong to user kong - file: - path: /usr/local/kong - recurse: yes - owner: kong + ansible.builtin.file: + owner: 'kong' + path: '/usr/local/kong' + recurse: true # [warn] ulimit is currently set to "1024". For better performance set it to at least # "4096" using "ulimit -n" - name: Kong - bump up ulimit - pam_limits: - limit_item: nofile - limit_type: soft - domain: kong - value: "4096" + community.general.pam_limits: + domain: 'kong' + limit_item: 'nofile' + limit_type: 'soft' + value: '4096' - name: Kong - create env file - template: - src: files/kong_config/kong.env.j2 - dest: /etc/kong/kong.env + ansible.builtin.template: + dest: '/etc/kong/kong.env' + src: 'files/kong_config/kong.env.j2' - name: Kong - create service file - template: - src: files/kong_config/kong.service.j2 - dest: /etc/systemd/system/kong.service + ansible.builtin.template: + dest: '/etc/systemd/system/kong.service' + src: 'files/kong_config/kong.service.j2' - name: Kong - disable service - systemd: - enabled: no - name: kong - state: stopped - daemon_reload: yes + ansible.builtin.systemd_service: + daemon_reload: true + enabled: false + name: 'kong' + state: 'stopped' From d584651a23ff97bf7e539e2fd51cc860d0e6e2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 6 Oct 2025 20:58:08 +0200 Subject: [PATCH 109/134] feat: support multiple versions of the pg-graphql extension (#1761) * feat(pg_graphql): build multiple versions of the pg_graphql extension Build multiple versions of the pg_graphql extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * feat(cargo-pgrx): build extensions with specified Rust version This change allows developers to target specific Rust versions for building extensions. It implements support for building cargo extensions and `cargo-pgrx` using the specified Rust version. * Build pg_graphql 1.4.2 using pgrx 0.10.2 * Build pg_graphql 1.4.1 using pgrx 0.10.2 * Build pg_graphql 1.2.3 using pgrx 0.9.7 * Build pg_graphql 1.2.2 using pgrx 0.9.5 * Build pg_graphql 1.2.0 using pgx 0.7.1 * Build pg_graphql 1.1.0 using pgx 0.6.1 * Refactoring and build pg_graphql 1.0.2 using pgx 0.6.1 * chore: add release suffix for testing * fix: conditional for using this linking only with macos * fix: bindgen * fix: apply bindgen fix for aarch64 to versions up to 1.5.1 The issue we face when building pg_graphql on aarch64 is: `Invalid or unknown abi 16 for function "_ZGVnN4vv_atan2f"` It has been fixed in bindgen 0.11.3. * chore: use default nixos test to test pg_graphql extension * fix(pg_graphql): migration script from 1.5.1-mergeless to 1.5.4 Add special case handling for 1.5.1-mergeless to 1.5.4 upgrade path. Also replace CREATE FUNCTION with CREATE OR REPLACE FUNCTION to prevent conflicts in migration scripts and the same for event triggers. * fix: do not apply bindgen fix for version 1.5.4 pg_graphql 1.5.4 uses pgrx 0.11.3 which fixed the ABI issues on aarch64-linux. * feat: run pg_regress tests during build We don't recompile the extension using pgx with dev/debug symbols, but we do run the pg_regress tests to ensure everything is working correctly. * chore: bump to release --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +- nix/cargo-pgrx/buildPgrxExtension.nix | 17 +- nix/cargo-pgrx/default.nix | 5 +- nix/cargo-pgrx/versions.json | 41 +- nix/ext/pg_graphql.nix | 57 - .../0001-Add-missing-Cargo.lock-1.0.2.patch | 1980 ++++++++++++++++ .../0001-Add-missing-Cargo.lock-1.1.0.patch | 1980 ++++++++++++++++ .../0001-Add-missing-Cargo.lock-1.2.0.patch | 2081 +++++++++++++++++ nix/ext/pg_graphql/Cargo-1.0.2.lock | 1961 ++++++++++++++++ nix/ext/pg_graphql/Cargo-1.1.0.lock | 1961 ++++++++++++++++ nix/ext/pg_graphql/Cargo-1.2.0.lock | 2051 ++++++++++++++++ nix/ext/pg_graphql/default.nix | 206 ++ nix/ext/tests/default.nix | 1 + nix/ext/versions.json | 132 ++ nix/overlays/default.nix | 4 + nix/packages/postgres.nix | 2 +- 16 files changed, 12417 insertions(+), 68 deletions(-) delete mode 100644 nix/ext/pg_graphql.nix create mode 100644 nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.0.2.patch create mode 100644 nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.1.0.patch create mode 100644 nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.2.0.patch create mode 100644 nix/ext/pg_graphql/Cargo-1.0.2.lock create mode 100644 nix/ext/pg_graphql/Cargo-1.1.0.lock create mode 100644 nix/ext/pg_graphql/Cargo-1.2.0.lock create mode 100644 nix/ext/pg_graphql/default.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 2fc0ff36f..18cb0a206 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.034-orioledb - postgres17: 17.6.1.013 - postgres15: 15.14.1.013 + postgresorioledb-17: "17.5.1.035-orioledb" + postgres17: "17.6.1.014" + postgres15: "15.14.1.014" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/cargo-pgrx/buildPgrxExtension.nix b/nix/cargo-pgrx/buildPgrxExtension.nix index d62db6b04..7ad87c550 100644 --- a/nix/cargo-pgrx/buildPgrxExtension.nix +++ b/nix/cargo-pgrx/buildPgrxExtension.nix @@ -53,6 +53,10 @@ buildFeatures ? [ ], cargoBuildFlags ? [ ], postgresql, + # enable override to generate bindings using bindgenHook. + # Some older versions of cargo-pgrx use a bindgenHook that is not compatible with the + # current clang version present in stdenv + bindgenHook ? rustPlatform.bindgenHook, # cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the # dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g. # if you include the generated code in the output via postInstall. @@ -87,12 +91,14 @@ let pushd "${buildAndTestSubdir}" ''; maybeLeaveBuildAndTestSubdir = lib.optionalString (buildAndTestSubdir != null) "popd"; + pgrxBinaryName = if builtins.compareVersions "0.7.4" cargo-pgrx.version >= 0 then "pgx" else "pgrx"; pgrxPostgresMajor = lib.versions.major postgresql.version; preBuildAndTest = '' export PGRX_HOME=$(mktemp -d) + export PGX_HOME=$PGRX_HOME export PGDATA="$PGRX_HOME/data-${pgrxPostgresMajor}/" - cargo-pgrx pgrx init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config + cargo-${pgrxBinaryName} ${pgrxBinaryName} init "--pg${pgrxPostgresMajor}" ${lib.getDev postgresql}/bin/pg_config # unix sockets work in sandbox, too. export PGHOST="$(mktemp -d)" @@ -127,7 +133,7 @@ let cargo-pgrx postgresql pkg-config - rustPlatform.bindgenHook + bindgenHook ] ++ lib.optionals useFakeRustfmt [ fakeRustfmt ]; @@ -138,9 +144,10 @@ let ${preBuildAndTest} ${maybeEnterBuildAndTestSubdir} - PGRX_BUILD_FLAGS="--frozen -j $NIX_BUILD_CORES ${builtins.concatStringsSep " " cargoBuildFlags}" \ + export PGRX_BUILD_FLAGS="--frozen -j $NIX_BUILD_CORES ${builtins.concatStringsSep " " cargoBuildFlags}" + export PGX_BUILD_FLAGS="$PGRX_BUILD_FLAGS" ${lib.optionalString stdenv.hostPlatform.isDarwin ''RUSTFLAGS="''${RUSTFLAGS:+''${RUSTFLAGS} }-Clink-args=-Wl,-undefined,dynamic_lookup"''} \ - cargo pgrx package \ + cargo ${pgrxBinaryName} package \ --pg-config ${lib.getDev postgresql}/bin/pg_config \ ${maybeDebugFlag} \ --features "${builtins.concatStringsSep " " buildFeatures}" \ @@ -160,7 +167,7 @@ let ${maybeEnterBuildAndTestSubdir} - cargo-pgrx pgrx stop all + cargo-${pgrxBinaryName} ${pgrxBinaryName} stop all mv $out/${postgresql}/* $out mv $out/${postgresql.lib}/* $out diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 6d9ef2a1a..02c965a94 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -20,13 +20,16 @@ let hash, cargoHash, }: + let + pname = if builtins.compareVersions "0.7.4" version >= 0 then "cargo-pgx" else "cargo-pgrx"; + in rustPlatform.buildRustPackage rec { # rust-overlay uses 'cargo-auditable' wrapper for 'cargo' command, but it # is using older version 0.18.1 of 'cargo_metadata' which doesn't support # rust edition 2024, so we disable the 'cargo-auditable' just for now. # ref: https://github.com/oxalica/rust-overlay/issues/153 auditable = false; - pname = "cargo-pgrx"; + inherit pname; inherit version; src = fetchCrate { inherit version pname hash; }; inherit cargoHash; diff --git a/nix/cargo-pgrx/versions.json b/nix/cargo-pgrx/versions.json index 2a4e24192..6efe3315f 100644 --- a/nix/cargo-pgrx/versions.json +++ b/nix/cargo-pgrx/versions.json @@ -1,4 +1,44 @@ { + "0.6.1": { + "hash": "sha256-O4eHVbJBudybsPab+zr2eXnfheREMqLAHAKm2GDbfrs=", + "rust": { + "1.82.0": { + "cargoHash": "sha256-MucGrA3qXgJOcT2LMNmoNOhQi8QA3LuqgZEHKycLCCo=" + } + } + }, + "0.7.1": { + "hash": "sha256-t/gdlrBeP6KFkBFJiZUa8KKVJVYMf6753vQGKJdytss=", + "rust": { + "1.82.0": { + "cargoHash": "sha256-muce9wT4LAJmfNLWWEShARnpZgglXe/KrfxlitmGgXk=" + } + } + }, + "0.9.5": { + "hash": "sha256-GpXQUOBuojAqPXyRR+k8AVW2XzBbn6V0+2dhP4w4Vs8=", + "rust": { + "1.70.0": { + "cargoHash": "sha256-YbwGh3tbt8W9/VOu11fTWO9fRMUlrwJnG4wxUHuyX10=" + } + } + }, + "0.9.7": { + "hash": "sha256-uDBq7tUZ9f8h5nlRFR1mv4+Ty1OFtAk5P7OTNQPI1gI=", + "rust": { + "1.70.0": { + "cargoHash": "sha256-YTkjqMNF+cz5XtELh7+l8KwvRoVKQP7t98nkJwkW218=" + } + } + }, + "0.10.2": { + "hash": "sha256-FqjfbJmSy5UCpPPPk4bkEyvQCnaH9zYtkI7txgIn+ls=", + "rust": { + "1.70.0": { + "cargoHash": "sha256-syZ3cQq8qDHBLvqmNDGoxeK6zXHJ47Jwkw3uhaXNCzI=" + } + } + }, "0.11.2": { "hash": "sha256-8NlpMDFaltTIA8G4JioYm8LaPJ2RGKH5o6sd6lBHmmM=", "rust": { @@ -57,5 +97,4 @@ } } } - } diff --git a/nix/ext/pg_graphql.nix b/nix/ext/pg_graphql.nix deleted file mode 100644 index ebe6fea7f..000000000 --- a/nix/ext/pg_graphql.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - postgresql, - buildPgrxExtension_0_12_9, - rust-bin, -}: - -let - rustVersion = "1.81.0"; - cargo = rust-bin.stable.${rustVersion}.default; -in -buildPgrxExtension_0_12_9 rec { - pname = "pg_graphql"; - version = "1.5.11"; - inherit postgresql; - - src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "v${version}"; - hash = "sha256-BMZc9ui+2J3U24HzZZVCU5+KWhz+5qeUsRGeptiqbek="; - }; - - nativeBuildInputs = [ cargo ]; - buildInputs = [ postgresql ]; - - CARGO = "${cargo}/bin/cargo"; - - cargoLock = { - lockFile = "${src}/Cargo.lock"; - }; - # Setting RUSTFLAGS in env to ensure it's available for all phases - env = lib.optionalAttrs stdenv.isDarwin { - POSTGRES_LIB = "${postgresql}/lib"; - PGPORT = toString ( - 5430 - + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) - # +1 for OrioleDB - + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 - ); # +2 for each major version - RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - NIX_BUILD_CORES = "4"; # Limit parallel jobs - CARGO_BUILD_JOBS = "4"; # Limit cargo parallelism - }; - CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; - - doCheck = false; - - meta = with lib; { - description = "GraphQL support for PostreSQL"; - homepage = "https://github.com/supabase/$%7Bpname%7D"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - }; -} diff --git a/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.0.2.patch b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.0.2.patch new file mode 100644 index 000000000..10dfca53a --- /dev/null +++ b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.0.2.patch @@ -0,0 +1,1980 @@ +From 46ec9b1665b3715bdaaf9ce4ba13fb66934ce2e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= +Date: Thu, 26 Jun 2025 14:29:18 +0200 +Subject: [PATCH] Add missing Cargo.lock + +--- + Cargo.lock | 1961 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 1961 insertions(+) + create mode 100644 Cargo.lock + +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..0012125 +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,1961 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 3 ++ ++[[package]] ++name = "aho-corasick" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "ascii" ++version = "0.9.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" ++ ++[[package]] ++name = "async-trait" ++version = "0.1.64" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "async_once" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" ++ ++[[package]] ++name = "atomic-polyfill" ++version = "0.1.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" ++dependencies = [ ++ "critical-section", ++] ++ ++[[package]] ++name = "atomic-traits" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" ++dependencies = [ ++ "cfg-if", ++ "rustc_version 0.3.3", ++] ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi 0.1.19", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" ++ ++[[package]] ++name = "base64" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" ++ ++[[package]] ++name = "bindgen" ++version = "0.60.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" ++dependencies = [ ++ "bitflags", ++ "cexpr", ++ "clang-sys", ++ "lazy_static", ++ "lazycell", ++ "peeking_take_while", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "rustc-hash", ++ "shlex", ++] ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "bitvec" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" ++dependencies = [ ++ "funty", ++ "radium", ++ "tap", ++ "wyz", ++] ++ ++[[package]] ++name = "block-buffer" ++version = "0.10.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" ++dependencies = [ ++ "generic-array", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" ++ ++[[package]] ++name = "bytes" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" ++ ++[[package]] ++name = "cached" ++version = "0.34.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" ++dependencies = [ ++ "async-trait", ++ "async_once", ++ "cached_proc_macro", ++ "cached_proc_macro_types", ++ "futures", ++ "hashbrown", ++ "lazy_static", ++ "once_cell", ++ "thiserror", ++ "tokio", ++] ++ ++[[package]] ++name = "cached_proc_macro" ++version = "0.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" ++dependencies = [ ++ "cached_proc_macro_types", ++ "darling", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "cached_proc_macro_types" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" ++ ++[[package]] ++name = "cexpr" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" ++dependencies = [ ++ "nom", ++] ++ ++[[package]] ++name = "cfg-if" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" ++ ++[[package]] ++name = "clang-sys" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" ++dependencies = [ ++ "glob", ++ "libc", ++ "libloading", ++] ++ ++[[package]] ++name = "combine" ++version = "3.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" ++dependencies = [ ++ "ascii", ++ "byteorder", ++ "either", ++ "memchr", ++ "unreachable", ++] ++ ++[[package]] ++name = "convert_case" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" ++ ++[[package]] ++name = "cpufeatures" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "critical-section" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-deque" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-epoch", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-epoch" ++version = "0.9.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "crossbeam-utils", ++ "memoffset 0.7.1", ++ "scopeguard", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "crypto-common" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" ++dependencies = [ ++ "generic-array", ++ "typenum", ++] ++ ++[[package]] ++name = "cstr_core" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" ++dependencies = [ ++ "cty", ++ "memchr", ++] ++ ++[[package]] ++name = "cty" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" ++ ++[[package]] ++name = "darling" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" ++dependencies = [ ++ "darling_core", ++ "darling_macro", ++] ++ ++[[package]] ++name = "darling_core" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" ++dependencies = [ ++ "fnv", ++ "ident_case", ++ "proc-macro2", ++ "quote", ++ "strsim", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "darling_macro" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" ++dependencies = [ ++ "darling_core", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "deranged" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" ++dependencies = [ ++ "powerfmt", ++] ++ ++[[package]] ++name = "digest" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" ++dependencies = [ ++ "block-buffer", ++ "crypto-common", ++ "subtle", ++] ++ ++[[package]] ++name = "dirs" ++version = "4.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" ++dependencies = [ ++ "dirs-sys", ++] ++ ++[[package]] ++name = "dirs-sys" ++version = "0.3.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" ++dependencies = [ ++ "libc", ++ "redox_users", ++ "winapi", ++] ++ ++[[package]] ++name = "either" ++version = "1.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" ++ ++[[package]] ++name = "eyre" ++version = "0.6.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" ++dependencies = [ ++ "indenter", ++ "once_cell", ++] ++ ++[[package]] ++name = "fallible-iterator" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" ++ ++[[package]] ++name = "fixedbitset" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" ++ ++[[package]] ++name = "fnv" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" ++ ++[[package]] ++name = "form_urlencoded" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" ++dependencies = [ ++ "percent-encoding", ++] ++ ++[[package]] ++name = "funty" ++version = "2.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" ++ ++[[package]] ++name = "futures" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-executor", ++ "futures-io", ++ "futures-sink", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-channel" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" ++dependencies = [ ++ "futures-core", ++ "futures-sink", ++] ++ ++[[package]] ++name = "futures-core" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" ++ ++[[package]] ++name = "futures-executor" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" ++dependencies = [ ++ "futures-core", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-io" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" ++ ++[[package]] ++name = "futures-macro" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "futures-sink" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" ++ ++[[package]] ++name = "futures-task" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" ++ ++[[package]] ++name = "futures-util" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-io", ++ "futures-macro", ++ "futures-sink", ++ "futures-task", ++ "memchr", ++ "pin-project-lite", ++ "pin-utils", ++ "slab", ++] ++ ++[[package]] ++name = "generic-array" ++version = "0.14.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" ++dependencies = [ ++ "typenum", ++ "version_check", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "wasi", ++] ++ ++[[package]] ++name = "glob" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" ++ ++[[package]] ++name = "graphql-parser" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" ++dependencies = [ ++ "combine", ++ "thiserror", ++] ++ ++[[package]] ++name = "half" ++version = "1.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" ++ ++[[package]] ++name = "hash32" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" ++dependencies = [ ++ "byteorder", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" ++ ++[[package]] ++name = "heapless" ++version = "0.7.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" ++dependencies = [ ++ "atomic-polyfill", ++ "hash32", ++ "rustc_version 0.4.0", ++ "spin", ++ "stable_deref_trait", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hmac" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "ident_case" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" ++ ++[[package]] ++name = "idna" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "indenter" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" ++ ++[[package]] ++name = "indexmap" ++version = "1.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" ++dependencies = [ ++ "autocfg", ++ "hashbrown", ++] ++ ++[[package]] ++name = "itertools" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" ++dependencies = [ ++ "either", ++] ++ ++[[package]] ++name = "itoa" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "lazycell" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" ++ ++[[package]] ++name = "libc" ++version = "0.2.146" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++ ++[[package]] ++name = "libloading" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" ++dependencies = [ ++ "cfg-if", ++ "winapi", ++] ++ ++[[package]] ++name = "lock_api" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" ++dependencies = [ ++ "autocfg", ++ "scopeguard", ++] ++ ++[[package]] ++name = "log" ++version = "0.4.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "matchers" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" ++dependencies = [ ++ "regex-automata", ++] ++ ++[[package]] ++name = "md-5" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" ++ ++[[package]] ++name = "memoffset" ++version = "0.6.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "memoffset" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "minimal-lexical" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" ++ ++[[package]] ++name = "mio" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" ++dependencies = [ ++ "libc", ++ "log", ++ "wasi", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "nom" ++version = "7.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" ++dependencies = [ ++ "memchr", ++ "minimal-lexical", ++] ++ ++[[package]] ++name = "nu-ansi-term" ++version = "0.46.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" ++dependencies = [ ++ "overload", ++ "winapi", ++] ++ ++[[package]] ++name = "num-conv" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" ++ ++[[package]] ++name = "num_cpus" ++version = "1.15.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" ++dependencies = [ ++ "hermit-abi 0.2.6", ++ "libc", ++] ++ ++[[package]] ++name = "once_cell" ++version = "1.18.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" ++ ++[[package]] ++name = "overload" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" ++ ++[[package]] ++name = "owo-colors" ++version = "3.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" ++ ++[[package]] ++name = "parking_lot" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" ++dependencies = [ ++ "lock_api", ++ "parking_lot_core", ++] ++ ++[[package]] ++name = "parking_lot_core" ++version = "0.9.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "redox_syscall", ++ "smallvec", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "peeking_take_while" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" ++ ++[[package]] ++name = "percent-encoding" ++version = "2.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" ++ ++[[package]] ++name = "pest" ++version = "2.5.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" ++dependencies = [ ++ "thiserror", ++ "ucd-trie", ++] ++ ++[[package]] ++name = "petgraph" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" ++dependencies = [ ++ "fixedbitset", ++ "indexmap", ++] ++ ++[[package]] ++name = "pg_graphql" ++version = "1.0.2" ++dependencies = [ ++ "base64", ++ "cached", ++ "graphql-parser", ++ "itertools", ++ "lazy_static", ++ "pgx", ++ "pgx-contrib-spiext", ++ "pgx-tests", ++ "rand", ++ "regex", ++ "serde", ++ "serde_json", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "708693428ee16491645c1c2795f6777a78b9b1d08ab2e481a82b7977c9814b56" ++dependencies = [ ++ "atomic-traits", ++ "bitflags", ++ "bitvec", ++ "cstr_core", ++ "eyre", ++ "heapless", ++ "libc", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-sys", ++ "pgx-utils", ++ "quote", ++ "seahash", ++ "seq-macro", ++ "serde", ++ "serde_cbor", ++ "serde_json", ++ "thiserror", ++ "time", ++ "tracing", ++ "tracing-error", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx-contrib-spiext" ++version = "0.1.0" ++source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=153ad2db8bb8634332ad36ffc66dcb017353bf93#153ad2db8bb8634332ad36ffc66dcb017353bf93" ++dependencies = [ ++ "pgx", ++] ++ ++[[package]] ++name = "pgx-macros" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0050ca15df7dbfe718f9006d2b9a38d2a00a40934d8154450cdde6323b58b690" ++dependencies = [ ++ "pgx-utils", ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++ "unescape", ++] ++ ++[[package]] ++name = "pgx-pg-config" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "000bba0f67f2aa20e971a6127a8971bd85a6b724d3e95d9066f64816de3b4e67" ++dependencies = [ ++ "dirs", ++ "eyre", ++ "owo-colors", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "toml", ++ "url", ++] ++ ++[[package]] ++name = "pgx-pg-sys" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6bd3fd6e1bcbfed67da7ac2dc71986a9f1396aeaec3d449d0697eb54909b34a" ++dependencies = [ ++ "bindgen", ++ "eyre", ++ "libc", ++ "memoffset 0.6.5", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-config", ++ "pgx-utils", ++ "proc-macro2", ++ "quote", ++ "rayon", ++ "shlex", ++ "sptr", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "pgx-tests" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "44db59e5a5473f9192cff05a284677b8b491bffcf85dcc7b892339f084ad2f2b" ++dependencies = [ ++ "eyre", ++ "libc", ++ "once_cell", ++ "owo-colors", ++ "pgx", ++ "pgx-macros", ++ "pgx-pg-config", ++ "pgx-utils", ++ "postgres", ++ "regex", ++ "serde", ++ "serde_json", ++ "thiserror", ++ "time", ++] ++ ++[[package]] ++name = "pgx-utils" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62cdc413efcd90a1e94c7f09dea24ec1ecfa1275350cbe378a8776eb7b5448f9" ++dependencies = [ ++ "atty", ++ "convert_case", ++ "cstr_core", ++ "eyre", ++ "petgraph", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "seq-macro", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "syn 1.0.109", ++ "tracing", ++ "tracing-error", ++ "tracing-subscriber", ++ "unescape", ++] ++ ++[[package]] ++name = "phf" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" ++dependencies = [ ++ "phf_shared", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" ++dependencies = [ ++ "siphasher", ++] ++ ++[[package]] ++name = "pin-project-lite" ++version = "0.2.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" ++ ++[[package]] ++name = "pin-utils" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" ++ ++[[package]] ++name = "postgres" ++version = "0.19.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "futures-util", ++ "log", ++ "tokio", ++ "tokio-postgres", ++] ++ ++[[package]] ++name = "postgres-protocol" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" ++dependencies = [ ++ "base64", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "hmac", ++ "md-5", ++ "memchr", ++ "rand", ++ "sha2", ++ "stringprep", ++] ++ ++[[package]] ++name = "postgres-types" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "postgres-protocol", ++] ++ ++[[package]] ++name = "powerfmt" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.95" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "radium" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" ++ ++[[package]] ++name = "rand" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" ++dependencies = [ ++ "libc", ++ "rand_chacha", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "rayon" ++version = "1.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" ++dependencies = [ ++ "either", ++ "rayon-core", ++] ++ ++[[package]] ++name = "rayon-core" ++version = "1.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" ++dependencies = [ ++ "crossbeam-channel", ++ "crossbeam-deque", ++ "crossbeam-utils", ++ "num_cpus", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.2.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" ++dependencies = [ ++ "bitflags", ++] ++ ++[[package]] ++name = "redox_users" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" ++dependencies = [ ++ "getrandom", ++ "redox_syscall", ++ "thiserror", ++] ++ ++[[package]] ++name = "regex" ++version = "1.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax 0.7.2", ++] ++ ++[[package]] ++name = "regex-automata" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" ++dependencies = [ ++ "regex-syntax 0.6.29", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.29" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" ++ ++[[package]] ++name = "regex-syntax" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" ++ ++[[package]] ++name = "rustc-hash" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" ++ ++[[package]] ++name = "rustc_version" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" ++dependencies = [ ++ "semver 0.11.0", ++] ++ ++[[package]] ++name = "rustc_version" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" ++dependencies = [ ++ "semver 1.0.16", ++] ++ ++[[package]] ++name = "ryu" ++version = "1.0.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" ++ ++[[package]] ++name = "scopeguard" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" ++ ++[[package]] ++name = "seahash" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" ++ ++[[package]] ++name = "semver" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" ++dependencies = [ ++ "semver-parser", ++] ++ ++[[package]] ++name = "semver" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" ++ ++[[package]] ++name = "semver-parser" ++version = "0.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" ++dependencies = [ ++ "pest", ++] ++ ++[[package]] ++name = "seq-macro" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" ++ ++[[package]] ++name = "serde" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_cbor" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" ++dependencies = [ ++ "half", ++ "serde", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.96" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" ++dependencies = [ ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "sha2" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" ++dependencies = [ ++ "cfg-if", ++ "cpufeatures", ++ "digest", ++] ++ ++[[package]] ++name = "sharded-slab" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" ++dependencies = [ ++ "lazy_static", ++] ++ ++[[package]] ++name = "shlex" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" ++ ++[[package]] ++name = "siphasher" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" ++ ++[[package]] ++name = "slab" ++version = "0.4.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "smallvec" ++version = "1.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" ++ ++[[package]] ++name = "socket2" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" ++dependencies = [ ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "socket2" ++version = "0.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" ++dependencies = [ ++ "libc", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "spin" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" ++dependencies = [ ++ "lock_api", ++] ++ ++[[package]] ++name = "sptr" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" ++ ++[[package]] ++name = "stable_deref_trait" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" ++ ++[[package]] ++name = "stringprep" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "strsim" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" ++ ++[[package]] ++name = "subtle" ++version = "2.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" ++ ++[[package]] ++name = "syn" ++version = "1.0.109" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "syn" ++version = "2.0.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "tap" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" ++ ++[[package]] ++name = "thiserror" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" ++dependencies = [ ++ "thiserror-impl", ++] ++ ++[[package]] ++name = "thiserror-impl" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "thread_local" ++version = "1.1.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "time" ++version = "0.3.41" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" ++dependencies = [ ++ "deranged", ++ "itoa", ++ "num-conv", ++ "powerfmt", ++ "serde", ++ "time-core", ++ "time-macros", ++] ++ ++[[package]] ++name = "time-core" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" ++ ++[[package]] ++name = "time-macros" ++version = "0.2.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" ++dependencies = [ ++ "num-conv", ++ "time-core", ++] ++ ++[[package]] ++name = "tinyvec" ++version = "1.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" ++dependencies = [ ++ "tinyvec_macros", ++] ++ ++[[package]] ++name = "tinyvec_macros" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" ++ ++[[package]] ++name = "tokio" ++version = "1.28.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" ++dependencies = [ ++ "autocfg", ++ "bytes", ++ "libc", ++ "mio", ++ "num_cpus", ++ "pin-project-lite", ++ "socket2 0.4.9", ++ "tokio-macros", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "tokio-macros" ++version = "2.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tokio-postgres" ++version = "0.7.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" ++dependencies = [ ++ "async-trait", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "futures-channel", ++ "futures-util", ++ "log", ++ "parking_lot", ++ "percent-encoding", ++ "phf", ++ "pin-project-lite", ++ "postgres-protocol", ++ "postgres-types", ++ "socket2 0.5.3", ++ "tokio", ++ "tokio-util", ++] ++ ++[[package]] ++name = "tokio-util" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" ++dependencies = [ ++ "bytes", ++ "futures-core", ++ "futures-sink", ++ "pin-project-lite", ++ "tokio", ++ "tracing", ++] ++ ++[[package]] ++name = "toml" ++version = "0.5.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "tracing" ++version = "0.1.37" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" ++dependencies = [ ++ "cfg-if", ++ "pin-project-lite", ++ "tracing-attributes", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-attributes" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tracing-core" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" ++dependencies = [ ++ "once_cell", ++ "valuable", ++] ++ ++[[package]] ++name = "tracing-error" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" ++dependencies = [ ++ "tracing", ++ "tracing-subscriber", ++] ++ ++[[package]] ++name = "tracing-log" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" ++dependencies = [ ++ "log", ++ "once_cell", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-subscriber" ++version = "0.3.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" ++dependencies = [ ++ "matchers", ++ "nu-ansi-term", ++ "once_cell", ++ "regex", ++ "sharded-slab", ++ "smallvec", ++ "thread_local", ++ "tracing", ++ "tracing-core", ++ "tracing-log", ++] ++ ++[[package]] ++name = "typenum" ++version = "1.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" ++ ++[[package]] ++name = "ucd-trie" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" ++ ++[[package]] ++name = "unescape" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" ++ ++[[package]] ++name = "unicode-bidi" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" ++ ++[[package]] ++name = "unicode-ident" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" ++ ++[[package]] ++name = "unicode-normalization" ++version = "0.1.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" ++dependencies = [ ++ "tinyvec", ++] ++ ++[[package]] ++name = "unreachable" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" ++dependencies = [ ++ "void", ++] ++ ++[[package]] ++name = "url" ++version = "2.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" ++dependencies = [ ++ "form_urlencoded", ++ "idna", ++ "percent-encoding", ++] ++ ++[[package]] ++name = "uuid" ++version = "1.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "valuable" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" ++ ++[[package]] ++name = "version_check" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" ++ ++[[package]] ++name = "void" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" ++ ++[[package]] ++name = "wasi" ++version = "0.11.0+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++ ++[[package]] ++name = "windows-sys" ++version = "0.42.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.42.1", ++ "windows_aarch64_msvc 0.42.1", ++ "windows_i686_gnu 0.42.1", ++ "windows_i686_msvc 0.42.1", ++ "windows_x86_64_gnu 0.42.1", ++ "windows_x86_64_gnullvm 0.42.1", ++ "windows_x86_64_msvc 0.42.1", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" ++dependencies = [ ++ "windows-targets", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.48.0", ++ "windows_aarch64_msvc 0.48.0", ++ "windows_i686_gnu 0.48.0", ++ "windows_i686_msvc 0.48.0", ++ "windows_x86_64_gnu 0.48.0", ++ "windows_x86_64_gnullvm 0.48.0", ++ "windows_x86_64_msvc 0.48.0", ++] ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" ++ ++[[package]] ++name = "wyz" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" ++dependencies = [ ++ "tap", ++] +-- +2.49.0 + diff --git a/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.1.0.patch b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.1.0.patch new file mode 100644 index 000000000..dd415fe10 --- /dev/null +++ b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.1.0.patch @@ -0,0 +1,1980 @@ +From 992239f38516e0940d1450c8da2ba1edfda1fd12 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= +Date: Thu, 26 Jun 2025 13:42:24 +0200 +Subject: [PATCH] Add missing Cargo.lock + +--- + Cargo.lock | 1961 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 1961 insertions(+) + create mode 100644 Cargo.lock + +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..bea78ad +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,1961 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 3 ++ ++[[package]] ++name = "aho-corasick" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "ascii" ++version = "0.9.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" ++ ++[[package]] ++name = "async-trait" ++version = "0.1.64" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "async_once" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" ++ ++[[package]] ++name = "atomic-polyfill" ++version = "0.1.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" ++dependencies = [ ++ "critical-section", ++] ++ ++[[package]] ++name = "atomic-traits" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" ++dependencies = [ ++ "cfg-if", ++ "rustc_version 0.3.3", ++] ++ ++[[package]] ++name = "atty" ++version = "0.2.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" ++dependencies = [ ++ "hermit-abi 0.1.19", ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" ++ ++[[package]] ++name = "base64" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" ++ ++[[package]] ++name = "bindgen" ++version = "0.60.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" ++dependencies = [ ++ "bitflags", ++ "cexpr", ++ "clang-sys", ++ "lazy_static", ++ "lazycell", ++ "peeking_take_while", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "rustc-hash", ++ "shlex", ++] ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "bitvec" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" ++dependencies = [ ++ "funty", ++ "radium", ++ "tap", ++ "wyz", ++] ++ ++[[package]] ++name = "block-buffer" ++version = "0.10.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" ++dependencies = [ ++ "generic-array", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" ++ ++[[package]] ++name = "bytes" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" ++ ++[[package]] ++name = "cached" ++version = "0.34.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" ++dependencies = [ ++ "async-trait", ++ "async_once", ++ "cached_proc_macro", ++ "cached_proc_macro_types", ++ "futures", ++ "hashbrown", ++ "lazy_static", ++ "once_cell", ++ "thiserror", ++ "tokio", ++] ++ ++[[package]] ++name = "cached_proc_macro" ++version = "0.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" ++dependencies = [ ++ "cached_proc_macro_types", ++ "darling", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "cached_proc_macro_types" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" ++ ++[[package]] ++name = "cexpr" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" ++dependencies = [ ++ "nom", ++] ++ ++[[package]] ++name = "cfg-if" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" ++ ++[[package]] ++name = "clang-sys" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" ++dependencies = [ ++ "glob", ++ "libc", ++ "libloading", ++] ++ ++[[package]] ++name = "combine" ++version = "3.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" ++dependencies = [ ++ "ascii", ++ "byteorder", ++ "either", ++ "memchr", ++ "unreachable", ++] ++ ++[[package]] ++name = "convert_case" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" ++ ++[[package]] ++name = "cpufeatures" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "critical-section" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-deque" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-epoch", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-epoch" ++version = "0.9.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "crossbeam-utils", ++ "memoffset 0.7.1", ++ "scopeguard", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "crypto-common" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" ++dependencies = [ ++ "generic-array", ++ "typenum", ++] ++ ++[[package]] ++name = "cstr_core" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" ++dependencies = [ ++ "cty", ++ "memchr", ++] ++ ++[[package]] ++name = "cty" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" ++ ++[[package]] ++name = "darling" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" ++dependencies = [ ++ "darling_core", ++ "darling_macro", ++] ++ ++[[package]] ++name = "darling_core" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" ++dependencies = [ ++ "fnv", ++ "ident_case", ++ "proc-macro2", ++ "quote", ++ "strsim", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "darling_macro" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" ++dependencies = [ ++ "darling_core", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "deranged" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" ++dependencies = [ ++ "powerfmt", ++] ++ ++[[package]] ++name = "digest" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" ++dependencies = [ ++ "block-buffer", ++ "crypto-common", ++ "subtle", ++] ++ ++[[package]] ++name = "dirs" ++version = "4.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" ++dependencies = [ ++ "dirs-sys", ++] ++ ++[[package]] ++name = "dirs-sys" ++version = "0.3.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" ++dependencies = [ ++ "libc", ++ "redox_users", ++ "winapi", ++] ++ ++[[package]] ++name = "either" ++version = "1.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" ++ ++[[package]] ++name = "eyre" ++version = "0.6.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" ++dependencies = [ ++ "indenter", ++ "once_cell", ++] ++ ++[[package]] ++name = "fallible-iterator" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" ++ ++[[package]] ++name = "fixedbitset" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" ++ ++[[package]] ++name = "fnv" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" ++ ++[[package]] ++name = "form_urlencoded" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" ++dependencies = [ ++ "percent-encoding", ++] ++ ++[[package]] ++name = "funty" ++version = "2.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" ++ ++[[package]] ++name = "futures" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-executor", ++ "futures-io", ++ "futures-sink", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-channel" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" ++dependencies = [ ++ "futures-core", ++ "futures-sink", ++] ++ ++[[package]] ++name = "futures-core" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" ++ ++[[package]] ++name = "futures-executor" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" ++dependencies = [ ++ "futures-core", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-io" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" ++ ++[[package]] ++name = "futures-macro" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "futures-sink" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" ++ ++[[package]] ++name = "futures-task" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" ++ ++[[package]] ++name = "futures-util" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-io", ++ "futures-macro", ++ "futures-sink", ++ "futures-task", ++ "memchr", ++ "pin-project-lite", ++ "pin-utils", ++ "slab", ++] ++ ++[[package]] ++name = "generic-array" ++version = "0.14.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" ++dependencies = [ ++ "typenum", ++ "version_check", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "wasi", ++] ++ ++[[package]] ++name = "glob" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" ++ ++[[package]] ++name = "graphql-parser" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" ++dependencies = [ ++ "combine", ++ "thiserror", ++] ++ ++[[package]] ++name = "half" ++version = "1.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" ++ ++[[package]] ++name = "hash32" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" ++dependencies = [ ++ "byteorder", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" ++ ++[[package]] ++name = "heapless" ++version = "0.7.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" ++dependencies = [ ++ "atomic-polyfill", ++ "hash32", ++ "rustc_version 0.4.0", ++ "spin", ++ "stable_deref_trait", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.1.19" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hermit-abi" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hmac" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "ident_case" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" ++ ++[[package]] ++name = "idna" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "indenter" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" ++ ++[[package]] ++name = "indexmap" ++version = "1.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" ++dependencies = [ ++ "autocfg", ++ "hashbrown", ++] ++ ++[[package]] ++name = "itertools" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" ++dependencies = [ ++ "either", ++] ++ ++[[package]] ++name = "itoa" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "lazycell" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" ++ ++[[package]] ++name = "libc" ++version = "0.2.146" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++ ++[[package]] ++name = "libloading" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" ++dependencies = [ ++ "cfg-if", ++ "winapi", ++] ++ ++[[package]] ++name = "lock_api" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" ++dependencies = [ ++ "autocfg", ++ "scopeguard", ++] ++ ++[[package]] ++name = "log" ++version = "0.4.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "matchers" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" ++dependencies = [ ++ "regex-automata", ++] ++ ++[[package]] ++name = "md-5" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" ++ ++[[package]] ++name = "memoffset" ++version = "0.6.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "memoffset" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "minimal-lexical" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" ++ ++[[package]] ++name = "mio" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" ++dependencies = [ ++ "libc", ++ "log", ++ "wasi", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "nom" ++version = "7.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" ++dependencies = [ ++ "memchr", ++ "minimal-lexical", ++] ++ ++[[package]] ++name = "nu-ansi-term" ++version = "0.46.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" ++dependencies = [ ++ "overload", ++ "winapi", ++] ++ ++[[package]] ++name = "num-conv" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" ++ ++[[package]] ++name = "num_cpus" ++version = "1.15.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" ++dependencies = [ ++ "hermit-abi 0.2.6", ++ "libc", ++] ++ ++[[package]] ++name = "once_cell" ++version = "1.18.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" ++ ++[[package]] ++name = "overload" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" ++ ++[[package]] ++name = "owo-colors" ++version = "3.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" ++ ++[[package]] ++name = "parking_lot" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" ++dependencies = [ ++ "lock_api", ++ "parking_lot_core", ++] ++ ++[[package]] ++name = "parking_lot_core" ++version = "0.9.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "redox_syscall", ++ "smallvec", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "peeking_take_while" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" ++ ++[[package]] ++name = "percent-encoding" ++version = "2.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" ++ ++[[package]] ++name = "pest" ++version = "2.5.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" ++dependencies = [ ++ "thiserror", ++ "ucd-trie", ++] ++ ++[[package]] ++name = "petgraph" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" ++dependencies = [ ++ "fixedbitset", ++ "indexmap", ++] ++ ++[[package]] ++name = "pg_graphql" ++version = "1.1.0" ++dependencies = [ ++ "base64", ++ "cached", ++ "graphql-parser", ++ "itertools", ++ "lazy_static", ++ "pgx", ++ "pgx-contrib-spiext", ++ "pgx-tests", ++ "rand", ++ "regex", ++ "serde", ++ "serde_json", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "708693428ee16491645c1c2795f6777a78b9b1d08ab2e481a82b7977c9814b56" ++dependencies = [ ++ "atomic-traits", ++ "bitflags", ++ "bitvec", ++ "cstr_core", ++ "eyre", ++ "heapless", ++ "libc", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-sys", ++ "pgx-utils", ++ "quote", ++ "seahash", ++ "seq-macro", ++ "serde", ++ "serde_cbor", ++ "serde_json", ++ "thiserror", ++ "time", ++ "tracing", ++ "tracing-error", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx-contrib-spiext" ++version = "0.1.0" ++source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=153ad2db8bb8634332ad36ffc66dcb017353bf93#153ad2db8bb8634332ad36ffc66dcb017353bf93" ++dependencies = [ ++ "pgx", ++] ++ ++[[package]] ++name = "pgx-macros" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0050ca15df7dbfe718f9006d2b9a38d2a00a40934d8154450cdde6323b58b690" ++dependencies = [ ++ "pgx-utils", ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++ "unescape", ++] ++ ++[[package]] ++name = "pgx-pg-config" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "000bba0f67f2aa20e971a6127a8971bd85a6b724d3e95d9066f64816de3b4e67" ++dependencies = [ ++ "dirs", ++ "eyre", ++ "owo-colors", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "toml", ++ "url", ++] ++ ++[[package]] ++name = "pgx-pg-sys" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b6bd3fd6e1bcbfed67da7ac2dc71986a9f1396aeaec3d449d0697eb54909b34a" ++dependencies = [ ++ "bindgen", ++ "eyre", ++ "libc", ++ "memoffset 0.6.5", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-config", ++ "pgx-utils", ++ "proc-macro2", ++ "quote", ++ "rayon", ++ "shlex", ++ "sptr", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "pgx-tests" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "44db59e5a5473f9192cff05a284677b8b491bffcf85dcc7b892339f084ad2f2b" ++dependencies = [ ++ "eyre", ++ "libc", ++ "once_cell", ++ "owo-colors", ++ "pgx", ++ "pgx-macros", ++ "pgx-pg-config", ++ "pgx-utils", ++ "postgres", ++ "regex", ++ "serde", ++ "serde_json", ++ "thiserror", ++ "time", ++] ++ ++[[package]] ++name = "pgx-utils" ++version = "0.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "62cdc413efcd90a1e94c7f09dea24ec1ecfa1275350cbe378a8776eb7b5448f9" ++dependencies = [ ++ "atty", ++ "convert_case", ++ "cstr_core", ++ "eyre", ++ "petgraph", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "seq-macro", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "syn 1.0.109", ++ "tracing", ++ "tracing-error", ++ "tracing-subscriber", ++ "unescape", ++] ++ ++[[package]] ++name = "phf" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" ++dependencies = [ ++ "phf_shared", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" ++dependencies = [ ++ "siphasher", ++] ++ ++[[package]] ++name = "pin-project-lite" ++version = "0.2.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" ++ ++[[package]] ++name = "pin-utils" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" ++ ++[[package]] ++name = "postgres" ++version = "0.19.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "futures-util", ++ "log", ++ "tokio", ++ "tokio-postgres", ++] ++ ++[[package]] ++name = "postgres-protocol" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" ++dependencies = [ ++ "base64", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "hmac", ++ "md-5", ++ "memchr", ++ "rand", ++ "sha2", ++ "stringprep", ++] ++ ++[[package]] ++name = "postgres-types" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "postgres-protocol", ++] ++ ++[[package]] ++name = "powerfmt" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.95" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "radium" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" ++ ++[[package]] ++name = "rand" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" ++dependencies = [ ++ "libc", ++ "rand_chacha", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "rayon" ++version = "1.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" ++dependencies = [ ++ "either", ++ "rayon-core", ++] ++ ++[[package]] ++name = "rayon-core" ++version = "1.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" ++dependencies = [ ++ "crossbeam-channel", ++ "crossbeam-deque", ++ "crossbeam-utils", ++ "num_cpus", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.2.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" ++dependencies = [ ++ "bitflags", ++] ++ ++[[package]] ++name = "redox_users" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" ++dependencies = [ ++ "getrandom", ++ "redox_syscall", ++ "thiserror", ++] ++ ++[[package]] ++name = "regex" ++version = "1.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax 0.7.2", ++] ++ ++[[package]] ++name = "regex-automata" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" ++dependencies = [ ++ "regex-syntax 0.6.29", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.29" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" ++ ++[[package]] ++name = "regex-syntax" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" ++ ++[[package]] ++name = "rustc-hash" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" ++ ++[[package]] ++name = "rustc_version" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" ++dependencies = [ ++ "semver 0.11.0", ++] ++ ++[[package]] ++name = "rustc_version" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" ++dependencies = [ ++ "semver 1.0.16", ++] ++ ++[[package]] ++name = "ryu" ++version = "1.0.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" ++ ++[[package]] ++name = "scopeguard" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" ++ ++[[package]] ++name = "seahash" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" ++ ++[[package]] ++name = "semver" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" ++dependencies = [ ++ "semver-parser", ++] ++ ++[[package]] ++name = "semver" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" ++ ++[[package]] ++name = "semver-parser" ++version = "0.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" ++dependencies = [ ++ "pest", ++] ++ ++[[package]] ++name = "seq-macro" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" ++ ++[[package]] ++name = "serde" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_cbor" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" ++dependencies = [ ++ "half", ++ "serde", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.96" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" ++dependencies = [ ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "sha2" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" ++dependencies = [ ++ "cfg-if", ++ "cpufeatures", ++ "digest", ++] ++ ++[[package]] ++name = "sharded-slab" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" ++dependencies = [ ++ "lazy_static", ++] ++ ++[[package]] ++name = "shlex" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" ++ ++[[package]] ++name = "siphasher" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" ++ ++[[package]] ++name = "slab" ++version = "0.4.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "smallvec" ++version = "1.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" ++ ++[[package]] ++name = "socket2" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" ++dependencies = [ ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "socket2" ++version = "0.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" ++dependencies = [ ++ "libc", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "spin" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" ++dependencies = [ ++ "lock_api", ++] ++ ++[[package]] ++name = "sptr" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" ++ ++[[package]] ++name = "stable_deref_trait" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" ++ ++[[package]] ++name = "stringprep" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "strsim" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" ++ ++[[package]] ++name = "subtle" ++version = "2.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" ++ ++[[package]] ++name = "syn" ++version = "1.0.109" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "syn" ++version = "2.0.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "tap" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" ++ ++[[package]] ++name = "thiserror" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" ++dependencies = [ ++ "thiserror-impl", ++] ++ ++[[package]] ++name = "thiserror-impl" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "thread_local" ++version = "1.1.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "time" ++version = "0.3.41" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" ++dependencies = [ ++ "deranged", ++ "itoa", ++ "num-conv", ++ "powerfmt", ++ "serde", ++ "time-core", ++ "time-macros", ++] ++ ++[[package]] ++name = "time-core" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" ++ ++[[package]] ++name = "time-macros" ++version = "0.2.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" ++dependencies = [ ++ "num-conv", ++ "time-core", ++] ++ ++[[package]] ++name = "tinyvec" ++version = "1.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" ++dependencies = [ ++ "tinyvec_macros", ++] ++ ++[[package]] ++name = "tinyvec_macros" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" ++ ++[[package]] ++name = "tokio" ++version = "1.28.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" ++dependencies = [ ++ "autocfg", ++ "bytes", ++ "libc", ++ "mio", ++ "num_cpus", ++ "pin-project-lite", ++ "socket2 0.4.9", ++ "tokio-macros", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "tokio-macros" ++version = "2.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tokio-postgres" ++version = "0.7.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" ++dependencies = [ ++ "async-trait", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "futures-channel", ++ "futures-util", ++ "log", ++ "parking_lot", ++ "percent-encoding", ++ "phf", ++ "pin-project-lite", ++ "postgres-protocol", ++ "postgres-types", ++ "socket2 0.5.3", ++ "tokio", ++ "tokio-util", ++] ++ ++[[package]] ++name = "tokio-util" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" ++dependencies = [ ++ "bytes", ++ "futures-core", ++ "futures-sink", ++ "pin-project-lite", ++ "tokio", ++ "tracing", ++] ++ ++[[package]] ++name = "toml" ++version = "0.5.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "tracing" ++version = "0.1.37" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" ++dependencies = [ ++ "cfg-if", ++ "pin-project-lite", ++ "tracing-attributes", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-attributes" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tracing-core" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" ++dependencies = [ ++ "once_cell", ++ "valuable", ++] ++ ++[[package]] ++name = "tracing-error" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" ++dependencies = [ ++ "tracing", ++ "tracing-subscriber", ++] ++ ++[[package]] ++name = "tracing-log" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" ++dependencies = [ ++ "log", ++ "once_cell", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-subscriber" ++version = "0.3.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" ++dependencies = [ ++ "matchers", ++ "nu-ansi-term", ++ "once_cell", ++ "regex", ++ "sharded-slab", ++ "smallvec", ++ "thread_local", ++ "tracing", ++ "tracing-core", ++ "tracing-log", ++] ++ ++[[package]] ++name = "typenum" ++version = "1.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" ++ ++[[package]] ++name = "ucd-trie" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" ++ ++[[package]] ++name = "unescape" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" ++ ++[[package]] ++name = "unicode-bidi" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" ++ ++[[package]] ++name = "unicode-ident" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" ++ ++[[package]] ++name = "unicode-normalization" ++version = "0.1.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" ++dependencies = [ ++ "tinyvec", ++] ++ ++[[package]] ++name = "unreachable" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" ++dependencies = [ ++ "void", ++] ++ ++[[package]] ++name = "url" ++version = "2.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" ++dependencies = [ ++ "form_urlencoded", ++ "idna", ++ "percent-encoding", ++] ++ ++[[package]] ++name = "uuid" ++version = "1.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "valuable" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" ++ ++[[package]] ++name = "version_check" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" ++ ++[[package]] ++name = "void" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" ++ ++[[package]] ++name = "wasi" ++version = "0.11.0+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++ ++[[package]] ++name = "windows-sys" ++version = "0.42.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.42.1", ++ "windows_aarch64_msvc 0.42.1", ++ "windows_i686_gnu 0.42.1", ++ "windows_i686_msvc 0.42.1", ++ "windows_x86_64_gnu 0.42.1", ++ "windows_x86_64_gnullvm 0.42.1", ++ "windows_x86_64_msvc 0.42.1", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" ++dependencies = [ ++ "windows-targets", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.48.0", ++ "windows_aarch64_msvc 0.48.0", ++ "windows_i686_gnu 0.48.0", ++ "windows_i686_msvc 0.48.0", ++ "windows_x86_64_gnu 0.48.0", ++ "windows_x86_64_gnullvm 0.48.0", ++ "windows_x86_64_msvc 0.48.0", ++] ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" ++ ++[[package]] ++name = "wyz" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" ++dependencies = [ ++ "tap", ++] +-- +2.49.0 + diff --git a/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.2.0.patch b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.2.0.patch new file mode 100644 index 000000000..f577af013 --- /dev/null +++ b/nix/ext/pg_graphql/0001-Add-missing-Cargo.lock-1.2.0.patch @@ -0,0 +1,2081 @@ +From e1942477103b907bb01f5dee285575f6fb42f14f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= +Date: Tue, 17 Jun 2025 18:05:46 +0200 +Subject: [PATCH 1/2] Add missing Cargo.lock + +--- + .gitignore | 1 - + Cargo.lock | 2051 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 2051 insertions(+), 1 deletion(-) + create mode 100644 Cargo.lock + +diff --git a/.gitignore b/.gitignore +index 1105584..117981b 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -18,5 +18,4 @@ docs/graphql_lexer/ + perf.txt + query.txt + schema.graphql +-Cargo.lock + target/ +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +index 0000000..5ac0c4b +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,2051 @@ ++# This file is automatically @generated by Cargo. ++# It is not intended for manual editing. ++version = 3 ++ ++[[package]] ++name = "aho-corasick" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" ++dependencies = [ ++ "memchr", ++] ++ ++[[package]] ++name = "anyhow" ++version = "1.0.69" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" ++ ++[[package]] ++name = "ascii" ++version = "0.9.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" ++ ++[[package]] ++name = "async-trait" ++version = "0.1.64" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "async_once" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" ++ ++[[package]] ++name = "atomic-polyfill" ++version = "0.1.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" ++dependencies = [ ++ "critical-section", ++] ++ ++[[package]] ++name = "atomic-traits" ++version = "0.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" ++dependencies = [ ++ "cfg-if", ++ "rustc_version 0.3.3", ++] ++ ++[[package]] ++name = "autocfg" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" ++ ++[[package]] ++name = "base64" ++version = "0.13.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" ++ ++[[package]] ++name = "bindgen" ++version = "0.60.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" ++dependencies = [ ++ "bitflags", ++ "cexpr", ++ "clang-sys", ++ "lazy_static", ++ "lazycell", ++ "peeking_take_while", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "rustc-hash", ++ "shlex", ++] ++ ++[[package]] ++name = "bitflags" ++version = "1.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" ++ ++[[package]] ++name = "bitvec" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" ++dependencies = [ ++ "funty", ++ "radium", ++ "tap", ++ "wyz", ++] ++ ++[[package]] ++name = "block-buffer" ++version = "0.10.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" ++dependencies = [ ++ "generic-array", ++] ++ ++[[package]] ++name = "byteorder" ++version = "1.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" ++ ++[[package]] ++name = "bytes" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" ++ ++[[package]] ++name = "cached" ++version = "0.34.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" ++dependencies = [ ++ "async-trait", ++ "async_once", ++ "cached_proc_macro", ++ "cached_proc_macro_types", ++ "futures", ++ "hashbrown", ++ "lazy_static", ++ "once_cell", ++ "thiserror", ++ "tokio", ++] ++ ++[[package]] ++name = "cached_proc_macro" ++version = "0.12.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" ++dependencies = [ ++ "cached_proc_macro_types", ++ "darling", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "cached_proc_macro_types" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" ++ ++[[package]] ++name = "cexpr" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" ++dependencies = [ ++ "nom", ++] ++ ++[[package]] ++name = "cfg-if" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" ++ ++[[package]] ++name = "clang-sys" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" ++dependencies = [ ++ "glob", ++ "libc", ++ "libloading", ++] ++ ++[[package]] ++name = "clap" ++version = "4.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" ++dependencies = [ ++ "bitflags", ++ "clap_derive", ++ "clap_lex", ++ "once_cell", ++] ++ ++[[package]] ++name = "clap-cargo" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eca953650a7350560b61db95a0ab1d9c6f7b74d146a9e08fb258b834f3cf7e2c" ++dependencies = [ ++ "clap", ++ "doc-comment", ++] ++ ++[[package]] ++name = "clap_derive" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" ++dependencies = [ ++ "heck", ++ "proc-macro-error", ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "clap_lex" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" ++dependencies = [ ++ "os_str_bytes", ++] ++ ++[[package]] ++name = "combine" ++version = "3.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" ++dependencies = [ ++ "ascii", ++ "byteorder", ++ "either", ++ "memchr", ++ "unreachable", ++] ++ ++[[package]] ++name = "convert_case" ++version = "0.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" ++ ++[[package]] ++name = "core-foundation-sys" ++version = "0.8.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" ++ ++[[package]] ++name = "cpufeatures" ++version = "0.2.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "critical-section" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" ++ ++[[package]] ++name = "crossbeam-channel" ++version = "0.5.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-deque" ++version = "0.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" ++dependencies = [ ++ "cfg-if", ++ "crossbeam-epoch", ++ "crossbeam-utils", ++] ++ ++[[package]] ++name = "crossbeam-epoch" ++version = "0.9.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" ++dependencies = [ ++ "autocfg", ++ "cfg-if", ++ "crossbeam-utils", ++ "memoffset 0.7.1", ++ "scopeguard", ++] ++ ++[[package]] ++name = "crossbeam-utils" ++version = "0.8.14" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "crypto-common" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" ++dependencies = [ ++ "generic-array", ++ "typenum", ++] ++ ++[[package]] ++name = "darling" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" ++dependencies = [ ++ "darling_core", ++ "darling_macro", ++] ++ ++[[package]] ++name = "darling_core" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" ++dependencies = [ ++ "fnv", ++ "ident_case", ++ "proc-macro2", ++ "quote", ++ "strsim", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "darling_macro" ++version = "0.13.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" ++dependencies = [ ++ "darling_core", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "deranged" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" ++dependencies = [ ++ "powerfmt", ++] ++ ++[[package]] ++name = "digest" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" ++dependencies = [ ++ "block-buffer", ++ "crypto-common", ++ "subtle", ++] ++ ++[[package]] ++name = "dirs" ++version = "4.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" ++dependencies = [ ++ "dirs-sys", ++] ++ ++[[package]] ++name = "dirs-sys" ++version = "0.3.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" ++dependencies = [ ++ "libc", ++ "redox_users", ++ "winapi", ++] ++ ++[[package]] ++name = "doc-comment" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" ++ ++[[package]] ++name = "either" ++version = "1.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" ++ ++[[package]] ++name = "eyre" ++version = "0.6.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" ++dependencies = [ ++ "indenter", ++ "once_cell", ++] ++ ++[[package]] ++name = "fallible-iterator" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" ++ ++[[package]] ++name = "fixedbitset" ++version = "0.4.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" ++ ++[[package]] ++name = "fnv" ++version = "1.0.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" ++ ++[[package]] ++name = "form_urlencoded" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" ++dependencies = [ ++ "percent-encoding", ++] ++ ++[[package]] ++name = "funty" ++version = "2.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" ++ ++[[package]] ++name = "futures" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-executor", ++ "futures-io", ++ "futures-sink", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-channel" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" ++dependencies = [ ++ "futures-core", ++ "futures-sink", ++] ++ ++[[package]] ++name = "futures-core" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" ++ ++[[package]] ++name = "futures-executor" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" ++dependencies = [ ++ "futures-core", ++ "futures-task", ++ "futures-util", ++] ++ ++[[package]] ++name = "futures-io" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" ++ ++[[package]] ++name = "futures-macro" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "futures-sink" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" ++ ++[[package]] ++name = "futures-task" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" ++ ++[[package]] ++name = "futures-util" ++version = "0.3.26" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" ++dependencies = [ ++ "futures-channel", ++ "futures-core", ++ "futures-io", ++ "futures-macro", ++ "futures-sink", ++ "futures-task", ++ "memchr", ++ "pin-project-lite", ++ "pin-utils", ++ "slab", ++] ++ ++[[package]] ++name = "generic-array" ++version = "0.14.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" ++dependencies = [ ++ "typenum", ++ "version_check", ++] ++ ++[[package]] ++name = "getrandom" ++version = "0.2.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "wasi", ++] ++ ++[[package]] ++name = "glob" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" ++ ++[[package]] ++name = "graphql-parser" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" ++dependencies = [ ++ "combine", ++ "thiserror", ++] ++ ++[[package]] ++name = "half" ++version = "1.8.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" ++ ++[[package]] ++name = "hash32" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" ++dependencies = [ ++ "byteorder", ++] ++ ++[[package]] ++name = "hashbrown" ++version = "0.12.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" ++ ++[[package]] ++name = "heapless" ++version = "0.7.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" ++dependencies = [ ++ "atomic-polyfill", ++ "hash32", ++ "rustc_version 0.4.0", ++ "spin", ++ "stable_deref_trait", ++] ++ ++[[package]] ++name = "heck" ++version = "0.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" ++ ++[[package]] ++name = "hermit-abi" ++version = "0.2.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" ++dependencies = [ ++ "libc", ++] ++ ++[[package]] ++name = "hmac" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "ident_case" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" ++ ++[[package]] ++name = "idna" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "indenter" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" ++ ++[[package]] ++name = "indexmap" ++version = "1.9.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" ++dependencies = [ ++ "autocfg", ++ "hashbrown", ++] ++ ++[[package]] ++name = "itertools" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" ++dependencies = [ ++ "either", ++] ++ ++[[package]] ++name = "itoa" ++version = "1.0.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" ++ ++[[package]] ++name = "lazy_static" ++version = "1.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ++ ++[[package]] ++name = "lazycell" ++version = "1.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" ++ ++[[package]] ++name = "libc" ++version = "0.2.146" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" ++ ++[[package]] ++name = "libloading" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" ++dependencies = [ ++ "cfg-if", ++ "winapi", ++] ++ ++[[package]] ++name = "lock_api" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" ++dependencies = [ ++ "autocfg", ++ "scopeguard", ++] ++ ++[[package]] ++name = "log" ++version = "0.4.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "matchers" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" ++dependencies = [ ++ "regex-automata", ++] ++ ++[[package]] ++name = "md-5" ++version = "0.10.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" ++dependencies = [ ++ "digest", ++] ++ ++[[package]] ++name = "memchr" ++version = "2.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" ++ ++[[package]] ++name = "memoffset" ++version = "0.6.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "memoffset" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "minimal-lexical" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" ++ ++[[package]] ++name = "mio" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" ++dependencies = [ ++ "libc", ++ "log", ++ "wasi", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "nom" ++version = "7.1.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" ++dependencies = [ ++ "memchr", ++ "minimal-lexical", ++] ++ ++[[package]] ++name = "ntapi" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" ++dependencies = [ ++ "winapi", ++] ++ ++[[package]] ++name = "nu-ansi-term" ++version = "0.46.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" ++dependencies = [ ++ "overload", ++ "winapi", ++] ++ ++[[package]] ++name = "num-conv" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" ++ ++[[package]] ++name = "num_cpus" ++version = "1.15.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" ++dependencies = [ ++ "hermit-abi", ++ "libc", ++] ++ ++[[package]] ++name = "once_cell" ++version = "1.18.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" ++ ++[[package]] ++name = "os_str_bytes" ++version = "6.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" ++ ++[[package]] ++name = "overload" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" ++ ++[[package]] ++name = "owo-colors" ++version = "3.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" ++ ++[[package]] ++name = "parking_lot" ++version = "0.12.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" ++dependencies = [ ++ "lock_api", ++ "parking_lot_core", ++] ++ ++[[package]] ++name = "parking_lot_core" ++version = "0.9.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" ++dependencies = [ ++ "cfg-if", ++ "libc", ++ "redox_syscall", ++ "smallvec", ++ "windows-sys 0.42.0", ++] ++ ++[[package]] ++name = "pathsearch" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da983bc5e582ab17179c190b4b66c7d76c5943a69c6d34df2a2b6bf8a2977b05" ++dependencies = [ ++ "anyhow", ++ "libc", ++] ++ ++[[package]] ++name = "peeking_take_while" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" ++ ++[[package]] ++name = "percent-encoding" ++version = "2.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" ++ ++[[package]] ++name = "pest" ++version = "2.5.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" ++dependencies = [ ++ "thiserror", ++ "ucd-trie", ++] ++ ++[[package]] ++name = "petgraph" ++version = "0.6.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" ++dependencies = [ ++ "fixedbitset", ++ "indexmap", ++] ++ ++[[package]] ++name = "pg_graphql" ++version = "1.2.0" ++dependencies = [ ++ "base64", ++ "cached", ++ "graphql-parser", ++ "itertools", ++ "lazy_static", ++ "pgx", ++ "pgx-contrib-spiext", ++ "pgx-tests", ++ "rand", ++ "regex", ++ "serde", ++ "serde_json", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc91f19f84e7c1ba7b25953b042bd487b6e1bbec4c3af09f61a6ac31207ff776" ++dependencies = [ ++ "atomic-traits", ++ "bitflags", ++ "bitvec", ++ "heapless", ++ "libc", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-sys", ++ "pgx-sql-entity-graph", ++ "seahash", ++ "seq-macro", ++ "serde", ++ "serde_cbor", ++ "serde_json", ++ "thiserror", ++ "time", ++ "tracing", ++ "tracing-error", ++ "uuid", ++] ++ ++[[package]] ++name = "pgx-contrib-spiext" ++version = "0.1.0" ++source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=a346053#a346053dd246400076797a002c66c80a56a20435" ++dependencies = [ ++ "pgx", ++ "thiserror", ++] ++ ++[[package]] ++name = "pgx-macros" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1ebfde3c33353d42c2fbcc76bea758b37018b33b1391c93d6402546569914e94" ++dependencies = [ ++ "pgx-sql-entity-graph", ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "pgx-pg-config" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e97c27bab88fdb7b94e549b02267ab9595bd9d1043718d6d72bc2d34cf1e3952" ++dependencies = [ ++ "dirs", ++ "eyre", ++ "owo-colors", ++ "pathsearch", ++ "serde", ++ "serde_derive", ++ "serde_json", ++ "toml", ++ "url", ++] ++ ++[[package]] ++name = "pgx-pg-sys" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6b79c48c564bed305d202b852321603107e5f3ac31f25ea2cc4031475f38d0b3" ++dependencies = [ ++ "bindgen", ++ "eyre", ++ "libc", ++ "memoffset 0.6.5", ++ "once_cell", ++ "pgx-macros", ++ "pgx-pg-config", ++ "pgx-sql-entity-graph", ++ "proc-macro2", ++ "quote", ++ "serde", ++ "shlex", ++ "sptr", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "pgx-sql-entity-graph" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "573a8d8c23be24c39f7b7fbbc7e15d95aa0327acd61ba95c9c9f237fec51f205" ++dependencies = [ ++ "convert_case", ++ "eyre", ++ "petgraph", ++ "proc-macro2", ++ "quote", ++ "regex", ++ "seq-macro", ++ "syn 1.0.109", ++ "tracing", ++ "tracing-error", ++ "tracing-subscriber", ++ "unescape", ++] ++ ++[[package]] ++name = "pgx-tests" ++version = "0.7.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fc09f25ae560bc4e3308022999416966beda5b60d2957b9ab92bffaf2d6a86c3" ++dependencies = [ ++ "clap-cargo", ++ "eyre", ++ "libc", ++ "once_cell", ++ "owo-colors", ++ "pgx", ++ "pgx-macros", ++ "pgx-pg-config", ++ "postgres", ++ "regex", ++ "serde", ++ "serde_json", ++ "sysinfo", ++ "thiserror", ++ "time", ++] ++ ++[[package]] ++name = "phf" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" ++dependencies = [ ++ "phf_shared", ++] ++ ++[[package]] ++name = "phf_shared" ++version = "0.11.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" ++dependencies = [ ++ "siphasher", ++] ++ ++[[package]] ++name = "pin-project-lite" ++version = "0.2.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" ++ ++[[package]] ++name = "pin-utils" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" ++ ++[[package]] ++name = "postgres" ++version = "0.19.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "futures-util", ++ "log", ++ "tokio", ++ "tokio-postgres", ++] ++ ++[[package]] ++name = "postgres-protocol" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" ++dependencies = [ ++ "base64", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "hmac", ++ "md-5", ++ "memchr", ++ "rand", ++ "sha2", ++ "stringprep", ++] ++ ++[[package]] ++name = "postgres-types" ++version = "0.2.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" ++dependencies = [ ++ "bytes", ++ "fallible-iterator", ++ "postgres-protocol", ++] ++ ++[[package]] ++name = "powerfmt" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" ++ ++[[package]] ++name = "ppv-lite86" ++version = "0.2.17" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" ++ ++[[package]] ++name = "proc-macro-error" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" ++dependencies = [ ++ "proc-macro-error-attr", ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++ "version_check", ++] ++ ++[[package]] ++name = "proc-macro-error-attr" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "version_check", ++] ++ ++[[package]] ++name = "proc-macro2" ++version = "1.0.95" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" ++dependencies = [ ++ "unicode-ident", ++] ++ ++[[package]] ++name = "quote" ++version = "1.0.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" ++dependencies = [ ++ "proc-macro2", ++] ++ ++[[package]] ++name = "radium" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" ++ ++[[package]] ++name = "rand" ++version = "0.8.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" ++dependencies = [ ++ "libc", ++ "rand_chacha", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_chacha" ++version = "0.3.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++dependencies = [ ++ "ppv-lite86", ++ "rand_core", ++] ++ ++[[package]] ++name = "rand_core" ++version = "0.6.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "rayon" ++version = "1.6.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" ++dependencies = [ ++ "either", ++ "rayon-core", ++] ++ ++[[package]] ++name = "rayon-core" ++version = "1.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" ++dependencies = [ ++ "crossbeam-channel", ++ "crossbeam-deque", ++ "crossbeam-utils", ++ "num_cpus", ++] ++ ++[[package]] ++name = "redox_syscall" ++version = "0.2.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" ++dependencies = [ ++ "bitflags", ++] ++ ++[[package]] ++name = "redox_users" ++version = "0.4.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" ++dependencies = [ ++ "getrandom", ++ "redox_syscall", ++ "thiserror", ++] ++ ++[[package]] ++name = "regex" ++version = "1.8.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" ++dependencies = [ ++ "aho-corasick", ++ "memchr", ++ "regex-syntax 0.7.2", ++] ++ ++[[package]] ++name = "regex-automata" ++version = "0.1.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" ++dependencies = [ ++ "regex-syntax 0.6.29", ++] ++ ++[[package]] ++name = "regex-syntax" ++version = "0.6.29" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" ++ ++[[package]] ++name = "regex-syntax" ++version = "0.7.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" ++ ++[[package]] ++name = "rustc-hash" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" ++ ++[[package]] ++name = "rustc_version" ++version = "0.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" ++dependencies = [ ++ "semver 0.11.0", ++] ++ ++[[package]] ++name = "rustc_version" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" ++dependencies = [ ++ "semver 1.0.16", ++] ++ ++[[package]] ++name = "ryu" ++version = "1.0.12" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" ++ ++[[package]] ++name = "scopeguard" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" ++ ++[[package]] ++name = "seahash" ++version = "4.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" ++ ++[[package]] ++name = "semver" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" ++dependencies = [ ++ "semver-parser", ++] ++ ++[[package]] ++name = "semver" ++version = "1.0.16" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" ++ ++[[package]] ++name = "semver-parser" ++version = "0.10.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" ++dependencies = [ ++ "pest", ++] ++ ++[[package]] ++name = "seq-macro" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" ++ ++[[package]] ++name = "serde" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" ++dependencies = [ ++ "serde_derive", ++] ++ ++[[package]] ++name = "serde_cbor" ++version = "0.11.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" ++dependencies = [ ++ "half", ++ "serde", ++] ++ ++[[package]] ++name = "serde_derive" ++version = "1.0.193" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "serde_json" ++version = "1.0.96" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" ++dependencies = [ ++ "itoa", ++ "ryu", ++ "serde", ++] ++ ++[[package]] ++name = "sha2" ++version = "0.10.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" ++dependencies = [ ++ "cfg-if", ++ "cpufeatures", ++ "digest", ++] ++ ++[[package]] ++name = "sharded-slab" ++version = "0.1.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" ++dependencies = [ ++ "lazy_static", ++] ++ ++[[package]] ++name = "shlex" ++version = "1.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" ++ ++[[package]] ++name = "siphasher" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" ++ ++[[package]] ++name = "slab" ++version = "0.4.7" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" ++dependencies = [ ++ "autocfg", ++] ++ ++[[package]] ++name = "smallvec" ++version = "1.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" ++ ++[[package]] ++name = "socket2" ++version = "0.4.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" ++dependencies = [ ++ "libc", ++ "winapi", ++] ++ ++[[package]] ++name = "socket2" ++version = "0.5.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" ++dependencies = [ ++ "libc", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "spin" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" ++dependencies = [ ++ "lock_api", ++] ++ ++[[package]] ++name = "sptr" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" ++ ++[[package]] ++name = "stable_deref_trait" ++version = "1.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" ++ ++[[package]] ++name = "stringprep" ++version = "0.1.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" ++dependencies = [ ++ "unicode-bidi", ++ "unicode-normalization", ++] ++ ++[[package]] ++name = "strsim" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" ++ ++[[package]] ++name = "subtle" ++version = "2.4.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" ++ ++[[package]] ++name = "syn" ++version = "1.0.109" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "syn" ++version = "2.0.43" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "unicode-ident", ++] ++ ++[[package]] ++name = "sysinfo" ++version = "0.27.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "a902e9050fca0a5d6877550b769abd2bd1ce8c04634b941dbe2809735e1a1e33" ++dependencies = [ ++ "cfg-if", ++ "core-foundation-sys", ++ "libc", ++ "ntapi", ++ "once_cell", ++ "rayon", ++ "winapi", ++] ++ ++[[package]] ++name = "tap" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" ++ ++[[package]] ++name = "thiserror" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" ++dependencies = [ ++ "thiserror-impl", ++] ++ ++[[package]] ++name = "thiserror-impl" ++version = "1.0.38" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 1.0.109", ++] ++ ++[[package]] ++name = "thread_local" ++version = "1.1.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" ++dependencies = [ ++ "cfg-if", ++] ++ ++[[package]] ++name = "time" ++version = "0.3.41" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" ++dependencies = [ ++ "deranged", ++ "itoa", ++ "num-conv", ++ "powerfmt", ++ "serde", ++ "time-core", ++ "time-macros", ++] ++ ++[[package]] ++name = "time-core" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" ++ ++[[package]] ++name = "time-macros" ++version = "0.2.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" ++dependencies = [ ++ "num-conv", ++ "time-core", ++] ++ ++[[package]] ++name = "tinyvec" ++version = "1.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" ++dependencies = [ ++ "tinyvec_macros", ++] ++ ++[[package]] ++name = "tinyvec_macros" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" ++ ++[[package]] ++name = "tokio" ++version = "1.28.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" ++dependencies = [ ++ "autocfg", ++ "bytes", ++ "libc", ++ "mio", ++ "num_cpus", ++ "pin-project-lite", ++ "socket2 0.4.9", ++ "tokio-macros", ++ "windows-sys 0.48.0", ++] ++ ++[[package]] ++name = "tokio-macros" ++version = "2.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tokio-postgres" ++version = "0.7.8" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" ++dependencies = [ ++ "async-trait", ++ "byteorder", ++ "bytes", ++ "fallible-iterator", ++ "futures-channel", ++ "futures-util", ++ "log", ++ "parking_lot", ++ "percent-encoding", ++ "phf", ++ "pin-project-lite", ++ "postgres-protocol", ++ "postgres-types", ++ "socket2 0.5.3", ++ "tokio", ++ "tokio-util", ++] ++ ++[[package]] ++name = "tokio-util" ++version = "0.7.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" ++dependencies = [ ++ "bytes", ++ "futures-core", ++ "futures-sink", ++ "pin-project-lite", ++ "tokio", ++ "tracing", ++] ++ ++[[package]] ++name = "toml" ++version = "0.5.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" ++dependencies = [ ++ "serde", ++] ++ ++[[package]] ++name = "tracing" ++version = "0.1.37" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" ++dependencies = [ ++ "cfg-if", ++ "pin-project-lite", ++ "tracing-attributes", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-attributes" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" ++dependencies = [ ++ "proc-macro2", ++ "quote", ++ "syn 2.0.43", ++] ++ ++[[package]] ++name = "tracing-core" ++version = "0.1.30" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" ++dependencies = [ ++ "once_cell", ++ "valuable", ++] ++ ++[[package]] ++name = "tracing-error" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" ++dependencies = [ ++ "tracing", ++ "tracing-subscriber", ++] ++ ++[[package]] ++name = "tracing-log" ++version = "0.2.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" ++dependencies = [ ++ "log", ++ "once_cell", ++ "tracing-core", ++] ++ ++[[package]] ++name = "tracing-subscriber" ++version = "0.3.18" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" ++dependencies = [ ++ "matchers", ++ "nu-ansi-term", ++ "once_cell", ++ "regex", ++ "sharded-slab", ++ "smallvec", ++ "thread_local", ++ "tracing", ++ "tracing-core", ++ "tracing-log", ++] ++ ++[[package]] ++name = "typenum" ++version = "1.16.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" ++ ++[[package]] ++name = "ucd-trie" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" ++ ++[[package]] ++name = "unescape" ++version = "0.1.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" ++ ++[[package]] ++name = "unicode-bidi" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" ++ ++[[package]] ++name = "unicode-ident" ++version = "1.0.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" ++ ++[[package]] ++name = "unicode-normalization" ++version = "0.1.22" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" ++dependencies = [ ++ "tinyvec", ++] ++ ++[[package]] ++name = "unreachable" ++version = "1.0.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" ++dependencies = [ ++ "void", ++] ++ ++[[package]] ++name = "url" ++version = "2.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" ++dependencies = [ ++ "form_urlencoded", ++ "idna", ++ "percent-encoding", ++] ++ ++[[package]] ++name = "uuid" ++version = "1.3.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" ++dependencies = [ ++ "getrandom", ++] ++ ++[[package]] ++name = "valuable" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" ++ ++[[package]] ++name = "version_check" ++version = "0.9.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" ++ ++[[package]] ++name = "void" ++version = "1.0.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" ++ ++[[package]] ++name = "wasi" ++version = "0.11.0+wasi-snapshot-preview1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" ++ ++[[package]] ++name = "winapi" ++version = "0.3.9" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu", ++ "winapi-x86_64-pc-windows-gnu", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++ ++[[package]] ++name = "windows-sys" ++version = "0.42.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.42.1", ++ "windows_aarch64_msvc 0.42.1", ++ "windows_i686_gnu 0.42.1", ++ "windows_i686_msvc 0.42.1", ++ "windows_x86_64_gnu 0.42.1", ++ "windows_x86_64_gnullvm 0.42.1", ++ "windows_x86_64_msvc 0.42.1", ++] ++ ++[[package]] ++name = "windows-sys" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" ++dependencies = [ ++ "windows-targets", ++] ++ ++[[package]] ++name = "windows-targets" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" ++dependencies = [ ++ "windows_aarch64_gnullvm 0.48.0", ++ "windows_aarch64_msvc 0.48.0", ++ "windows_i686_gnu 0.48.0", ++ "windows_i686_msvc 0.48.0", ++ "windows_x86_64_gnu 0.48.0", ++ "windows_x86_64_gnullvm 0.48.0", ++ "windows_x86_64_msvc 0.48.0", ++] ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" ++ ++[[package]] ++name = "windows_aarch64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" ++ ++[[package]] ++name = "windows_aarch64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" ++ ++[[package]] ++name = "windows_i686_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" ++ ++[[package]] ++name = "windows_i686_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" ++ ++[[package]] ++name = "windows_x86_64_gnu" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" ++ ++[[package]] ++name = "windows_x86_64_gnullvm" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.42.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" ++ ++[[package]] ++name = "windows_x86_64_msvc" ++version = "0.48.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" ++ ++[[package]] ++name = "wyz" ++version = "0.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" ++dependencies = [ ++ "tap", ++] +-- +2.49.0 + diff --git a/nix/ext/pg_graphql/Cargo-1.0.2.lock b/nix/ext/pg_graphql/Cargo-1.0.2.lock new file mode 100644 index 000000000..00121254a --- /dev/null +++ b/nix/ext/pg_graphql/Cargo-1.0.2.lock @@ -0,0 +1,1961 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + +[[package]] +name = "atomic-polyfill" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cached" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" +dependencies = [ + "async-trait", + "async_once", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown", + "lazy_static", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" +dependencies = [ + "cached_proc_macro_types", + "darling", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.7.1", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cstr_core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" + +[[package]] +name = "futures-executor" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" + +[[package]] +name = "futures-macro" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-sink" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" + +[[package]] +name = "futures-task" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" + +[[package]] +name = "futures-util" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heapless" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.0", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.42.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_graphql" +version = "1.0.2" +dependencies = [ + "base64", + "cached", + "graphql-parser", + "itertools", + "lazy_static", + "pgx", + "pgx-contrib-spiext", + "pgx-tests", + "rand", + "regex", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "pgx" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708693428ee16491645c1c2795f6777a78b9b1d08ab2e481a82b7977c9814b56" +dependencies = [ + "atomic-traits", + "bitflags", + "bitvec", + "cstr_core", + "eyre", + "heapless", + "libc", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-utils", + "quote", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-contrib-spiext" +version = "0.1.0" +source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=153ad2db8bb8634332ad36ffc66dcb017353bf93#153ad2db8bb8634332ad36ffc66dcb017353bf93" +dependencies = [ + "pgx", +] + +[[package]] +name = "pgx-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0050ca15df7dbfe718f9006d2b9a38d2a00a40934d8154450cdde6323b58b690" +dependencies = [ + "pgx-utils", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgx-pg-config" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000bba0f67f2aa20e971a6127a8971bd85a6b724d3e95d9066f64816de3b4e67" +dependencies = [ + "dirs", + "eyre", + "owo-colors", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bd3fd6e1bcbfed67da7ac2dc71986a9f1396aeaec3d449d0697eb54909b34a" +dependencies = [ + "bindgen", + "eyre", + "libc", + "memoffset 0.6.5", + "once_cell", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "proc-macro2", + "quote", + "rayon", + "shlex", + "sptr", + "syn 1.0.109", +] + +[[package]] +name = "pgx-tests" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44db59e5a5473f9192cff05a284677b8b491bffcf85dcc7b892339f084ad2f2b" +dependencies = [ + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgx", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "postgres", + "regex", + "serde", + "serde_json", + "thiserror", + "time", +] + +[[package]] +name = "pgx-utils" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cdc413efcd90a1e94c7f09dea24ec1ecfa1275350cbe378a8776eb7b5448f9" +dependencies = [ + "atty", + "convert_case", + "cstr_core", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "regex", + "seq-macro", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", +] + +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" +dependencies = [ + "base64", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.16", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.4.9", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "socket2 0.5.3", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/nix/ext/pg_graphql/Cargo-1.1.0.lock b/nix/ext/pg_graphql/Cargo-1.1.0.lock new file mode 100644 index 000000000..bea78ad8e --- /dev/null +++ b/nix/ext/pg_graphql/Cargo-1.1.0.lock @@ -0,0 +1,1961 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + +[[package]] +name = "atomic-polyfill" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cached" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" +dependencies = [ + "async-trait", + "async_once", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown", + "lazy_static", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" +dependencies = [ + "cached_proc_macro_types", + "darling", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.7.1", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cstr_core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" + +[[package]] +name = "futures-executor" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" + +[[package]] +name = "futures-macro" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-sink" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" + +[[package]] +name = "futures-task" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" + +[[package]] +name = "futures-util" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heapless" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.0", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.42.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_graphql" +version = "1.1.0" +dependencies = [ + "base64", + "cached", + "graphql-parser", + "itertools", + "lazy_static", + "pgx", + "pgx-contrib-spiext", + "pgx-tests", + "rand", + "regex", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "pgx" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708693428ee16491645c1c2795f6777a78b9b1d08ab2e481a82b7977c9814b56" +dependencies = [ + "atomic-traits", + "bitflags", + "bitvec", + "cstr_core", + "eyre", + "heapless", + "libc", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-utils", + "quote", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-contrib-spiext" +version = "0.1.0" +source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=153ad2db8bb8634332ad36ffc66dcb017353bf93#153ad2db8bb8634332ad36ffc66dcb017353bf93" +dependencies = [ + "pgx", +] + +[[package]] +name = "pgx-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0050ca15df7dbfe718f9006d2b9a38d2a00a40934d8154450cdde6323b58b690" +dependencies = [ + "pgx-utils", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgx-pg-config" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000bba0f67f2aa20e971a6127a8971bd85a6b724d3e95d9066f64816de3b4e67" +dependencies = [ + "dirs", + "eyre", + "owo-colors", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bd3fd6e1bcbfed67da7ac2dc71986a9f1396aeaec3d449d0697eb54909b34a" +dependencies = [ + "bindgen", + "eyre", + "libc", + "memoffset 0.6.5", + "once_cell", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "proc-macro2", + "quote", + "rayon", + "shlex", + "sptr", + "syn 1.0.109", +] + +[[package]] +name = "pgx-tests" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44db59e5a5473f9192cff05a284677b8b491bffcf85dcc7b892339f084ad2f2b" +dependencies = [ + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgx", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "postgres", + "regex", + "serde", + "serde_json", + "thiserror", + "time", +] + +[[package]] +name = "pgx-utils" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cdc413efcd90a1e94c7f09dea24ec1ecfa1275350cbe378a8776eb7b5448f9" +dependencies = [ + "atty", + "convert_case", + "cstr_core", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "regex", + "seq-macro", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", +] + +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" +dependencies = [ + "base64", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.16", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.4.9", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "socket2 0.5.3", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/nix/ext/pg_graphql/Cargo-1.2.0.lock b/nix/ext/pg_graphql/Cargo-1.2.0.lock new file mode 100644 index 000000000..5ac0c4b0b --- /dev/null +++ b/nix/ext/pg_graphql/Cargo-1.2.0.lock @@ -0,0 +1,2051 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + +[[package]] +name = "atomic-polyfill" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cached" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f5cd208ba696f870238022d81ca1d80ed9d696fd62341c747f2d8f6ecdd9fe" +dependencies = [ + "async-trait", + "async_once", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown", + "lazy_static", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bce0f37f9b77c6b93cdf3f060c89adca303d2ab052cacb3c3d1ab543e8cecd2f" +dependencies = [ + "cached_proc_macro_types", + "darling", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" +dependencies = [ + "bitflags", + "clap_derive", + "clap_lex", + "once_cell", +] + +[[package]] +name = "clap-cargo" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca953650a7350560b61db95a0ab1d9c6f7b74d146a9e08fb258b834f3cf7e2c" +dependencies = [ + "clap", + "doc-comment", +] + +[[package]] +name = "clap_derive" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52" + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.7.1", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" + +[[package]] +name = "futures-executor" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" + +[[package]] +name = "futures-macro" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-sink" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" + +[[package]] +name = "futures-task" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" + +[[package]] +name = "futures-util" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heapless" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.0", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.146" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.42.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +dependencies = [ + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "pathsearch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da983bc5e582ab17179c190b4b66c7d76c5943a69c6d34df2a2b6bf8a2977b05" +dependencies = [ + "anyhow", + "libc", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pest" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_graphql" +version = "1.2.0" +dependencies = [ + "base64", + "cached", + "graphql-parser", + "itertools", + "lazy_static", + "pgx", + "pgx-contrib-spiext", + "pgx-tests", + "rand", + "regex", + "serde", + "serde_json", + "uuid", +] + +[[package]] +name = "pgx" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc91f19f84e7c1ba7b25953b042bd487b6e1bbec4c3af09f61a6ac31207ff776" +dependencies = [ + "atomic-traits", + "bitflags", + "bitvec", + "heapless", + "libc", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-sql-entity-graph", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-contrib-spiext" +version = "0.1.0" +source = "git+https://github.com/supabase/pgx-contrib-spiext?rev=a346053#a346053dd246400076797a002c66c80a56a20435" +dependencies = [ + "pgx", + "thiserror", +] + +[[package]] +name = "pgx-macros" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebfde3c33353d42c2fbcc76bea758b37018b33b1391c93d6402546569914e94" +dependencies = [ + "pgx-sql-entity-graph", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pgx-pg-config" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97c27bab88fdb7b94e549b02267ab9595bd9d1043718d6d72bc2d34cf1e3952" +dependencies = [ + "dirs", + "eyre", + "owo-colors", + "pathsearch", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b79c48c564bed305d202b852321603107e5f3ac31f25ea2cc4031475f38d0b3" +dependencies = [ + "bindgen", + "eyre", + "libc", + "memoffset 0.6.5", + "once_cell", + "pgx-macros", + "pgx-pg-config", + "pgx-sql-entity-graph", + "proc-macro2", + "quote", + "serde", + "shlex", + "sptr", + "syn 1.0.109", +] + +[[package]] +name = "pgx-sql-entity-graph" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573a8d8c23be24c39f7b7fbbc7e15d95aa0327acd61ba95c9c9f237fec51f205" +dependencies = [ + "convert_case", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "regex", + "seq-macro", + "syn 1.0.109", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", +] + +[[package]] +name = "pgx-tests" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc09f25ae560bc4e3308022999416966beda5b60d2957b9ab92bffaf2d6a86c3" +dependencies = [ + "clap-cargo", + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgx", + "pgx-macros", + "pgx-pg-config", + "postgres", + "regex", + "serde", + "serde_json", + "sysinfo", + "thiserror", + "time", +] + +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres" +version = "0.19.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bed5017bc2ff49649c0075d0d7a9d676933c1292480c1d137776fb205b5cd18" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" +dependencies = [ + "base64", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.16", +] + +[[package]] +name = "ryu" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1685deded9b272198423bdbdb907d8519def2f26cf3699040e54e8c4fbd5c5ce" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sysinfo" +version = "0.27.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a902e9050fca0a5d6877550b769abd2bd1ce8c04634b941dbe2809735e1a1e33" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.4.9", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "socket2 0.5.3", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-bidi" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.1", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm 0.42.1", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] diff --git a/nix/ext/pg_graphql/default.nix b/nix/ext/pg_graphql/default.nix new file mode 100644 index 000000000..18bca5871 --- /dev/null +++ b/nix/ext/pg_graphql/default.nix @@ -0,0 +1,206 @@ +{ + callPackages, + lib, + stdenv, + buildEnv, + fetchFromGitHub, + postgresql, + rust-bin, + rsync, + system, + rustPlatform, +}: + +let + pname = "pg_graphql"; + build = + version: hash: rustVersion: pgrxVersion: + let + cargo = rust-bin.stable.${rustVersion}.default; + mkPgrxExtension = callPackages ../../cargo-pgrx/mkPgrxExtension.nix { + inherit rustVersion pgrxVersion; + }; + src = fetchFromGitHub { + owner = "supabase"; + repo = pname; + rev = "v${version}"; + inherit hash; + }; + lockFile = + if builtins.pathExists "${src}/Cargo.lock" then "${src}/Cargo.lock" else ./Cargo-${version}.lock; + in + mkPgrxExtension ( + rec { + inherit + pname + version + postgresql + src + ; + + nativeBuildInputs = [ cargo ]; + buildInputs = [ postgresql ]; + + CARGO = "${cargo}/bin/cargo"; + + cargoLock = { + inherit lockFile; + }; + # Setting RUSTFLAGS in env to ensure it's available for all phases + env = lib.optionalAttrs stdenv.isDarwin { + POSTGRES_LIB = "${postgresql}/lib"; + RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; + NIX_BUILD_CORES = "4"; + CARGO_BUILD_JOBS = "4"; + }; + + CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG = true; + + postInstall = '' + mv $out/lib/${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + rm $out/share/postgresql/extension/${pname}.control + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi + } + + create_control_files + ''; + + pgrxBinaryName = if builtins.compareVersions "0.7.4" pgrxVersion >= 0 then "pgx" else "pgrx"; + + preCheck = '' + export PGRX_HOME="$(mktemp -d)" + export PG_VERSION="${lib.versions.major postgresql.version}" + export NIX_PGLIBDIR="$PGRX_HOME/$PG_VERSION/lib" + export PATH="$PGRX_HOME/$PG_VERSION/bin:$PATH" + ${lib.getExe rsync} --chmod=ugo+w -a ${postgresql}/ ${postgresql.lib}/ "$PGRX_HOME/$PG_VERSION/" + cargo ${pgrxBinaryName} init "--pg$PG_VERSION" "$PGRX_HOME/$PG_VERSION/bin/pg_config" + cargo ${pgrxBinaryName} install --release --features "pg$PG_VERSION" + ''; + + doCheck = true; + + checkPhase = '' + runHook preCheck + bash -x ./bin/installcheck + runHook postCheck + ''; + + meta = with lib; { + description = "GraphQL support for PostreSQL"; + homepage = "https://github.com/supabase/$%7Bpname%7D"; + license = licenses.postgresql; + inherit (postgresql.meta) platforms; + }; + } + // + lib.optionalAttrs + ( + # Fix bindgen error on aarch64-linux for versions using pgrx with bindgen 0.68.1 + # This affects pgrx 0.6.1 through 0.11.2 which have issues with ARM NEON vector ABI + # We apply the fix to all versions up to 1.5.1 (last version before 1.5.4 which uses 0.11.2) + builtins.compareVersions "1.5.4" version > 0 + ) + { + # Fix bindgen error on aarch64-linux by using an older version of clang + bindgenHook = + let + nixos2211 = ( + import (builtins.fetchTarball { + url = "https://channels.nixos.org/nixos-22.11/nixexprs.tar.xz"; + sha256 = "1j7h75a9hwkkm97jicky5rhvzkdwxsv5v46473rl6agvq2sj97y1"; + }) { inherit system; } + ); + in + rustPlatform.bindgenHook.overrideAttrs { + libclang = nixos2211.clang.cc.lib; + clang = nixos2211.clang; + }; + } + // lib.optionalAttrs (builtins.compareVersions "1.2.0" version >= 0) { + # Add missing Cargo.lock + patches = [ ./0001-Add-missing-Cargo.lock-${version}.patch ]; + + cargoLock = { + lockFile = ./Cargo-${version}.lock; + outputHashes = { + "pgx-contrib-spiext-0.1.0" = + if (version == "1.2.0") then + "sha256-sUokKg8Jaf2/faXlHg1ui2pyJ05jdGxxgeJzhPOds9M=" + else + "sha256-1hAA8DnCYkKDRdIDXrJzo59+sCz4i+oI9CPN+Ti6jWA="; + }; + }; + } + ); + allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).pg_graphql; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) supportedVersions + ); +in +buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + create_sql_files() { + PREVIOUS_VERSION="" + while IFS= read -r i; do + FILENAME=$(basename "$i") + DIRNAME=$(dirname "$i") + VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)" + if [[ "$PREVIOUS_VERSION" != "" ]]; then + echo "Processing $i" + sed -i 's/CREATE[[:space:]]*FUNCTION/CREATE OR REPLACE FUNCTION/Ig' "$i" + { + echo "DROP EVENT TRIGGER IF EXISTS graphql_watch_ddl CASCADE;" + echo "DROP EVENT TRIGGER IF EXISTS graphql_watch_drop CASCADE;" + cat "$i" + } > "$i.tmp" && mv "$i.tmp" "$i" + MIGRATION_FILENAME="$DIRNAME/''${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}" + cp "$i" "$MIGRATION_FILENAME" + fi + PREVIOUS_VERSION="$VERSION" + done < <(find $out -name '*.sql' | sort -V) + # handle special case of mergeless upgrade from 1.5.1-mergeless to 1.5.4 + if [[ -f $out/share/postgresql/extension/pg_graphql--1.5.1--1.5.4.sql ]]; then + cp $out/share/postgresql/extension/pg_graphql--1.5.1--1.5.4.sql $out/share/postgresql/extension/pg_graphql--1.5.1-mergeless--1.5.4.sql + fi + } + + create_sql_files + + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) + ''; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); + }; +} diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index afea82fc8..346f480bb 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -185,6 +185,7 @@ builtins.listToAttrs ( "hypopg" "index_advisor" "pg_cron" + "pg_graphql" "pg_net" "vector" "wrappers" diff --git a/nix/ext/versions.json b/nix/ext/versions.json index fe34cb814..4bcb4fd28 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -74,6 +74,138 @@ "hash": "sha256-t1DpFkPiSfdoGG2NgNT7g1lkvSooZoRoUrix6cBID40=" } }, + "pg_graphql": { + "1.0.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-HnEyijEIkKbJFQjWF1sa5h2qqGzq/aW14454zPbo6wc=", + "pgrx": "0.6.1", + "rust": "1.82.0" + }, + "1.1.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-Vdi9qBjg14/SpZ1TuOvKS0gJjkLmviCzoBLnPOds0pw=", + "pgrx": "0.6.1", + "rust": "1.82.0" + }, + "1.2.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-QnNwKasSvC7o5pHDC/NlqJPvWirKwMpwUmfsLJXDTsg=", + "pgrx": "0.7.1", + "rust": "1.82.0" + }, + "1.2.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-SKbUDasdhz/L5UDyMH4gXmFfHHhGx81H90gfIclGwjU=", + "pgrx": "0.9.5", + "rust": "1.70.0" + }, + "1.2.3": { + "postgresql": [ + "15" + ], + "hash": "sha256-876bRLAUstBcCnhDvO+MllAC1VM//LLW1W6h028zr/8=", + "pgrx": "0.9.7", + "rust": "1.70.0" + }, + "1.4.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-onyVIM5/l/cpYeAa7ya6h7bmRfqG1dPjc67oGGkgsOs=", + "pgrx": "0.10.2", + "rust": "1.70.0" + }, + "1.4.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-/JweVmfcWqDtFeP3tBl/g6hlqAqbwPHpcHdX9HeqZuU=", + "pgrx": "0.10.2", + "rust": "1.70.0" + }, + "1.4.4": { + "postgresql": [ + "15" + ], + "hash": "sha256-Kxo4o8+hfSTOjvhYyGF2BpksWfW/AMCCH4qom4AGw18=", + "pgrx": "0.11.2", + "rust": "1.70.0" + }, + "1.5.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-28ANRZyF22qF2YAxNAAkPfGOM3+xiO6IHdXsTp0CTQE=", + "pgrx": "0.11.2", + "rust": "1.85.1" + }, + "1.5.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-cAiD2iSFmZwC+Zy0x+MABseWCxXRtRY74Dj0oBKet+o=", + "pgrx": "0.11.2", + "rust": "1.85.1" + }, + "1.5.1-mergeless": { + "postgresql": [ + "15" + ], + "hash": "sha256-X4YR2ishxWCQDMwxHKuGGjlpbpRrUBoHeeLfM/UIHWc=", + "pgrx": "0.11.2", + "rust": "1.85.1" + }, + "1.5.4": { + "postgresql": [ + "15" + ], + "hash": "sha256-419RVol44akUFZ/0B97VjAXCUrWcKFDAFuVjvJnbkP4=", + "pgrx": "0.11.3", + "rust": "1.85.1" + }, + "1.5.6": { + "postgresql": [ + "15" + ], + "hash": "sha256-v/40TR/1bplbQuD3Hv3gE7oh6cfn9fA6U5s+FTAwxtA=", + "pgrx": "0.11.3", + "rust": "1.85.1" + }, + "1.5.7": { + "postgresql": [ + "15" + ], + "hash": "sha256-Q6XfcTKVOjo5pGy8QACc4QCHolKxEGU8e0TTC6Zg8go=", + "pgrx": "0.11.3", + "rust": "1.85.1" + }, + "1.5.9": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-YpLN43FtLhp2cb7cyM+4gEx8GTwsRiKTfxaMq0b8hk0=", + "pgrx": "0.12.6", + "rust": "1.81.0" + }, + "1.5.11": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-BMZc9ui+2J3U24HzZZVCU5+KWhz+5qeUsRGeptiqbek=", + "pgrx": "0.12.9", + "rust": "1.81.0" + } + }, "pg_net": { "0.1": { "postgresql": [ diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index a3fd52034..f005671d5 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -37,6 +37,10 @@ inherit (final) writeShellScriptBin; }; + buildPgrxExtension_0_11_2 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_2; + }; + buildPgrxExtension_0_11_3 = prev.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_3; }; diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index 54c674775..dc72365b8 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -37,7 +37,7 @@ ../ext/pg_net.nix ../ext/pg_hashids.nix ../ext/pgsodium.nix - ../ext/pg_graphql.nix + ../ext/pg_graphql ../ext/pg_stat_monitor.nix ../ext/pg_jsonschema.nix ../ext/pgvector.nix From a89b6784252cf3bd35140f32080a5fb212751768 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Mon, 6 Oct 2025 17:07:13 -0400 Subject: [PATCH 110/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1819) --- ansible/tasks/setup-migrations.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/ansible/tasks/setup-migrations.yml b/ansible/tasks/setup-migrations.yml index 6eea6844b..4d89b3110 100644 --- a/ansible/tasks/setup-migrations.yml +++ b/ansible/tasks/setup-migrations.yml @@ -1,13 +1,17 @@ -- name: Run migrate.sh script - shell: ./migrate.sh - register: retval - when: debpkg_mode or stage2_nix - args: - chdir: /tmp/migrations/db - failed_when: retval.rc != 0 +- name: run debpkg_mode or stage2_nix tasks + when: + - (debpkg_mode or stage2_nix) + block: + - name: Run migrate.sh script + ansible.builtin.command: + cmd: './migrate.sh' + args: + chdir: '/tmp/migrations/db' + failed_when: + - retval['rc'] != 0 + register: 'retval' -- name: Create /root/MIGRATION-AMI file - file: - path: "/root/MIGRATION-AMI" - state: touch - when: debpkg_mode or stage2_nix + - name: Create /root/MIGRATION-AMI file + ansible.builtin.file: + path: '/root/MIGRATION-AMI' + state: 'touch' From d4be4ed9ef65d6fd532a09e4f47b6bfed764e8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 7 Oct 2025 01:05:24 +0200 Subject: [PATCH 111/134] feat: support multiple versions of the pgrouting extension (#1687) * feat: support multiple versions of the pgrouting extension Build multiple versions of the pgrouting extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * feat: run pgrouting pg_regress tests from nixos test VM * feat: test pgrouting with orioledb-17 Test pgrouting upgrade path on orioledb-17 * fix: we won't include an upgrade of pgrouting quite yet * fix: integration tests need updating to use postgis-all * chore: suffix to test * chore: bump version to release * chore: bump to release again` --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +- nix/ext/pgrouting.nix | 180 +++++++++++++++++++--------- nix/ext/tests/pgrouting.nix | 228 ++++++++++++++++++++++++++++++++++++ nix/ext/versions.json | 9 ++ nix/postgresql/default.nix | 6 +- nix/postgresql/generic.nix | 9 +- 6 files changed, 377 insertions(+), 61 deletions(-) create mode 100644 nix/ext/tests/pgrouting.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 18cb0a206..b05651fd3 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.035-orioledb" - postgres17: "17.6.1.014" - postgres15: "15.14.1.014" + postgresorioledb-17: 17.5.1.036-orioledb + postgres17: 17.6.1.015 + postgres15: 15.14.1.015 # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/pgrouting.nix b/nix/ext/pgrouting.nix index e51b8bada..b20b89c43 100644 --- a/nix/ext/pgrouting.nix +++ b/nix/ext/pgrouting.nix @@ -6,69 +6,139 @@ perl, cmake, boost, + buildEnv, }: - -stdenv.mkDerivation rec { +let pname = "pgrouting"; - version = "3.4.1"; - nativeBuildInputs = [ - cmake - perl - ]; - buildInputs = [ - postgresql - boost - ]; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - src = fetchFromGitHub { - owner = "pgRouting"; - repo = pname; - rev = "v${version}"; - hash = "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="; - }; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; - #disable compile time warnings for incompatible pointer types only on macos and pg16 - NIX_CFLAGS_COMPILE = lib.optionalString ( - stdenv.isDarwin && lib.versionAtLeast postgresql.version "16" - ) "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types"; - - cmakeFlags = - [ "-DPOSTGRESQL_VERSION=${postgresql.version}" ] - ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [ - "-DCMAKE_MACOSX_RPATH=ON" - "-DCMAKE_SHARED_MODULE_SUFFIX=.dylib" - "-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib" - ]; - - preConfigure = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' - export DLSUFFIX=.dylib - export CMAKE_SHARED_LIBRARY_SUFFIX=.dylib - export CMAKE_SHARED_MODULE_SUFFIX=.dylib - export MACOSX_RPATH=ON - ''; + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); - postBuild = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' - shopt -s nullglob - for file in lib/libpgrouting-*.so; do - if [ -f "$file" ]; then - mv "$file" "''${file%.so}.dylib" - fi - done - shopt -u nullglob - ''; + # Build function for individual versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + + nativeBuildInputs = [ + cmake + perl + ]; + buildInputs = [ + postgresql + boost + ]; + + src = fetchFromGitHub { + owner = "pgRouting"; + repo = pname; + rev = "v${version}"; + inherit hash; + }; + + #disable compile time warnings for incompatible pointer types only on macos and pg16 + NIX_CFLAGS_COMPILE = lib.optionalString ( + stdenv.isDarwin && lib.versionAtLeast postgresql.version "16" + ) "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types"; + + cmakeFlags = + [ "-DPOSTGRESQL_VERSION=${postgresql.version}" ] + ++ lib.optionals (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") [ + "-DCMAKE_MACOSX_RPATH=ON" + "-DCMAKE_SHARED_MODULE_SUFFIX=.dylib" + "-DCMAKE_SHARED_LIBRARY_SUFFIX=.dylib" + ]; + + preConfigure = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' + export DLSUFFIX=.dylib + export CMAKE_SHARED_LIBRARY_SUFFIX=.dylib + export CMAKE_SHARED_MODULE_SUFFIX=.dylib + export MACOSX_RPATH=ON + ''; + + postBuild = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast postgresql.version "16") '' + shopt -s nullglob + for file in lib/libpgrouting-*.so; do + if [ -f "$file" ]; then + mv "$file" "''${file%.so}.dylib" + fi + done + shopt -u nullglob + ''; + + installPhase = '' + MAJ_MIN_VERSION=${lib.concatStringsSep "." (lib.take 2 (builtins.splitVersion version))} + + mkdir -p $out/{lib,share/postgresql/extension} + + # Install shared library with version suffix + install -D lib/libpgrouting-$MAJ_MIN_VERSION${postgresql.dlSuffix} -t $out/lib + + # Create version-specific control file + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/lib${pname}-$MAJ_MIN_VERSION'|" \ + sql/common/${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # Copy SQL upgrade scripts + cp sql/${pname}--*.sql $out/share/postgresql/extension + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${version}'" + cat $out/share/postgresql/extension/${pname}--${version}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn $out/lib/lib${pname}-$MAJ_MIN_VERSION${postgresql.dlSuffix} $out/lib/lib${pname}${postgresql.dlSuffix} + fi + ''; + + meta = with lib; { + description = "A PostgreSQL/PostGIS extension that provides geospatial routing functionality"; + homepage = "https://pgrouting.org/"; + changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v$%7Bversion%7D"; + license = licenses.gpl2Plus; + inherit (postgresql.meta) platforms; + }; + }; +in +buildEnv { + name = pname; + paths = packages; + + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + + postBuild = '' + #Verify all expected library files are present + expectedFiles=${toString (numberOfVersions + 1)} + actualFiles=$(ls -l $out/lib/lib${pname}*${postgresql.dlSuffix} | wc -l) - installPhase = '' - install -D lib/*${postgresql.dlSuffix} -t $out/lib - install -D sql/pgrouting--*.sql -t $out/share/postgresql/extension - install -D sql/common/pgrouting.control -t $out/share/postgresql/extension + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/*${postgresql.dlSuffix} || true + exit 1 + fi ''; - meta = with lib; { - description = "A PostgreSQL/PostGIS extension that provides geospatial routing functionality"; - homepage = "https://pgrouting.org/"; - changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v$%7Bversion%7D"; - platforms = postgresql.meta.platforms; - license = licenses.gpl2Plus; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/pgrouting.nix b/nix/ext/tests/pgrouting.nix new file mode 100644 index 000000000..f8775e4aa --- /dev/null +++ b/nix/ext/tests/pgrouting.nix @@ -0,0 +1,228 @@ +{ self, pkgs }: +let + pname = "pgrouting"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = + [ + postgresql + postgresql.lib + (installedExtension majorVersion) + self.packages.${pkgs.system}."psql_${majorVersion}/exts/postgis-all" + ] + ++ lib.optional (postgresql.isOrioleDB + ) self.packages.${pkgs.system}."psql_orioledb-17/exts/orioledb"; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + pg_regress = pkgs.callPackage ../pg_regress.nix { + postgresql = self.packages.${pkgs.system}.postgresql_15; + }; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIo+ulCUfJjnCVgfM4946Ih5Nm8DeZZiayYeABHGPEl7 jfroche" + ]; + + services.postgresql = { + enable = true; + package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17); + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + + specialisation.orioledb17.configuration = { + services.postgresql = { + package = lib.mkForce (postgresqlWithExtension self.packages.${pkgs.system}.postgresql_orioledb-17); + settings = { + shared_preload_libraries = "orioledb"; + default_table_access_method = "orioledb"; + }; + initdbArgs = [ + "--allow-group-access" + "--locale-provider=icu" + "--encoding=UTF-8" + "--icu-locale=en_US.UTF-8" + ]; + initialScript = pkgs.writeText "init-postgres-with-orioledb" '' + CREATE EXTENSION orioledb CASCADE; + ''; + }; + + systemd.services.postgresql-migrate = { + # we don't support migrating from postgresql 17 to orioledb-17 so we just reinit the datadir + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + newPostgresql = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_orioledb-17; + in + '' + set -x + systemctl cat postgresql.service + rm -rf ${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema} + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + orioledb17-configuration = "${nodes.server.system.build.toplevel}/specialisation/orioledb17"; + in + '' + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + "orioledb-17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "orioledb-17"))}], + } + + def run_sql(query): + return server.succeed(f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """).strip() + + def run_pg_regress(sql_file, pg_version): + try: + server.succeed(f"""sudo -u postgres ${pg_regress}/bin/pg_regress --inputdir=${../../tests} --use-existing --dbname=postgres --outputdir=/tmp/regression_output_{pg_version} "{sql_file}" """) + except: + server.copy_from_vm(f"/tmp/regression_output_{pg_version}", "") + raise + + def check_upgrade_path(pg_version): + with subtest("Check ${pname} upgrade path"): + firstVersion = versions[pg_version][0] + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION IF EXISTS ${pname};'") + run_sql(f"""CREATE EXTENSION ${pname} WITH VERSION '{firstVersion}' CASCADE;""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == firstVersion, f"Expected ${pname} version {firstVersion}, but found {installed_version}" + for version in versions[pg_version][1:]: + run_sql(f"""ALTER EXTENSION ${pname} UPDATE TO '{version}';""") + installed_version = run_sql(r"""SELECT extversion FROM pg_extension WHERE extname = '${pname}';""") + assert installed_version == version, f"Expected ${pname} version {version}, but found {installed_version}" + run_pg_regress("${pname}", pg_version) + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + check_upgrade_path("15") + + with subtest("Check ${pname} latest extension version"): + server.succeed("sudo -u postgres psql -c 'DROP EXTENSION ${pname};'") + server.succeed("sudo -u postgres psql -c 'CREATE EXTENSION ${pname} CASCADE;'") + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["15"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + with subtest("switch to postgresql 17"): + server.succeed( + "${pg17-configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check ${pname} latest extension version after upgrade"): + installed_extensions=run_sql(r"""SELECT extname, extversion FROM pg_extension;""") + latestVersion = versions["17"][-1] + assert f"${pname},{latestVersion}" in installed_extensions + + check_upgrade_path("17") + + with subtest("switch to orioledb 17"): + server.succeed( + "${orioledb17-configuration}/bin/switch-to-configuration test >&2" + ) + installed_extensions=run_sql(r"""SELECT extname FROM pg_extension WHERE extname = 'orioledb';""") + assert "orioledb" in installed_extensions + + check_upgrade_path("orioledb-17") + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 4bcb4fd28..3068b857b 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -278,6 +278,15 @@ "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } }, + "pgrouting": { + "3.4.1": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k=" + } + }, "pgsodium": { "3.0.4": { "postgresql": [ diff --git a/nix/postgresql/default.nix b/nix/postgresql/default.nix index 272dc4f35..fdef115d3 100644 --- a/nix/postgresql/default.nix +++ b/nix/postgresql/default.nix @@ -10,6 +10,7 @@ let namePrefix, jitSupport, supportedVersions, + isOrioleDB, }: pkgs.lib.mapAttrs' ( version: config: @@ -18,6 +19,7 @@ let in pkgs.lib.nameValuePair "${namePrefix}${versionSuffix}" ( pkgs.callPackage ./generic.nix { + inherit isOrioleDB; inherit (config) version hash; jitSupport = jitSupport; self = pkgs; @@ -30,10 +32,12 @@ let { namePrefix = "postgresql_"; versions = supportedPostgresVersions.postgres; + isOrioleDB = false; } { namePrefix = "postgresql_orioledb-"; versions = supportedPostgresVersions.orioledb; + isOrioleDB = true; } ]; @@ -44,7 +48,7 @@ let acc: flavor: acc // (mkPostgresqlPackages { - inherit (flavor) namePrefix; + inherit (flavor) namePrefix isOrioleDB; inherit jitSupport; supportedVersions = flavor.versions; }) diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index d922895fa..61920c869 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -64,6 +64,8 @@ let # detection of crypt fails when using llvm stdenv, so we add it manually # for <13 (where it got removed: https://github.com/postgres/postgres/commit/c45643d618e35ec2fe91438df15abd4f3c0d85ca) libxcrypt, + + isOrioleDB ? false, }@args: let atLeast = lib.versionAtLeast version; @@ -288,6 +290,7 @@ let withoutJIT = if jitSupport then jitToggle else this; dlSuffix = if olderThan "16" then ".so" else stdenv.hostPlatform.extensions.sharedLibrary; + inherit isOrioleDB; pkgs = let @@ -347,6 +350,7 @@ let "libpq" ]; platforms = platforms.unix; + inherit isOrioleDB; # JIT support doesn't work with cross-compilation. It is attempted to build LLVM-bytecode # (`%.bc` is the corresponding `make(1)`-rule) for each sub-directory in `backend/` for @@ -399,8 +403,9 @@ let wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib ''; - passthru.version = postgresql.version; - passthru.psqlSchema = postgresql.psqlSchema; + passthru = { + inherit (postgresql) version psqlSchema isOrioleDB; + }; }; in generic From daf0108fb82b7b299912840d13a9a19b1d8ecad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 7 Oct 2025 21:35:44 +0200 Subject: [PATCH 112/134] feat: run pg_regress during extension tests (#1812) While testing the upgrade of our PostgreSQL extensions, we also want to run the pg_regress tests that come with the extension. This ensures that the extension is functioning correctly after installation and upgrades. --- nix/ext/pgvector.nix | 1 + nix/ext/tests/default.nix | 11 +++++++++- nix/ext/tests/lib.py | 40 ++++++++++++++++++++++++++++++++--- nix/ext/tests/timescaledb.nix | 3 ++- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/nix/ext/pgvector.nix b/nix/ext/pgvector.nix index c49a02e71..fa6dba77d 100644 --- a/nix/ext/pgvector.nix +++ b/nix/ext/pgvector.nix @@ -88,5 +88,6 @@ pkgs.buildEnv { pname = "${pname}-all"; version = "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); + pgRegressTestName = "pgvector"; }; } diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 346f480bb..331086398 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -125,6 +125,7 @@ let pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; in '' + from pathlib import Path versions = { "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], @@ -135,6 +136,8 @@ let ext_has_background_worker = ${ if (installedExtension "15") ? hasBackgroundWorker then "True" else "False" } + sql_test_directory = Path("${../../tests}") + pg_regress_test_name = "${(installedExtension "15").pgRegressTestName or pname}" ${builtins.readFile ./lib.py} @@ -143,11 +146,14 @@ let server.wait_for_unit("multi-user.target") server.wait_for_unit("postgresql.service") - test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) + test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade) with subtest("Check upgrade path with postgresql 15"): test.check_upgrade_path("15") + with subtest("Check pg_regress with postgresql 15"): + test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) + last_version = None with subtest("Check the install of the last version of the extension"): last_version = test.check_install_last_version("15") @@ -166,6 +172,9 @@ let with subtest("Check upgrade path with postgresql 17"): test.check_upgrade_path("17") + + with subtest("Check pg_regress with postgresql 17"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) ''; }; in diff --git a/nix/ext/tests/lib.py b/nix/ext/tests/lib.py index 35c5b0e04..9f81ec111 100644 --- a/nix/ext/tests/lib.py +++ b/nix/ext/tests/lib.py @@ -18,6 +18,7 @@ def __init__( vm: Machine, extension_name: str, versions: Versions, + sql_test_dir: Path, support_upgrade: bool = True, ): """Initialize the PostgreSQL extension test framework. @@ -26,12 +27,14 @@ def __init__( vm: Test machine instance for executing commands extension_name: Name of the PostgreSQL extension to test versions: Mapping of PostgreSQL versions to available extension versions + sql_test_dir: Directory containing SQL test files for pg_regress support_upgrade: Whether the extension supports in-place upgrades """ self.vm = vm self.extension_name = extension_name self.versions = versions self.support_upgrade = support_upgrade + self.sql_test_dir = sql_test_dir def run_sql(self, query: str) -> str: return self.vm.succeed( @@ -101,9 +104,9 @@ def check_upgrade_path(self, pg_version: str): ) # Install and verify first version - firstVersion = available_versions[0] + first_version = available_versions[0] self.drop_extension() - self.install_extension(firstVersion) + self.install_extension(first_version) # Test remaining versions for version in available_versions[1:]: @@ -160,10 +163,41 @@ def check_switch_extension_with_background_worker( f"{first_version}.so" ), f"Expected {self.extension_name} version {first_version}, but found {ext_version}" - # Switch to the first version + # Switch to the last version self.vm.succeed(f"switch_{self.extension_name}_version {last_version}") # Check that we are using the last version now ext_version = self.vm.succeed(f"readlink -f {extension_lib_path}").strip() assert ext_version.endswith( f"{last_version}.so" ), f"Expected {self.extension_name} version {last_version}, but found {ext_version}" + + def check_pg_regress(self, pg_regress: Path, pg_version: str, test_name: str): + """Run pg_regress tests for the extension on a given PostgreSQL version. + + Args: + pg_regress: Path to the pg_regress binary + pg_version: PostgreSQL version to test (e.g., "14", "15") + test_name: SQL test file to run with pg_regress + """ + sql_file = self.sql_test_dir / "sql" / f"{test_name}.sql" + if not sql_file.exists(): + # check if we have a postgres version specific sql file + test_name = f"z_{pg_version}_{test_name}" + sql_file = self.sql_test_dir / "sql" / f"{test_name}.sql" + if not sql_file.exists(): + print(f"Skipping pg_regress test for {pg_version}, no sql file found") + return + try: + print( + self.vm.succeed( + f"""sudo -u postgres {pg_regress} --inputdir={self.sql_test_dir} --debug --use-existing --dbname=postgres --outputdir=/tmp/regression_output_{pg_version} "{test_name}" """ + ) + ) + except: + print("Error running pg_regress, diff:") + print( + self.vm.succeed( + f"cat /tmp/regression_output_{pg_version}/regression.diffs" + ) + ) + raise diff --git a/nix/ext/tests/timescaledb.nix b/nix/ext/tests/timescaledb.nix index 597fe9e0d..85755a82d 100644 --- a/nix/ext/tests/timescaledb.nix +++ b/nix/ext/tests/timescaledb.nix @@ -66,8 +66,9 @@ self.inputs.nixpkgs.lib.nixos.runTest { } extension_name = "${pname}" support_upgrade = True + sql_test_directory = Path("${../../tests}") - test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) + test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade) with subtest("Check upgrade path with postgresql 15"): test.check_upgrade_path("15") From 6e3ae5b668a9830a8bd32cebca90e35f3dcc7e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 8 Oct 2025 01:18:28 +0200 Subject: [PATCH 113/134] feat: support multiple versions of the pgmq extension (#1668) * feat: support multiple versions of the pgmq extension Build multiple versions of the pgmq extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * chore: bump suffix to test * chore: bump version to release --------- Co-authored-by: Sam Rose --- .../pgmq/after-create.sql | 6 +- ansible/vars.yml | 6 +- nix/ext/pgmq.nix | 102 +++++++++++++----- nix/ext/tests/default.nix | 1 + nix/ext/versions.json | 17 ++- nix/tests/expected/pgmq.out | 14 ++- nix/tests/expected/z_15_ext_interface.out | 22 +++- nix/tests/expected/z_17_ext_interface.out | 22 +++- .../expected/z_orioledb-17_ext_interface.out | 22 +++- 9 files changed, 167 insertions(+), 45 deletions(-) diff --git a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql index 050e07dfc..f625c9fb3 100644 --- a/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql @@ -18,8 +18,8 @@ begin physical backups everywhere */ -- Detach and delete the official function -alter extension pgmq drop function pgmq.drop_queue; -drop function pgmq.drop_queue; +alter extension pgmq drop function pgmq.drop_queue(TEXT); +drop function pgmq.drop_queue(TEXT); -- Create and reattach the patched function CREATE FUNCTION pgmq.drop_queue(queue_name TEXT) @@ -134,7 +134,7 @@ BEGIN END; $func$ LANGUAGE plpgsql; -alter extension pgmq add function pgmq.drop_queue; +alter extension pgmq add function pgmq.drop_queue(TEXT); update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq'; diff --git a/ansible/vars.yml b/ansible/vars.yml index b05651fd3..55c1300e4 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.036-orioledb - postgres17: 17.6.1.015 - postgres15: 15.14.1.015 + postgresorioledb-17: 17.5.1.037-orioledb + postgres17: 17.6.1.016 + postgres15: 15.14.1.016 # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/pgmq.nix b/nix/ext/pgmq.nix index e718c1d02..13cc987b0 100644 --- a/nix/ext/pgmq.nix +++ b/nix/ext/pgmq.nix @@ -3,36 +3,88 @@ stdenv, fetchFromGitHub, postgresql, + buildEnv, }: - -stdenv.mkDerivation rec { +let pname = "pgmq"; - version = "1.4.4"; - buildInputs = [ postgresql ]; - src = fetchFromGitHub { - owner = "tembo-io"; - repo = pname; - rev = "v${version}"; - hash = "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw="; - }; - buildPhase = '' - cd pgmq-extension - ''; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; + + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash) supportedVersions + ); + + # Build function for individual versions + build = + version: hash: + stdenv.mkDerivation rec { + inherit pname version; + buildInputs = [ postgresql ]; + src = fetchFromGitHub { + owner = "tembo-io"; + repo = pname; + rev = "v${version}"; + inherit hash; + }; + + buildPhase = '' + cd pgmq-extension + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/postgresql/extension + + # Create versioned sql install script + cp sql/${pname}.sql $out/share/postgresql/extension/${pname}--${version}.sql + + # Create versioned control file with modified module path + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # For the latest version, create default control file and symlink and copy SQL upgrade scripts + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${version}'" + cat $out/share/postgresql/extension/${pname}--${version}.control + } > $out/share/postgresql/extension/${pname}.control + cp sql/*.sql $out/share/postgresql/extension + fi + + runHook postInstall + ''; - installPhase = '' - mkdir -p $out/{lib,share/postgresql/extension} + meta = with lib; { + description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres."; + homepage = "https://github.com/tembo-io/pgmq"; + maintainers = with maintainers; [ olirice ]; + inherit (postgresql.meta) platforms; + license = licenses.postgresql; + }; + }; +in +buildEnv { + name = pname; + paths = packages; - mv sql/pgmq.sql $out/share/postgresql/extension/pgmq--${version}.sql - cp sql/*.sql $out/share/postgresql/extension - cp *.control $out/share/postgresql/extension - ''; + pathsToLink = [ "/share/postgresql/extension" ]; - meta = with lib; { - description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres."; - homepage = "https://github.com/tembo-io/pgmq"; - maintainers = with maintainers; [ olirice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 331086398..a612d72b2 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -196,6 +196,7 @@ builtins.listToAttrs ( "pg_cron" "pg_graphql" "pg_net" + "pgmq" "vector" "wrappers" ] diff --git a/nix/ext/versions.json b/nix/ext/versions.json index 3068b857b..dfedda4aa 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -277,6 +277,21 @@ ], "hash": "sha256-Cpi2iASi1QJoED0Qs1dANqg/BNZTsz5S+pw8iYyW03Y=" } + }, + "pgmq": { + "1.4.4": { + "postgresql": [ + "15" + ], + "hash": "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw=" + }, + "1.5.1": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-IU+i6ONPwtgsFKdzya6E+222ualR66gkbb0lDr+7Rb8=" + } }, "pgrouting": { "3.4.1": { @@ -412,7 +427,7 @@ "hash": "sha256-JsZV+I4eRMypXTjGmjCtMBXDVpqTIPHQa28ogXncE/Q=" } }, - "wrappers": { + "wrappers": { "0.5.4": { "postgresql": [ "15", diff --git a/nix/tests/expected/pgmq.out b/nix/tests/expected/pgmq.out index bce379fc7..c2d5d3eec 100644 --- a/nix/tests/expected/pgmq.out +++ b/nix/tests/expected/pgmq.out @@ -160,6 +160,7 @@ order by -------------+-------------------------------+---------- pgmq | _belongs_to_pgmq | postgres pgmq | _ensure_pg_partman_installed | postgres + pgmq | _extension_exists | postgres pgmq | _get_partition_col | postgres pgmq | _get_pg_partman_major_version | postgres pgmq | _get_pg_partman_schema | postgres @@ -174,6 +175,7 @@ order by pgmq | delete | postgres pgmq | detach_archive | postgres pgmq | drop_queue | postgres + pgmq | drop_queue | postgres pgmq | format_table_name | postgres pgmq | list_queues | postgres pgmq | metrics | postgres @@ -183,8 +185,18 @@ order by pgmq | read | postgres pgmq | read_with_poll | postgres pgmq | send | postgres + pgmq | send | postgres + pgmq | send | postgres + pgmq | send | postgres + pgmq | send | postgres + pgmq | send | postgres + pgmq | send_batch | postgres + pgmq | send_batch | postgres + pgmq | send_batch | postgres + pgmq | send_batch | postgres + pgmq | send_batch | postgres pgmq | send_batch | postgres pgmq | set_vt | postgres pgmq | validate_queue_name | postgres -(28 rows) +(40 rows) diff --git a/nix/tests/expected/z_15_ext_interface.out b/nix/tests/expected/z_15_ext_interface.out index d3d9f7c4f..a0db07837 100644 --- a/nix/tests/expected/z_15_ext_interface.out +++ b/nix/tests/expected/z_15_ext_interface.out @@ -1320,6 +1320,7 @@ order by pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _extension_exists | extension_name text | boolean pgmq | pgmq | _get_partition_col | partition_interval text | text pgmq | pgmq | _get_pg_partman_major_version | | integer pgmq | pgmq | _get_pg_partman_schema | | text @@ -1333,6 +1334,7 @@ order by pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean pgmq | pgmq | drop_queue | queue_name text | boolean pgmq | pgmq | format_table_name | queue_name text, prefix text | text pgmq | pgmq | list_queues | | SETOF pgmq.queue_record @@ -1340,9 +1342,19 @@ order by pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record pgmq | pgmq | purge_queue | queue_name text | bigint - pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record - pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | read | queue_name text, vt integer, qty integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb | SETOF bigint pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay timestamp with time zone | SETOF bigint pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record pgmq | pgmq | validate_queue_name | queue_name text | void @@ -5229,7 +5241,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(5059 rows) +(5071 rows) /* @@ -5454,6 +5466,7 @@ order by pg_tle | pgtle | feature_info | schema_name pgmq | pgmq | a_foo | archived_at pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | headers pgmq | pgmq | a_foo | message pgmq | pgmq | a_foo | msg_id pgmq | pgmq | a_foo | read_ct @@ -5463,6 +5476,7 @@ order by pgmq | pgmq | meta | is_unlogged pgmq | pgmq | meta | queue_name pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | headers pgmq | pgmq | q_foo | message pgmq | pgmq | q_foo | msg_id pgmq | pgmq | q_foo | read_ct @@ -6369,5 +6383,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(1106 rows) +(1108 rows) diff --git a/nix/tests/expected/z_17_ext_interface.out b/nix/tests/expected/z_17_ext_interface.out index 46792e48f..6a7b4a16c 100644 --- a/nix/tests/expected/z_17_ext_interface.out +++ b/nix/tests/expected/z_17_ext_interface.out @@ -1305,6 +1305,7 @@ order by pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _extension_exists | extension_name text | boolean pgmq | pgmq | _get_partition_col | partition_interval text | text pgmq | pgmq | _get_pg_partman_major_version | | integer pgmq | pgmq | _get_pg_partman_schema | | text @@ -1318,6 +1319,7 @@ order by pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean pgmq | pgmq | drop_queue | queue_name text | boolean pgmq | pgmq | format_table_name | queue_name text, prefix text | text pgmq | pgmq | list_queues | | SETOF pgmq.queue_record @@ -1325,9 +1327,19 @@ order by pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record pgmq | pgmq | purge_queue | queue_name text | bigint - pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record - pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | read | queue_name text, vt integer, qty integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb | SETOF bigint pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay timestamp with time zone | SETOF bigint pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record pgmq | pgmq | validate_queue_name | queue_name text | void @@ -4873,7 +4885,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4716 rows) +(4728 rows) /* @@ -5110,6 +5122,7 @@ order by pg_tle | pgtle | feature_info | schema_name pgmq | pgmq | a_foo | archived_at pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | headers pgmq | pgmq | a_foo | message pgmq | pgmq | a_foo | msg_id pgmq | pgmq | a_foo | read_ct @@ -5119,6 +5132,7 @@ order by pgmq | pgmq | meta | is_unlogged pgmq | pgmq | meta | queue_name pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | headers pgmq | pgmq | q_foo | message pgmq | pgmq | q_foo | msg_id pgmq | pgmq | q_foo | read_ct @@ -5294,5 +5308,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(387 rows) +(389 rows) diff --git a/nix/tests/expected/z_orioledb-17_ext_interface.out b/nix/tests/expected/z_orioledb-17_ext_interface.out index 46792e48f..6a7b4a16c 100644 --- a/nix/tests/expected/z_orioledb-17_ext_interface.out +++ b/nix/tests/expected/z_orioledb-17_ext_interface.out @@ -1305,6 +1305,7 @@ order by pgcrypto | extensions | pgp_sym_encrypt_bytea | bytea, text, text | bytea pgmq | pgmq | _belongs_to_pgmq | table_name text | boolean pgmq | pgmq | _ensure_pg_partman_installed | | void + pgmq | pgmq | _extension_exists | extension_name text | boolean pgmq | pgmq | _get_partition_col | partition_interval text | text pgmq | pgmq | _get_pg_partman_major_version | | integer pgmq | pgmq | _get_pg_partman_schema | | text @@ -1318,6 +1319,7 @@ order by pgmq | pgmq | delete | queue_name text, msg_id bigint | boolean pgmq | pgmq | delete | queue_name text, msg_ids bigint[] | SETOF bigint pgmq | pgmq | detach_archive | queue_name text | void + pgmq | pgmq | drop_queue | queue_name text, partitioned boolean | boolean pgmq | pgmq | drop_queue | queue_name text | boolean pgmq | pgmq | format_table_name | queue_name text, prefix text | text pgmq | pgmq | list_queues | | SETOF pgmq.queue_record @@ -1325,9 +1327,19 @@ order by pgmq | pgmq | metrics_all | | SETOF pgmq.metrics_result pgmq | pgmq | pop | queue_name text | SETOF pgmq.message_record pgmq | pgmq | purge_queue | queue_name text | bigint - pgmq | pgmq | read | queue_name text, vt integer, qty integer | SETOF pgmq.message_record - pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer | SETOF pgmq.message_record + pgmq | pgmq | read | queue_name text, vt integer, qty integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | read_with_poll | queue_name text, vt integer, qty integer, max_poll_seconds integer, poll_interval_ms integer, conditional jsonb | SETOF pgmq.message_record + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb | SETOF bigint pgmq | pgmq | send | queue_name text, msg jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, headers jsonb, delay integer | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb | SETOF bigint + pgmq | pgmq | send | queue_name text, msg jsonb, delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay timestamp with time zone | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], headers jsonb[], delay integer | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[] | SETOF bigint + pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay timestamp with time zone | SETOF bigint pgmq | pgmq | send_batch | queue_name text, msgs jsonb[], delay integer | SETOF bigint pgmq | pgmq | set_vt | queue_name text, msg_id bigint, vt integer | SETOF pgmq.message_record pgmq | pgmq | validate_queue_name | queue_name text | void @@ -4873,7 +4885,7 @@ order by xml2 | public | xpath_table | text, text, text, text, text | SETOF record xml2 | public | xslt_process | text, text | text xml2 | public | xslt_process | text, text, text | text -(4716 rows) +(4728 rows) /* @@ -5110,6 +5122,7 @@ order by pg_tle | pgtle | feature_info | schema_name pgmq | pgmq | a_foo | archived_at pgmq | pgmq | a_foo | enqueued_at + pgmq | pgmq | a_foo | headers pgmq | pgmq | a_foo | message pgmq | pgmq | a_foo | msg_id pgmq | pgmq | a_foo | read_ct @@ -5119,6 +5132,7 @@ order by pgmq | pgmq | meta | is_unlogged pgmq | pgmq | meta | queue_name pgmq | pgmq | q_foo | enqueued_at + pgmq | pgmq | q_foo | headers pgmq | pgmq | q_foo | message pgmq | pgmq | q_foo | msg_id pgmq | pgmq | q_foo | read_ct @@ -5294,5 +5308,5 @@ order by wrappers | public | wrappers_fdw_stats | rows_in wrappers | public | wrappers_fdw_stats | rows_out wrappers | public | wrappers_fdw_stats | updated_at -(387 rows) +(389 rows) From 39f9a0e011d794bff9c0c0acf7147deff7172a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 8 Oct 2025 19:18:50 +0200 Subject: [PATCH 114/134] fix(pgmq): add missing helper function in migration script (#1825) pg_regress tests are failing because the helper function pgmq._extension_exists() is missing in the 1.5.0 to 1.5.1 migration script. This change adds the missing function to the migration script. --- nix/ext/pgmq.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nix/ext/pgmq.nix b/nix/ext/pgmq.nix index 13cc987b0..0f7ab8413 100644 --- a/nix/ext/pgmq.nix +++ b/nix/ext/pgmq.nix @@ -60,6 +60,19 @@ let echo "default_version = '${version}'" cat $out/share/postgresql/extension/${pname}--${version}.control } > $out/share/postgresql/extension/${pname}.control + cat >> sql/pgmq--1.5.0--1.5.1.sql < Date: Wed, 8 Oct 2025 19:34:06 +0200 Subject: [PATCH 115/134] feat: run pg_regress tests after installing the last version of the extension (#1826) We have been testing the extension by running pg_regress tests after the migration of the extension (from the first available version to the last one). However, we were not testing the case where the last version of the extension is installed directly. This change adds a test for that case. --- nix/ext/tests/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index a612d72b2..03551a01a 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -151,7 +151,7 @@ let with subtest("Check upgrade path with postgresql 15"): test.check_upgrade_path("15") - with subtest("Check pg_regress with postgresql 15"): + with subtest("Check pg_regress with postgresql 15 after extension upgrade"): test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) last_version = None @@ -162,18 +162,27 @@ let with subtest("Test switch_${pname}_version"): test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") + with subtest("Check pg_regress with postgresql 15 after installing the last version"): + test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) + with subtest("switch to postgresql 17"): server.succeed( f"{pg17_configuration}/bin/switch-to-configuration test >&2" ) - with subtest("Check last version of the extension after upgrade"): + with subtest("Check last version of the extension after postgresql upgrade"): test.assert_version_matches(last_version) with subtest("Check upgrade path with postgresql 17"): test.check_upgrade_path("17") - with subtest("Check pg_regress with postgresql 17"): + with subtest("Check pg_regress with postgresql 17 after extension upgrade"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) + + with subtest("Check the install of the last version of the extension"): + test.check_install_last_version("17") + + with subtest("Check pg_regress with postgresql 17 after installing the last version"): test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) ''; }; From a9c198a839d1fc68b41a829d74a15951330bce18 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com> Date: Wed, 8 Oct 2025 12:15:02 -0700 Subject: [PATCH 116/134] feat(migrations): predefined role grants (#1815) * feat(migrations): predefined role grants - supabase_etl_admin needs pg_monitor to query system catalog tables (e.g. pg_replication_slots) - supabase_read_only_user needs pg_monitor to view queries in pg_stat_statements - grant pg_create_subscription to postgres with admin option in case users want to create subscriptions with their own roles * chore: bump version * test: update * chore: bump versions --- ansible/vars.yml | 6 +++--- .../20251001204436_predefined_role_grants.sql | 15 +++++++++++++++ nix/tests/expected/z_15_roles.out | 4 +++- nix/tests/expected/z_17_roles.out | 10 +++++++--- 4 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 migrations/db/migrations/20251001204436_predefined_role_grants.sql diff --git a/ansible/vars.yml b/ansible/vars.yml index 55c1300e4..08bb3bff2 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.037-orioledb - postgres17: 17.6.1.016 - postgres15: 15.14.1.016 + postgresorioledb-17: 17.5.1.038-orioledb + postgres17: 17.6.1.017 + postgres15: 15.14.1.017 # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/migrations/db/migrations/20251001204436_predefined_role_grants.sql b/migrations/db/migrations/20251001204436_predefined_role_grants.sql new file mode 100644 index 000000000..4ad8153e1 --- /dev/null +++ b/migrations/db/migrations/20251001204436_predefined_role_grants.sql @@ -0,0 +1,15 @@ +-- migrate:up +grant pg_monitor to supabase_etl_admin, supabase_read_only_user; + +do $$ +declare + major_version int; +begin + select current_setting('server_version_num')::int / 10000 into major_version; + + if major_version >= 16 then + grant pg_create_subscription to postgres with admin option; + end if; +end $$; + +-- migrate:down diff --git a/nix/tests/expected/z_15_roles.out b/nix/tests/expected/z_15_roles.out index 796b298bb..3f14bb6a1 100644 --- a/nix/tests/expected/z_15_roles.out +++ b/nix/tests/expected/z_15_roles.out @@ -29,8 +29,10 @@ order by postgres | pg_signal_backend | f postgres | pgtle_admin | f postgres | service_role | f + supabase_etl_admin | pg_monitor | f supabase_etl_admin | pg_read_all_data | f + supabase_read_only_user | pg_monitor | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(19 rows) +(21 rows) diff --git a/nix/tests/expected/z_17_roles.out b/nix/tests/expected/z_17_roles.out index ecda2ffde..e70dc2ae2 100644 --- a/nix/tests/expected/z_17_roles.out +++ b/nix/tests/expected/z_17_roles.out @@ -60,16 +60,18 @@ order by postgres | anon | t postgres | authenticated | t postgres | authenticator | t - postgres | pg_create_subscription | f + postgres | pg_create_subscription | t postgres | pg_monitor | t postgres | pg_read_all_data | t postgres | pg_signal_backend | t postgres | pgtle_admin | f postgres | service_role | t + supabase_etl_admin | pg_monitor | f supabase_etl_admin | pg_read_all_data | f + supabase_read_only_user | pg_monitor | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(21 rows) +(23 rows) -- Check version-specific privileges of the roles on the schemas select schema_name, privilege_type, grantee, default_for @@ -158,8 +160,10 @@ order by postgres | pg_signal_backend | t postgres | pgtle_admin | f postgres | service_role | t + supabase_etl_admin | pg_monitor | f supabase_etl_admin | pg_read_all_data | f + supabase_read_only_user | pg_monitor | f supabase_read_only_user | pg_read_all_data | f supabase_storage_admin | authenticator | f -(20 rows) +(22 rows) From 1b91692026b22631a91107cc1feaee7f309656a9 Mon Sep 17 00:00:00 2001 From: Bobbie Soedirgo Date: Tue, 7 Oct 2025 14:58:46 -0700 Subject: [PATCH 117/134] feat: update supautils confs w/ new tables --- ansible/files/postgresql_config/supautils.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/files/postgresql_config/supautils.conf.j2 b/ansible/files/postgresql_config/supautils.conf.j2 index a3456f699..43875c194 100644 --- a/ansible/files/postgresql_config/supautils.conf.j2 +++ b/ansible/files/postgresql_config/supautils.conf.j2 @@ -1,6 +1,6 @@ supautils.extensions_parameter_overrides = '{"pg_cron":{"schema":"pg_catalog"}}' -supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.mfa_factors","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' -supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.identities","auth.mfa_factors","auth.refresh_tokens","auth.sessions","auth.users","realtime.messages","storage.buckets","storage.migrations","storage.objects","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' +supautils.policy_grants = '{"postgres":["auth.audit_log_entries","auth.flow_state","auth.identities","auth.instances","auth.mfa_amr_claims","auth.mfa_challenges","auth.mfa_factors","auth.oauth_clients","auth.one_time_tokens","auth.refresh_tokens","auth.saml_providers","auth.saml_relay_states","auth.sessions","auth.sso_domains","auth.sso_providers","auth.users","realtime.messages","realtime.subscription","storage.buckets","storage.buckets_analytics","storage.objects","storage.prefixes","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' +supautils.drop_trigger_grants = '{"postgres":["auth.audit_log_entries","auth.flow_state","auth.identities","auth.instances","auth.mfa_amr_claims","auth.mfa_challenges","auth.mfa_factors","auth.oauth_clients","auth.one_time_tokens","auth.refresh_tokens","auth.saml_providers","auth.saml_relay_states","auth.sessions","auth.sso_domains","auth.sso_providers","auth.users","realtime.messages","realtime.subscription","storage.buckets","storage.buckets_analytics","storage.objects","storage.prefixes","storage.s3_multipart_uploads","storage.s3_multipart_uploads_parts"]}' # full list: address_standardizer, address_standardizer_data_us, adminpack, amcheck, autoinc, bloom, btree_gin, btree_gist, citext, cube, dblink, dict_int, dict_xsyn, earthdistance, file_fdw, fuzzystrmatch, hstore, http, hypopg, index_advisor, insert_username, intagg, intarray, isn, lo, ltree, moddatetime, old_snapshot, orioledb, pageinspect, pg_buffercache, pg_cron, pg_freespacemap, pg_graphql, pg_hashids, pg_jsonschema, pg_net, pg_prewarm, pg_repack, pg_stat_monitor, pg_stat_statements, pg_surgery, pg_tle, pg_trgm, pg_visibility, pg_walinspect, pgaudit, pgcrypto, pgjwt, pgmq, pgroonga, pgroonga_database, pgrouting, pgrowlocks, pgsodium, pgstattuple, pgtap, plcoffee, pljava, plls, plpgsql, plpgsql_check, plv8, postgis, postgis_raster, postgis_sfcgal, postgis_tiger_geocoder, postgis_topology, postgres_fdw, refint, rum, seg, sslinfo, supabase_vault, supautils, tablefunc, tcn, timescaledb, tsm_system_rows, tsm_system_time, unaccent, uuid-ossp, vector, wrappers, xml2 # omitted because may be unsafe: adminpack, amcheck, file_fdw, lo, old_snapshot, pageinspect, pg_freespacemap, pg_surgery, pg_visibility # omitted because deprecated: intagg, xml2 From cdb8609eea86e28ce591ed1282568605d248364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cemal=20K=C4=B1l=C4=B1=C3=A7?= Date: Thu, 9 Oct 2025 11:54:36 +0200 Subject: [PATCH 118/134] feat: bump auth to v2.180.0 (#1829) --- ansible/vars.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 08bb3bff2..0ca4a9b3e 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.038-orioledb - postgres17: 17.6.1.017 - postgres15: 15.14.1.017 + postgresorioledb-17: 17.5.1.039-orioledb + postgres17: 17.6.1.018 + postgres15: 15.14.1.018 # Non Postgres Extensions pgbouncer_release: 1.19.0 @@ -25,8 +25,8 @@ postgrest_release: 13.0.5 postgrest_arm_release_checksum: sha256:7b4eafdaf76bc43b57f603109d460a838f89f949adccd02f452ca339f9a0a0d4 postgrest_x86_release_checksum: sha256:05be2bd48abee6c1691fc7c5d005023466c6989e41a4fc7d1302b8212adb88b5 -gotrue_release: 2.179.0 -gotrue_release_checksum: sha1:e985fce00b2720b747e6a04420910015c4967121 +gotrue_release: 2.180.0 +gotrue_release_checksum: sha1:386c1fb6be075004091b2fbd8662dc9dcdc7af04 aws_cli_release: 2.23.11 From e67b4782ede87035252264db14043fd2436e5398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 9 Oct 2025 20:10:53 +0200 Subject: [PATCH 119/134] feat: support multiple versions of the pg_jsonschema extension (#1757) * feat: multiple versions for the pg_jsonschema extension Build multiple versions of the pg_jsonschema extension to on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * fix: centralize bindgen hook override for pgrx extensions Move the bindgen hook fix for ARM NEON vector ABI issues from pg_graphql to mkPgrxExtension, making it available to all pgrx-based extensions. This fix applies to pgrx versions 0.6.1 through 0.11.2 when building on aarch64-linux. * fix: missing dependency on macOS for pg_jsonschema * chore: bump to release --------- Co-authored-by: Sam Rose --- .gitignore | 2 +- ansible/vars.yml | 6 +- nix/cargo-pgrx/buildPgrxExtension.nix | 3 +- nix/cargo-pgrx/default.nix | 5 + nix/cargo-pgrx/mkPgrxExtension.nix | 21 + nix/cargo-pgrx/versions.json | 3 + nix/ext/pg_graphql/default.nix | 26 - nix/ext/pg_jsonschema.nix | 92 - nix/ext/pg_jsonschema/Cargo-0.1.0.lock | 2719 ++++++++++++++++++++++++ nix/ext/pg_jsonschema/Cargo-0.1.1.lock | 2424 +++++++++++++++++++++ nix/ext/pg_jsonschema/Cargo-0.1.3.lock | 2425 +++++++++++++++++++++ nix/ext/pg_jsonschema/default.nix | 173 ++ nix/ext/tests/default.nix | 1 + nix/ext/versions.json | 43 + nix/overlays/default.nix | 4 + nix/packages/postgres.nix | 2 +- 16 files changed, 7825 insertions(+), 124 deletions(-) delete mode 100644 nix/ext/pg_jsonschema.nix create mode 100644 nix/ext/pg_jsonschema/Cargo-0.1.0.lock create mode 100644 nix/ext/pg_jsonschema/Cargo-0.1.1.lock create mode 100644 nix/ext/pg_jsonschema/Cargo-0.1.3.lock create mode 100644 nix/ext/pg_jsonschema/default.nix diff --git a/.gitignore b/.gitignore index 1e8b1d680..f5b1a40fc 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ common-nix.vars.pkr.hcl # pre-commit config is managed in nix .pre-commit-config.yaml -nixos.qcow2 \ No newline at end of file +nixos.qcow2 diff --git a/ansible/vars.yml b/ansible/vars.yml index 0ca4a9b3e..4013a1052 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: 17.5.1.039-orioledb - postgres17: 17.6.1.018 - postgres15: 15.14.1.018 + postgresorioledb-17: "17.5.1.040-orioledb" + postgres17: "17.6.1.019" + postgres15: "15.14.1.019" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/cargo-pgrx/buildPgrxExtension.nix b/nix/cargo-pgrx/buildPgrxExtension.nix index 7ad87c550..828dd7f02 100644 --- a/nix/cargo-pgrx/buildPgrxExtension.nix +++ b/nix/cargo-pgrx/buildPgrxExtension.nix @@ -34,6 +34,7 @@ stdenv, darwin, writeShellScriptBin, + defaultBindgenHook, }: # The idea behind: Use it mostly like rustPlatform.buildRustPackage and so @@ -56,7 +57,7 @@ # enable override to generate bindings using bindgenHook. # Some older versions of cargo-pgrx use a bindgenHook that is not compatible with the # current clang version present in stdenv - bindgenHook ? rustPlatform.bindgenHook, + bindgenHook ? defaultBindgenHook, # cargo-pgrx calls rustfmt on generated bindings, this is not strictly necessary, so we avoid the # dependency here. Set to false and provide rustfmt in nativeBuildInputs, if you need it, e.g. # if you include the generated code in the output via postInstall. diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 02c965a94..86dfa4c19 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -60,6 +60,11 @@ let }; in { + cargo-pgrx_0_10_2 = mkCargoPgrx { + version = "0.10.2"; + hash = "sha256-FqjfbJmSy5UCpPPPk4bkEyvQCnaH9zYtkI7txgIn+ls="; + cargoHash = "sha256-syZ3cQq8qDHBLvqmNDGoxeK6zXHJ47Jwkw3uhaXNCzI="; + }; cargo-pgrx_0_11_3 = mkCargoPgrx { version = "0.11.3"; hash = "sha256-UHIfwOdXoJvR4Svha6ud0FxahP1wPwUtviUwUnTmLXU="; diff --git a/nix/cargo-pgrx/mkPgrxExtension.nix b/nix/cargo-pgrx/mkPgrxExtension.nix index 41eef5091..c7970451a 100644 --- a/nix/cargo-pgrx/mkPgrxExtension.nix +++ b/nix/cargo-pgrx/mkPgrxExtension.nix @@ -4,6 +4,7 @@ pgrxVersion, makeRustPlatform, rust-bin, + system, }: let inherit ((callPackage ./default.nix { inherit rustVersion; })) mkCargoPgrx; @@ -31,8 +32,28 @@ let inherit (mapping) hash cargoHash; version = pgrxVersion; }; + + bindgenHook = + # Fix bindgen error on aarch64-linux for versions using pgrx with bindgen 0.68.1 + # This affects pgrx 0.6.1 through 0.11.2 which have issues with ARM NEON vector ABI + if (builtins.compareVersions "0.11.3" pgrxVersion > 0) then + let + nixos2211 = ( + import (builtins.fetchTarball { + url = "https://channels.nixos.org/nixos-22.11/nixexprs.tar.xz"; + sha256 = "1j7h75a9hwkkm97jicky5rhvzkdwxsv5v46473rl6agvq2sj97y1"; + }) { inherit system; } + ); + in + rustPlatform.bindgenHook.overrideAttrs { + libclang = nixos2211.clang.cc.lib; + clang = nixos2211.clang; + } + else + rustPlatform.bindgenHook; in callPackage ./buildPgrxExtension.nix { inherit rustPlatform; inherit cargo-pgrx; + defaultBindgenHook = bindgenHook; } diff --git a/nix/cargo-pgrx/versions.json b/nix/cargo-pgrx/versions.json index 6efe3315f..4c8d6bef5 100644 --- a/nix/cargo-pgrx/versions.json +++ b/nix/cargo-pgrx/versions.json @@ -36,6 +36,9 @@ "rust": { "1.70.0": { "cargoHash": "sha256-syZ3cQq8qDHBLvqmNDGoxeK6zXHJ47Jwkw3uhaXNCzI=" + }, + "1.76.0": { + "cargoHash": "sha256-syZ3cQq8qDHBLvqmNDGoxeK6zXHJ47Jwkw3uhaXNCzI=" } } }, diff --git a/nix/ext/pg_graphql/default.nix b/nix/ext/pg_graphql/default.nix index 18bca5871..d944d5ede 100644 --- a/nix/ext/pg_graphql/default.nix +++ b/nix/ext/pg_graphql/default.nix @@ -7,8 +7,6 @@ postgresql, rust-bin, rsync, - system, - rustPlatform, }: let @@ -104,30 +102,6 @@ let inherit (postgresql.meta) platforms; }; } - // - lib.optionalAttrs - ( - # Fix bindgen error on aarch64-linux for versions using pgrx with bindgen 0.68.1 - # This affects pgrx 0.6.1 through 0.11.2 which have issues with ARM NEON vector ABI - # We apply the fix to all versions up to 1.5.1 (last version before 1.5.4 which uses 0.11.2) - builtins.compareVersions "1.5.4" version > 0 - ) - { - # Fix bindgen error on aarch64-linux by using an older version of clang - bindgenHook = - let - nixos2211 = ( - import (builtins.fetchTarball { - url = "https://channels.nixos.org/nixos-22.11/nixexprs.tar.xz"; - sha256 = "1j7h75a9hwkkm97jicky5rhvzkdwxsv5v46473rl6agvq2sj97y1"; - }) { inherit system; } - ); - in - rustPlatform.bindgenHook.overrideAttrs { - libclang = nixos2211.clang.cc.lib; - clang = nixos2211.clang; - }; - } // lib.optionalAttrs (builtins.compareVersions "1.2.0" version >= 0) { # Add missing Cargo.lock patches = [ ./0001-Add-missing-Cargo.lock-${version}.patch ]; diff --git a/nix/ext/pg_jsonschema.nix b/nix/ext/pg_jsonschema.nix deleted file mode 100644 index 794757678..000000000 --- a/nix/ext/pg_jsonschema.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - postgresql, - buildPgrxExtension_0_12_6, - rust-bin, -}: -let - rustVersion = "1.80.0"; - cargo = rust-bin.stable.${rustVersion}.default; -in -buildPgrxExtension_0_12_6 rec { - pname = "pg_jsonschema"; - version = "0.3.3"; - inherit postgresql; - - src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "v${version}"; - hash = "sha256-Au1mqatoFKVq9EzJrpu1FVq5a1kBb510sfC980mDlsU="; - }; - - nativeBuildInputs = [ cargo ]; - buildInputs = [ postgresql ]; - # update the following array when the pg_jsonschema version is updated - # required to ensure that extensions update scripts from previous versions are generated - - previousVersions = [ - "0.3.1" - "0.3.0" - "0.2.0" - "0.1.4" - "0.1.4" - "0.1.2" - "0.1.1" - "0.1.0" - ]; - CARGO = "${cargo}/bin/cargo"; - #darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions - env = lib.optionalAttrs stdenv.isDarwin { - POSTGRES_LIB = "${postgresql}/lib"; - RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; - PGPORT = toString ( - 5441 - + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) - # +1 for OrioleDB - + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 - ); # +2 for each major version - }; - - cargoLock = { - lockFile = "${src}/Cargo.lock"; - allowBuiltinFetchGit = false; - }; - - # FIXME (aseipp): testsuite tries to write files into /nix/store; we'll have - # to fix this a bit later. - doCheck = false; - - preBuild = '' - echo "Processing git tags..." - echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt - ''; - - postInstall = '' - echo "Creating SQL files for previous versions..." - current_version="${version}" - sql_file="$out/share/postgresql/extension/pg_jsonschema--$current_version.sql" - - if [ -f "$sql_file" ]; then - while read -r previous_version; do - if [ "$(printf '%s\n' "$previous_version" "$current_version" | sort -V | head -n1)" = "$previous_version" ] && [ "$previous_version" != "$current_version" ]; then - new_file="$out/share/postgresql/extension/pg_jsonschema--$previous_version--$current_version.sql" - echo "Creating $new_file" - cp "$sql_file" "$new_file" - fi - done < git_tags.txt - else - echo "Warning: $sql_file not found" - fi - rm git_tags.txt - ''; - - meta = with lib; { - description = "JSON Schema Validation for PostgreSQL"; - homepage = "https://github.com/supabase/$%7Bpname%7D"; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - }; -} diff --git a/nix/ext/pg_jsonschema/Cargo-0.1.0.lock b/nix/ext/pg_jsonschema/Cargo-0.1.0.lock new file mode 100644 index 000000000..1381f2bd7 --- /dev/null +++ b/nix/ext/pg_jsonschema/Cargo-0.1.0.lock @@ -0,0 +1,2719 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "build-deps" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f14468960818ce4f3e3553c32d524446687884f8e7af5d3e252331d8a87e43" +dependencies = [ + "glob", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "color-eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors 4.2.1", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" +dependencies = [ + "once_cell", + "owo-colors 4.2.1", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cstr_core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "enum-primitive-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c375b9c5eadb68d0a6efee2999fef292f45854c3444c86f09d8ab086ba942b0e" +dependencies = [ + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "env_proxy" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a5019be18538406a43b5419a5501461f0c8b49ea7dfda0cfc32f4e51fc44be1" +dependencies = [ + "log", + "url", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fancy-regex" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fraction" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa5de57a62c2440ece64342ea59efb7171aa7d016faf8dfcb8795066a17146b" +dependencies = [ + "lazy_static", + "num", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.1", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "iso8601" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "296af15e112ec6dc38c9fd3ae027b5337a75466e8eed757bd7d5cf742ea85eb6" +dependencies = [ + "nom", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "jsonschema" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca9e2b45609132ae2214d50482c03aeee78826cd6fd53a8940915b81acedf16" +dependencies = [ + "ahash", + "anyhow", + "base64 0.13.1", + "bytecount", + "fancy-regex 0.10.0", + "fraction", + "iso8601", + "itoa", + "lazy_static", + "memchr", + "num-cmp", + "parking_lot", + "percent-encoding", + "regex", + "serde", + "serde_json", + "time", + "url", + "uuid", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.0", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi 0.5.1", + "libc", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "owo-colors" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26995317201fa17f3656c36716aed4a7c81743a9634ac4c99c0eeda495db0cec" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_jsonschema" +version = "0.1.0" +dependencies = [ + "jsonschema", + "pgx", + "pgx-tests", + "serde", + "serde_json", +] + +[[package]] +name = "pgx" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f3f571b70d230cba9ec46c530000469710ef2c1ea3eadf56d7bc8a62b3510c" +dependencies = [ + "atomic-traits", + "bitflags 1.3.2", + "cstr_core", + "enum-primitive-derive", + "eyre", + "heapless", + "num-traits", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-utils", + "quote", + "seahash", + "serde", + "serde_cbor", + "serde_json", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-macros" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b854e9b42fa8940b5fa393915df75db559384f14663c8966eb5161b554ff5842" +dependencies = [ + "pgx-utils", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57be652efd8d69525ba4ec04743b2aa2feb024ef7c5d39d35f9bf5638bf64d48" +dependencies = [ + "bindgen", + "build-deps", + "color-eyre", + "eyre", + "memoffset", + "num_cpus", + "once_cell", + "owo-colors 3.5.0", + "pgx-macros", + "pgx-utils", + "proc-macro2", + "quote", + "rayon", + "syn 1.0.109", +] + +[[package]] +name = "pgx-tests" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9012d509f69898cc15762c3feb78b6a61b3a66a533084351f6afe89c78b8e47" +dependencies = [ + "eyre", + "libc", + "once_cell", + "owo-colors 3.5.0", + "pgx", + "pgx-macros", + "pgx-utils", + "postgres", + "regex", + "serde", + "serde_json", + "shutdown_hooks", + "time", +] + +[[package]] +name = "pgx-utils" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce5d334b177a9cd741521d01ebea505417adddaef4d368753b34ac4a43052674" +dependencies = [ + "atty", + "convert_case", + "dirs", + "env_proxy", + "eyre", + "owo-colors 3.5.0", + "petgraph", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rttp_client", + "serde", + "serde-xml-rs", + "serde_derive", + "serde_json", + "syn 1.0.109", + "syntect", + "toml", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", + "url", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "plist" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac26e981c03a6e53e0aee43c113e3202f5581d5360dae7bd2c70e800dd0451d" +dependencies = [ + "base64 0.22.1", + "indexmap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "postgres" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363e6dfbdd780d3aa3597b6eb430db76bb315fa9bad7fae595bb8def808b8470" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" +dependencies = [ + "base64 0.22.1", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand 0.9.1", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rttp_client" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1396558eebd03e50e6526071e0bdcec24e3d67f4fec14bcc8139f24ae941db72" +dependencies = [ + "base64 0.11.0", + "flate2", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "rand 0.7.3", + "socks", + "url", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-xml-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65162e9059be2f6a3421ebbb4fef3e74b7d9e7c60c50a0e292c6239f19f1edfa" +dependencies = [ + "log", + "serde", + "thiserror 1.0.69", + "xml-rs", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shutdown_hooks" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6057adedbec913419c92996f395ba69931acbd50b7d56955394cd3f7bedbfa45" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socks" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "syntect" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" +dependencies = [ + "bincode", + "bitflags 1.3.2", + "fancy-regex 0.11.0", + "flate2", + "fnv", + "once_cell", + "plist", + "regex-syntax 0.8.5", + "serde", + "serde_derive", + "serde_json", + "thiserror 1.0.69", + "walkdir", + "yaml-rust", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand 0.9.1", + "socket2", + "tokio", + "tokio-util", + "whoami", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall", + "wasite", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "xml-rs" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] diff --git a/nix/ext/pg_jsonschema/Cargo-0.1.1.lock b/nix/ext/pg_jsonschema/Cargo-0.1.1.lock new file mode 100644 index 000000000..b4623f052 --- /dev/null +++ b/nix/ext/pg_jsonschema/Cargo-0.1.1.lock @@ -0,0 +1,2424 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cstr_core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fancy-regex" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fraction" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa5de57a62c2440ece64342ea59efb7171aa7d016faf8dfcb8795066a17146b" +dependencies = [ + "lazy_static", + "num", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.1", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "iso8601" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "296af15e112ec6dc38c9fd3ae027b5337a75466e8eed757bd7d5cf742ea85eb6" +dependencies = [ + "nom", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "jsonschema" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca9e2b45609132ae2214d50482c03aeee78826cd6fd53a8940915b81acedf16" +dependencies = [ + "ahash", + "anyhow", + "base64 0.13.1", + "bytecount", + "fancy-regex", + "fraction", + "iso8601", + "itoa", + "lazy_static", + "memchr", + "num-cmp", + "parking_lot", + "percent-encoding", + "regex", + "serde", + "serde_json", + "time", + "url", + "uuid", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.0", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_jsonschema" +version = "0.1.1" +dependencies = [ + "jsonschema", + "pgx", + "pgx-tests", + "serde", + "serde_json", +] + +[[package]] +name = "pgx" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b9addd0e22dd8a288414d28680dfca9b5d3304da1b29cc0fc24e65a1af026" +dependencies = [ + "atomic-traits", + "bitflags 1.3.2", + "bitvec", + "cstr_core", + "eyre", + "heapless", + "libc", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-utils", + "quote", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror 1.0.69", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-macros" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7eb8e41b10375bcef714474ca58a6cc049640dd167d7783db308b703c44a14" +dependencies = [ + "pgx-utils", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgx-pg-config" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78fb4764144e366314eae67fd7aa1801e51790172c62eb7731a6d5ff36036ae4" +dependencies = [ + "dirs", + "eyre", + "owo-colors", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5116a27961f08337961cfb9e7be73c809e68c1001e9b205b9584ecd744471bb" +dependencies = [ + "bindgen", + "eyre", + "memoffset", + "once_cell", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "proc-macro2", + "quote", + "rayon", + "shlex", + "sptr", + "syn 1.0.109", +] + +[[package]] +name = "pgx-tests" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce250496208c64c546f614d604208edea4b447edd17873a90283e5ac4b9de594" +dependencies = [ + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgx", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "postgres", + "regex", + "serde", + "serde_json", + "shutdown_hooks", + "thiserror 1.0.69", + "time", +] + +[[package]] +name = "pgx-utils" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a866f68ab3fcc7cc38a0b121581f2939deebddde1bae396b1e03498d4d82315e" +dependencies = [ + "atty", + "convert_case", + "cstr_core", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "regex", + "seq-macro", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363e6dfbdd780d3aa3597b6eb430db76bb315fa9bad7fae595bb8def808b8470" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" +dependencies = [ + "base64 0.22.1", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shutdown_hooks" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6057adedbec913419c92996f395ba69931acbd50b7d56955394cd3f7bedbfa45" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand", + "socket2", + "tokio", + "tokio-util", + "whoami", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall", + "wasite", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] diff --git a/nix/ext/pg_jsonschema/Cargo-0.1.3.lock b/nix/ext/pg_jsonschema/Cargo-0.1.3.lock new file mode 100644 index 000000000..cc7c68098 --- /dev/null +++ b/nix/ext/pg_jsonschema/Cargo-0.1.3.lock @@ -0,0 +1,2425 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.3", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-traits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29ec3788e96fb4fdb275ccb9d62811f2fa903d76c5eb4dd6fe7d09a7ed5871f" +dependencies = [ + "cfg-if", + "rustc_version 0.3.3", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cstr_core" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd98742e4fdca832d40cab219dc2e3048de17d873248f83f17df47c1bea70956" +dependencies = [ + "cty", + "memchr", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fancy-regex" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fraction" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa5de57a62c2440ece64342ea59efb7171aa7d016faf8dfcb8795066a17146b" +dependencies = [ + "lazy_static", + "num", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.1", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "iso8601" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "296af15e112ec6dc38c9fd3ae027b5337a75466e8eed757bd7d5cf742ea85eb6" +dependencies = [ + "nom", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "jsonschema" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ca9e2b45609132ae2214d50482c03aeee78826cd6fd53a8940915b81acedf16" +dependencies = [ + "ahash", + "anyhow", + "base64 0.13.1", + "bytecount", + "fancy-regex", + "fraction", + "iso8601", + "itoa", + "lazy_static", + "memchr", + "num-cmp", + "parking_lot", + "percent-encoding", + "regex", + "serde", + "serde_json", + "time", + "url", + "uuid", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libloading" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" +dependencies = [ + "cfg-if", + "windows-targets 0.53.0", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pg_jsonschema" +version = "0.1.3" +dependencies = [ + "jsonschema", + "pgx", + "pgx-tests", + "serde", + "serde_json", +] + +[[package]] +name = "pgx" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9d4197911a62aa8f44512501414756466c9aeea33e18578f7658ef53c1f155" +dependencies = [ + "atomic-traits", + "bitflags 1.3.2", + "bitvec", + "cstr_core", + "eyre", + "heapless", + "libc", + "once_cell", + "pgx-macros", + "pgx-pg-sys", + "pgx-utils", + "quote", + "seahash", + "seq-macro", + "serde", + "serde_cbor", + "serde_json", + "thiserror 1.0.69", + "time", + "tracing", + "tracing-error", + "uuid", +] + +[[package]] +name = "pgx-macros" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c543fd86fa8b496735d78e4cefd10ca2d275365e5fe4da532970f3b722946d8" +dependencies = [ + "pgx-utils", + "proc-macro2", + "quote", + "syn 1.0.109", + "unescape", +] + +[[package]] +name = "pgx-pg-config" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba575fca3635dc2e145f1bc204c4a10e5567b96bede1a884eeab6a998516fd2" +dependencies = [ + "dirs", + "eyre", + "owo-colors", + "serde", + "serde_derive", + "serde_json", + "toml", + "url", +] + +[[package]] +name = "pgx-pg-sys" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cc7628aa959b1e928fe9289c517e1b1e10d7ca8ad4926792fa86b62b997f9c1" +dependencies = [ + "bindgen", + "eyre", + "libc", + "memoffset", + "once_cell", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "proc-macro2", + "quote", + "rayon", + "shlex", + "sptr", + "syn 1.0.109", +] + +[[package]] +name = "pgx-tests" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229d1b58ee002386113e483a1d9fd917b9e185105cbf0e1e787a0f093a026e26" +dependencies = [ + "eyre", + "libc", + "once_cell", + "owo-colors", + "pgx", + "pgx-macros", + "pgx-pg-config", + "pgx-utils", + "postgres", + "regex", + "serde", + "serde_json", + "shutdown_hooks", + "thiserror 1.0.69", + "time", +] + +[[package]] +name = "pgx-utils" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e66c2a5e23d2bdbef29ebed4bf66fa844ec77e62baa1b56c64e800fbf507a798" +dependencies = [ + "atty", + "convert_case", + "cstr_core", + "eyre", + "petgraph", + "proc-macro2", + "quote", + "regex", + "seq-macro", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "tracing", + "tracing-error", + "tracing-subscriber", + "unescape", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "postgres" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363e6dfbdd780d3aa3597b6eb430db76bb315fa9bad7fae595bb8def808b8470" +dependencies = [ + "bytes", + "fallible-iterator", + "futures-util", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "postgres-protocol" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ff0abab4a9b844b93ef7b81f1efc0a366062aaef2cd702c76256b5dc075c54" +dependencies = [ + "base64 0.22.1", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613283563cd90e1dfc3518d548caee47e0e725455ed619881f5cf21f36de4b48" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustversion" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "seq-macro" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "shutdown_hooks" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6057adedbec913419c92996f395ba69931acbd50b7d56955394cd3f7bedbfa45" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c95d533c83082bb6490e0189acaa0bbeef9084e60471b696ca6988cd0541fb0" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "rand", + "socket2", + "tokio", + "tokio-util", + "whoami", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall", + "wasite", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] diff --git a/nix/ext/pg_jsonschema/default.nix b/nix/ext/pg_jsonschema/default.nix new file mode 100644 index 000000000..74742bed5 --- /dev/null +++ b/nix/ext/pg_jsonschema/default.nix @@ -0,0 +1,173 @@ +{ + lib, + pkgs, + stdenv, + callPackages, + fetchFromGitHub, + postgresql, + rust-bin, + darwin, +}: +let + pname = "pg_jsonschema"; + build = + version: hash: rustVersion: pgrxVersion: + let + cargo = rust-bin.stable.${rustVersion}.default; + mkPgrxExtension = callPackages ../../cargo-pgrx/mkPgrxExtension.nix { + inherit rustVersion pgrxVersion; + }; + src = fetchFromGitHub { + owner = "supabase"; + repo = pname; + rev = "v${version}"; + inherit hash; + }; + lockFile = + if builtins.pathExists "${src}/Cargo.lock" then "${src}/Cargo.lock" else ./Cargo-${version}.lock; + in + mkPgrxExtension rec { + inherit + pname + version + postgresql + src + ; + + postPatch = + if builtins.pathExists ./Cargo-${version}.lock then + '' + ln -s ${./Cargo-${version}.lock} Cargo.lock + '' + else + ""; + + nativeBuildInputs = [ cargo ]; + buildInputs = [ + postgresql + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.SystemConfiguration ]; + # update the following array when the pg_jsonschema version is updated + # required to ensure that extensions update scripts from previous versions are generated + + previousVersions = [ + "0.3.1" + "0.3.0" + "0.2.0" + "0.1.4" + "0.1.3" + "0.1.2" + "0.1.1" + "0.1.0" + ]; + CARGO = "${cargo}/bin/cargo"; + #darwin env needs PGPORT to be unique for build to not clash with other pgrx extensions + env = lib.optionalAttrs stdenv.isDarwin { + POSTGRES_LIB = "${postgresql}/lib"; + RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup"; + PGPORT = toString ( + 5441 + + (if builtins.match ".*_.*" postgresql.version != null then 1 else 0) + # +1 for OrioleDB + + ((builtins.fromJSON (builtins.substring 0 2 postgresql.version)) - 15) * 2 + ); # +2 for each major version + }; + + cargoLock = { + inherit lockFile; + allowBuiltinFetchGit = false; + }; + + preCheck = '' + export PGRX_HOME=$(mktemp -d) + export NIX_PGLIBDIR=$PGRX_HOME/${lib.versions.major postgresql.version}/lib + ${lib.getExe pkgs.rsync} --chmod=ugo+w -a ${postgresql}/ ${postgresql.lib}/ $PGRX_HOME/${lib.versions.major postgresql.version}/ + cargo pgrx init --pg${lib.versions.major postgresql.version} $PGRX_HOME/${lib.versions.major postgresql.version}/bin/pg_config + ''; + + doCheck = true; + + preBuild = '' + echo "Processing git tags..." + echo '${builtins.concatStringsSep "," previousVersions}' | sed 's/,/\n/g' > git_tags.txt + ''; + + postInstall = '' + mv $out/lib/${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + create_control_files() { + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + rm $out/share/postgresql/extension/${pname}.control + + if [[ "${version}" == "${latestVersion}" ]]; then + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + fi + } + + create_control_files + ''; + + meta = with lib; { + description = "JSON Schema Validation for PostgreSQL"; + homepage = "https://github.com/supabase/$%7Bpname%7D"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; + }; + allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).pg_jsonschema; + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash value.rust value.pgrx) supportedVersions + ); +in +pkgs.buildEnv { + name = pname; + paths = packages; + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + postBuild = '' + # checks + (set -x + test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ + toString (numberOfVersions + 1) + }" + ) + + create_sql_files() { + PREVIOUS_VERSION="" + while IFS= read -r i; do + sed -i 's/CREATE FUNCTION/CREATE OR REPLACE FUNCTION/g' "$i" + FILENAME=$(basename "$i") + DIRNAME=$(dirname "$i") + VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)" + if [[ "$PREVIOUS_VERSION" != "" ]]; then + echo "Processing $i" + MIGRATION_FILENAME="$DIRNAME/''${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}" + cp "$i" "$MIGRATION_FILENAME" + fi + PREVIOUS_VERSION="$VERSION" + done < <(find $out -name '*.sql' | sort -V) + } + + create_sql_files + ''; + + passthru = { + inherit versions numberOfVersions; + pname = "${pname}-all"; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); + }; +} diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index 03551a01a..d1f3d89ad 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -204,6 +204,7 @@ builtins.listToAttrs ( "index_advisor" "pg_cron" "pg_graphql" + "pg_jsonschema" "pg_net" "pgmq" "vector" diff --git a/nix/ext/versions.json b/nix/ext/versions.json index dfedda4aa..b5c000c7e 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -39,6 +39,49 @@ "hash": "sha256-G0eQk2bY5CNPMeokN/nb05g03CuiplRf902YXFVQFbs=" } }, + "pg_jsonschema": { + "0.1.0": { + "postgresql": [ + "12", + "13", + "14" + ], + "hash": "sha256-wd05ARaV88BhKxsKkdrEE7yEadOKlCCdmhK3F6tNmsM=" + }, + "0.1.1": { + "postgresql": [ + "12", + "13", + "14" + ], + "hash": "sha256-9jdOReqfObjEG/Gxb9fI9v/5XtqCF8WErsDL+WlOl0g=" + }, + "0.2.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-57gZbUVi8P4EB8T0P19JBVXcetQcr6IxuIx96NNFA/0=", + "pgrx": "0.10.2", + "rust": "1.76.0" + }, + "0.3.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-YdKpOEiDIz60xE7C+EzpYjBcH0HabnDbtZl23CYls6g=", + "pgrx": "0.11.3", + "rust": "1.76.0" + }, + "0.3.3": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-Au1mqatoFKVq9EzJrpu1FVq5a1kBb510sfC980mDlsU=", + "pgrx": "0.12.6", + "rust": "1.80.0" + } + }, "pg_cron": { "1.3.1": { "postgresql": [ diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index f005671d5..b508af8e3 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -37,6 +37,10 @@ inherit (final) writeShellScriptBin; }; + buildPgrxExtension_0_10_2 = prev.buildPgrxExtension.override { + cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_10_2; + }; + buildPgrxExtension_0_11_2 = prev.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_2; }; diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index dc72365b8..ce7d22c43 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -39,7 +39,7 @@ ../ext/pgsodium.nix ../ext/pg_graphql ../ext/pg_stat_monitor.nix - ../ext/pg_jsonschema.nix + ../ext/pg_jsonschema ../ext/pgvector.nix ../ext/vault.nix ../ext/hypopg.nix From 098740642e5bacb8df0ef7d9b8d7d48b4c12b6ee Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 9 Oct 2025 14:50:44 -0400 Subject: [PATCH 120/134] refactor(postgresq): switch to 'include_dir' and then renames conf files to ensure ordering (#1820) Co-authored-by: Sam Rose --- Dockerfile-15 | 13 +- Dockerfile-17 | 15 +- Dockerfile-orioledb-17 | 15 +- .../pg_upgrade_scripts/initiate.sh | 2 +- .../files/database-optimizations.service.j2 | 2 +- ansible/files/postgres_prestart.sh.j2 | 4 +- .../files/postgresql_config/autoexplain.conf | 3 + ansible/files/postgresql_config/pgcron.conf | 3 + .../postgresql_config/postgresql.conf.j2 | 643 +----------------- ansible/tasks/finalize-ami.yml | 13 +- ansible/tasks/internal/supautils.yml | 11 +- ansible/tasks/setup-docker.yml | 9 +- ansible/tasks/setup-postgres.yml | 10 +- ansible/tasks/setup-supabase-internal.yml | 14 - ansible/tasks/setup-wal-g.yml | 12 +- ansible/tasks/stage2-setup-postgres.yml | 6 +- nix/packages/lib.nix | 25 +- nix/tools/run-server.sh.in | 40 +- 18 files changed, 111 insertions(+), 729 deletions(-) create mode 100644 ansible/files/postgresql_config/autoexplain.conf create mode 100644 ansible/files/postgresql_config/pgcron.conf diff --git a/Dockerfile-15 b/Dockerfile-15 index 28f5122c0..4c5904e4f 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -158,20 +158,21 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ diff --git a/Dockerfile-17 b/Dockerfile-17 index 3ad03b37c..dcd80bcb1 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -162,20 +162,21 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ @@ -189,7 +190,7 @@ RUN sed -i \ RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" -RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/supautils.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/05-supautils.conf" diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 29f2fa527..0c6bc299f 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -162,20 +162,21 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ - -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ + /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ @@ -189,7 +190,7 @@ RUN sed -i \ RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" -RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/05-supautils.conf" RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf" RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf" diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 71016a294..5f1e7ed87 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -515,7 +515,7 @@ EOF mkdir -p "$MOUNT_POINT/conf" cp -R /etc/postgresql-custom/* "$MOUNT_POINT/conf/" # removing supautils config as to allow the latest one provided by the latest image to be used - rm -f "$MOUNT_POINT/conf/supautils.conf" || true + rm -f "$MOUNT_POINT/conf/05-supautils.conf" || true rm -rf "$MOUNT_POINT/conf/extension-custom-scripts" || true # removing wal-g config as to allow it to be explicitly enabled on the new instance diff --git a/ansible/files/database-optimizations.service.j2 b/ansible/files/database-optimizations.service.j2 index f25fc09c6..f2ad41ead 100644 --- a/ansible/files/database-optimizations.service.j2 +++ b/ansible/files/database-optimizations.service.j2 @@ -4,7 +4,7 @@ Description=Postgresql optimizations [Service] Type=oneshot # we do not want failures from these commands to cause downstream service startup to fail -ExecStart=-/opt/supabase-admin-api optimize db --destination-config-file-path /etc/postgresql-custom/generated-optimizations.conf +ExecStart=-/opt/supabase-admin-api optimize db --destination-config-file-path /etc/postgresql-custom/01-generated-optimizations.conf ExecStart=-/opt/supabase-admin-api optimize pgbouncer --destination-config-file-path /etc/pgbouncer-custom/generated-optimizations.ini User=adminapi diff --git a/ansible/files/postgres_prestart.sh.j2 b/ansible/files/postgres_prestart.sh.j2 index cc8ff53c6..da722cb3c 100644 --- a/ansible/files/postgres_prestart.sh.j2 +++ b/ansible/files/postgres_prestart.sh.j2 @@ -15,7 +15,7 @@ check_orioledb_enabled() { } get_shared_buffers() { - local opt_conf="/etc/postgresql-custom/generated-optimizations.conf" + local opt_conf="/etc/postgresql-custom/01-generated-optimizations.conf" if [ ! -f "$opt_conf" ]; then return 0 fi @@ -134,4 +134,4 @@ if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then locale-gen fi -main \ No newline at end of file +main diff --git a/ansible/files/postgresql_config/autoexplain.conf b/ansible/files/postgresql_config/autoexplain.conf new file mode 100644 index 000000000..3495fb141 --- /dev/null +++ b/ansible/files/postgresql_config/autoexplain.conf @@ -0,0 +1,3 @@ +# auto_explain + +auto_explain.log_min_duration = 10s diff --git a/ansible/files/postgresql_config/pgcron.conf b/ansible/files/postgresql_config/pgcron.conf new file mode 100644 index 000000000..56c909431 --- /dev/null +++ b/ansible/files/postgresql_config/pgcron.conf @@ -0,0 +1,3 @@ +# pg_cron + +cron.database_name = 'postgres' diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index 5d4237068..edcf2142a 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -1,55 +1,15 @@ # ----------------------------- # PostgreSQL configuration file # ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, run "pg_ctl reload", or execute -# "SELECT pg_reload_conf()". Some parameters, which are marked below, -# require a server shutdown and restart to take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: B = bytes Time units: us = microseconds -# kB = kilobytes ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# TB = terabytes h = hours -# d = days #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -data_directory = '/var/lib/postgresql/data' # use data in another directory - # (change requires restart) -hba_file = '/etc/postgresql/pg_hba.conf' # host-based authentication file - # (change requires restart) -ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -#external_pid_file = '' # write an extra PID file - # (change requires restart) - +data_directory = '/var/lib/postgresql/data' # use data in another directory (change requires restart) +hba_file = '/etc/postgresql/pg_hba.conf' # host-based authentication file (change requires restart) +ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file (change requires restart) #------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION @@ -57,48 +17,12 @@ ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file # - Connection Settings - -listen_addresses = '*' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -#port = 5432 # (change requires restart) -#max_connections = 100 # (change requires restart) -#superuser_reserved_connections = 3 # (change requires restart) -#unix_socket_directories = '/tmp' # comma-separated list of directories - # (change requires restart) -#unix_socket_group = '' # (change requires restart) -#unix_socket_permissions = 0777 # begin with 0 to use octal notation - # (change requires restart) -#bonjour = off # advertise server via Bonjour - # (change requires restart) -#bonjour_name = '' # defaults to the computer name - # (change requires restart) - -# - TCP settings - -# see "man tcp" for details - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default -#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; - # 0 selects the system default - -#client_connection_check_interval = 0 # time between checks for client - # disconnection while running queries; - # 0 for never +listen_addresses = '*' # what IP address(es) to listen on; comma-separated list of addresses; defaults to 'localhost'; use '*' for all (change requires restart) # - Authentication - authentication_timeout = 1min # 1s-600s password_encryption = scram-sha-256 # scram-sha-256 or md5 -db_user_namespace = off - -# GSSAPI using Kerberos -#krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab' -#krb_caseins_users = off # - SSL - @@ -124,77 +48,7 @@ ssl_passphrase_command_supports_reload = off # - Memory - -shared_buffers = 128MB # min 128kB - # (change requires restart) -#huge_pages = try # on, off, or try - # (change requires restart) -#huge_page_size = 0 # zero for system default - # (change requires restart) -#temp_buffers = 8MB # min 800kB -#max_prepared_transactions = 0 # zero disables the feature - # (change requires restart) -# Caution: it is not advisable to set max_prepared_transactions nonzero unless -# you actively intend to use prepared transactions. -#work_mem = 4MB # min 64kB -#hash_mem_multiplier = 1.0 # 1-1000.0 multiplier on hash table work_mem -#maintenance_work_mem = 64MB # min 1MB -#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem -#logical_decoding_work_mem = 64MB # min 64kB -#max_stack_depth = 2MB # min 100kB -#shared_memory_type = mmap # the default is the first option - # supported by the operating system: - # mmap - # sysv - # windows - # (change requires restart) -#dynamic_shared_memory_type = posix # the default is the first option - # supported by the operating system: - # posix - # sysv - # windows - # mmap - # (change requires restart) -#min_dynamic_shared_memory = 0MB # (change requires restart) - -# - Disk - - -#temp_file_limit = -1 # limits per-process temp file space - # in kilobytes, or -1 for no limit - -# - Kernel Resources - - -#max_files_per_process = 1000 # min 64 - # (change requires restart) - -# - Cost-Based Vacuum Delay - - -#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) -#vacuum_cost_page_hit = 1 # 0-10000 credits -#vacuum_cost_page_miss = 2 # 0-10000 credits -#vacuum_cost_page_dirty = 20 # 0-10000 credits -#vacuum_cost_limit = 200 # 1-10000 credits - -# - Background Writer - - -#bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round -#bgwriter_flush_after = 0 # measured in pages, 0 disables - -# - Asynchronous Behavior - - -#backend_flush_after = 0 # measured in pages, 0 disables -#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching -#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching -#max_worker_processes = 8 # (change requires restart) -#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers -#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers -#max_parallel_workers = 8 # maximum number of max_worker_processes that - # can be used in parallel operations -#parallel_leader_participation = on -#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate - # (change requires restart) - +shared_buffers = 128MB # min 128kB (change requires restart) #------------------------------------------------------------------------------ # WRITE-AHEAD LOG @@ -202,90 +56,12 @@ shared_buffers = 128MB # min 128kB # - Settings - -wal_level = logical # minimal, replica, or logical - # (change requires restart) -#fsync = on # flush data to disk for crash safety - # (turning this off can cause - # unrecoverable data corruption) -#synchronous_commit = on # synchronization level; - # off, local, remote_write, remote_apply, or on -#wal_sync_method = fsync # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux and FreeBSD) - # fsync - # fsync_writethrough - # open_sync -#full_page_writes = on # recover from partial page writes -#wal_log_hints = off # also do full page writes of non-critical updates - # (change requires restart) -#wal_compression = off # enable compression of full-page writes -#wal_init_zero = on # zero-fill new WAL files -#wal_recycle = on # recycle WAL files -#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -#wal_writer_delay = 200ms # 1-10000 milliseconds -#wal_writer_flush_after = 1MB # measured in pages, 0 disables -#wal_skip_threshold = 2MB - -#commit_delay = 0 # range 0-100000, in microseconds -#commit_siblings = 5 # range 1-1000 +wal_level = logical # minimal, replica, or logical (change requires restart) # - Checkpoints - -#checkpoint_timeout = 5min # range 30s-1d checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -checkpoint_flush_after = 256kB # measured in pages, 0 disables -#checkpoint_warning = 30s # 0 disables -#max_wal_size = 1GB -#min_wal_size = 80MB - -# - Archiving - - -#archive_mode = off # enables archiving; off, on, or always - # (change requires restart) -#archive_command = '' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -#archive_timeout = 0 # force a logfile segment switch after this - # number of seconds; 0 disables - -# - Archive Recovery - - -# These are only used in recovery mode. - -#restore_command = '' # command to use to restore an archived logfile segment - # placeholders: %p = path of file to restore - # %f = file name only - # e.g. 'cp /mnt/server/archivedir/%f %p' -#archive_cleanup_command = '' # command to execute at every restartpoint -#recovery_end_command = '' # command to execute at completion of recovery - -# - Recovery Target - - -# Set these only when performing a targeted recovery. - -#recovery_target = '' # 'immediate' to end recovery as soon as a - # consistent state is reached - # (change requires restart) -#recovery_target_name = '' # the named restore point to which recovery will proceed - # (change requires restart) -#recovery_target_time = '' # the time stamp up to which recovery will proceed - # (change requires restart) -#recovery_target_xid = '' # the transaction ID up to which recovery will proceed - # (change requires restart) -#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed - # (change requires restart) -#recovery_target_inclusive = on # Specifies whether to stop: - # just after the specified recovery target (on) - # just before the recovery target (off) - # (change requires restart) -#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID - # (change requires restart) -#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' - # (change requires restart) - +checkpoint_flush_after = 32 # measured in 8k pages, 0 disables #------------------------------------------------------------------------------ # REPLICATION @@ -295,218 +71,24 @@ checkpoint_flush_after = 256kB # measured in pages, 0 disables # Set these on the primary and on any standby that will send replication data. -max_wal_senders = 10 # max number of walsender processes - # (change requires restart) -max_replication_slots = 5 # max number of replication slots - # (change requires restart) -#wal_keep_size = 0 # in megabytes; 0 disables +max_wal_senders = 10 # max number of walsender processes (change requires restart) +max_replication_slots = 5 # max number of replication slots (change requires restart) max_slot_wal_keep_size = 4096 # in megabytes; -1 disables -#wal_sender_timeout = 60s # in milliseconds; 0 disables -#track_commit_timestamp = off # collect timestamp of transaction commit - # (change requires restart) - -# - Primary Server - - -# These settings are ignored on a standby server. - -#synchronous_standby_names = '' # standby servers that provide sync rep - # method to choose sync standbys, number of sync standbys, - # and comma-separated list of application_name - # from standby(s); '*' = all -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a primary server. - -#primary_conninfo = '' # connection string to sending server -#primary_slot_name = '' # replication slot on sending server -#promote_trigger_file = '' # file name whose presence ends recovery -#hot_standby = on # "off" disallows queries during recovery - # (change requires restart) -#max_standby_archive_delay = 30s # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -#max_standby_streaming_delay = 30s # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -#wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name - # is not set -#wal_receiver_status_interval = 10s # send replies at least this often - # 0 disables -#hot_standby_feedback = off # send info from standby to prevent - # query conflicts -#wal_receiver_timeout = 60s # time that receiver waits for - # communication from primary - # in milliseconds; 0 disables -#wal_retrieve_retry_interval = 5s # time to wait before retrying to - # retrieve WAL after a failed attempt -#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery - -# - Subscribers - - -# These settings are ignored on a publisher. - -#max_logical_replication_workers = 4 # taken from max_worker_processes - # (change requires restart) -#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers - #------------------------------------------------------------------------------ # QUERY TUNING #------------------------------------------------------------------------------ -# - Planner Method Configuration - - -#enable_async_append = on -#enable_bitmapscan = on -#enable_gathermerge = on -#enable_hashagg = on -#enable_hashjoin = on -#enable_incremental_sort = on -#enable_indexscan = on -#enable_indexonlyscan = on -#enable_material = on -#enable_resultcache = on -#enable_mergejoin = on -#enable_nestloop = on -#enable_parallel_append = on -#enable_parallel_hash = on -#enable_partition_pruning = on -#enable_partitionwise_join = off -#enable_partitionwise_aggregate = off -#enable_seqscan = on -#enable_sort = on -#enable_tidscan = on - # - Planner Cost Constants - -#seq_page_cost = 1.0 # measured on an arbitrary scale -#random_page_cost = 4.0 # same scale as above -#cpu_tuple_cost = 0.01 # same scale as above -#cpu_index_tuple_cost = 0.005 # same scale as above -#cpu_operator_cost = 0.0025 # same scale as above -#parallel_setup_cost = 1000.0 # same scale as above -#parallel_tuple_cost = 0.1 # same scale as above -#min_parallel_table_scan_size = 8MB -#min_parallel_index_scan_size = 512kB effective_cache_size = 128MB -#jit_above_cost = 100000 # perform JIT compilation if available - # and query more expensive than this; - # -1 disables -#jit_inline_above_cost = 500000 # inline small functions if query is - # more expensive than this; -1 disables -#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if - # query is more expensive than this; - # -1 disables - -# - Genetic Query Optimizer - - -#geqo = on -#geqo_threshold = 12 -#geqo_effort = 5 # range 1-10 -#geqo_pool_size = 0 # selects default based on effort -#geqo_generations = 0 # selects default based on effort -#geqo_selection_bias = 2.0 # range 1.5-2.0 -#geqo_seed = 0.0 # range 0.0-1.0 - -# - Other Planner Options - - -#default_statistics_target = 100 # range 1-10000 -#constraint_exclusion = partition # on, off, or partition -#cursor_tuple_fraction = 0.1 # range 0.0-1.0 -#from_collapse_limit = 8 -#jit = on # allow JIT compilation -#join_collapse_limit = 8 # 1 disables collapsing of explicit - # JOIN clauses -#plan_cache_mode = auto # auto, force_generic_plan or - # force_custom_plan - - #------------------------------------------------------------------------------ # REPORTING AND LOGGING #------------------------------------------------------------------------------ -include = '/etc/postgresql/logging.conf' - -# These are relevant when logging to syslog: -#syslog_facility = 'LOCAL0' -#syslog_ident = 'postgres' -#syslog_sequence_numbers = on -#syslog_split_messages = on - -# This is only relevant when logging to eventlog (Windows): -# (change requires restart) -#event_source = 'PostgreSQL' - -# - When to Log - - -#log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - -#log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - -#log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements - # and their durations, > 0 logs only a sample of - # statements running at least this number - # of milliseconds; - # sample fraction is determined by log_statement_sample_rate - -#log_statement_sample_rate = 1.0 # fraction of logged statements exceeding - # log_min_duration_sample to be logged; - # 1.0 logs all such statements, 0.0 never logs - - -#log_transaction_sample_rate = 0.0 # fraction of transactions whose statements - # are logged regardless of their duration; 1.0 logs all - # statements from all transactions, 0.0 never logs - # - What to Log - -#debug_print_parse = off -#debug_print_rewritten = off -#debug_print_plan = off -#debug_pretty_print = on -#log_autovacuum_min_duration = -1 # log autovacuum activity; - # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -#log_checkpoints = off -#log_connections = off -#log_disconnections = off -#log_duration = off -#log_error_verbosity = default # terse, default, or verbose messages -#log_hostname = off log_line_prefix = '%h %m [%p] %q%u@%d ' # special values: # %a = application name # %u = user name @@ -531,86 +113,14 @@ log_line_prefix = '%h %m [%p] %q%u@%d ' # special values: # processes # %% = '%' # e.g. '<%u%%%d> ' -#log_lock_waits = off # log lock waits >= deadlock_timeout -#log_recovery_conflict_waits = off # log standby recovery conflict waits - # >= deadlock_timeout -#log_parameter_max_length = -1 # when logging statements, limit logged - # bind-parameter values to N bytes; - # -1 means print in full, 0 disables -#log_parameter_max_length_on_error = 0 # when logging an error, limit logged - # bind-parameter values to N bytes; - # -1 means print in full, 0 disables log_statement = 'ddl' # none, ddl, mod, all -#log_replication_commands = off -#log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files log_timezone = 'UTC' #------------------------------------------------------------------------------ # PROCESS TITLE #------------------------------------------------------------------------------ -cluster_name = 'main' # added to process titles if nonempty - # (change requires restart) -#update_process_title = on - - -#------------------------------------------------------------------------------ -# STATISTICS -#------------------------------------------------------------------------------ - -# - Query and Index Statistics Collector - - -#track_activities = on -#track_activity_query_size = 1024 # (change requires restart) -#track_counts = on -#track_io_timing = off -#track_wal_io_timing = off -#track_functions = none # none, pl, all -#stats_temp_directory = 'pg_stat_tmp' - - -# - Monitoring - - -#compute_query_id = auto -#log_statement_stats = off -#log_parser_stats = off -#log_planner_stats = off -#log_executor_stats = off - - -#------------------------------------------------------------------------------ -# AUTOVACUUM -#------------------------------------------------------------------------------ - -#autovacuum = on # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -#autovacuum_max_workers = 3 # max number of autovacuum subprocesses - # (change requires restart) -#autovacuum_naptime = 1min # time between autovacuum runs -#autovacuum_vacuum_threshold = 50 # min number of row updates before - # vacuum -#autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts - # before vacuum; -1 disables insert - # vacuums -#autovacuum_analyze_threshold = 50 # min number of row updates before - # analyze -#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum -#autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table - # size before insert vacuum -#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze -#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum - # (change requires restart) -#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age - # before forced vacuum - # (change requires restart) -#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit +cluster_name = 'main' # added to process titles if nonempty (change requires restart) #------------------------------------------------------------------------------ @@ -619,63 +129,15 @@ cluster_name = 'main' # added to process titles if nonempty # - Statement Behavior - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error -#search_path = '"$user", public' # schema names row_security = on -#default_table_access_method = 'heap' -#default_tablespace = '' # a tablespace name, '' uses the default -#default_toast_compression = 'pglz' # 'pglz' or 'lz4' -#temp_tablespaces = '' # a list of tablespace names, '' uses - # only default tablespace -#check_function_bodies = on -#default_transaction_isolation = 'read committed' -#default_transaction_read_only = off -#default_transaction_deferrable = off -#session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#lock_timeout = 0 # in milliseconds, 0 is disabled -#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled -#idle_session_timeout = 0 # in milliseconds, 0 is disabled -#vacuum_freeze_table_age = 150000000 -#vacuum_freeze_min_age = 50000000 -#vacuum_failsafe_age = 1600000000 -#vacuum_multixact_freeze_table_age = 150000000 -#vacuum_multixact_freeze_min_age = 5000000 -#vacuum_multixact_failsafe_age = 1600000000 -#bytea_output = 'hex' # hex, escape -#xmlbinary = 'base64' -#xmloption = 'content' -#gin_pending_list_limit = 4MB # - Locale and Formatting - -#datestyle = 'iso, mdy' -#intervalstyle = 'postgres' timezone = 'UTC' -#timezone_abbreviations = 'Default' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia (historical usage) - # India - # You can create your own file in - # share/timezonesets/. -extra_float_digits = 0 # min -15, max 3; any value >0 actually - # selects precise output mode -#client_encoding = sql_ascii # actually, defaults to database - # encoding +extra_float_digits = 0 # min -15, max 3; any value >0 actually selects precise output mode # These settings are initialized by initdb, but they can be changed. -lc_messages = 'en_US.UTF-8' # locale for system error message - # strings +lc_messages = 'en_US.UTF-8' # locale for system error message strings lc_monetary = 'en_US.UTF-8' # locale for monetary formatting lc_numeric = 'en_US.UTF-8' # locale for number formatting lc_time = 'en_US.UTF-8' # locale for time formatting @@ -685,63 +147,9 @@ default_text_search_config = 'pg_catalog.english' # - Shared Library Preloading - -#local_preload_libraries = '' -#session_preload_libraries = '' - shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, supabase_vault' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use -# - Other Defaults - - -#dynamic_library_path = '$libdir' -#gin_fuzzy_search_limit = 0 - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -#deadlock_timeout = 1s -#max_locks_per_transaction = 64 # min 10 - # (change requires restart) -#max_pred_locks_per_transaction = 64 # min 10 - # (change requires restart) -#max_pred_locks_per_relation = -2 # negative values mean - # (max_pred_locks_per_transaction - # / -max_pred_locks_per_relation) - 1 -#max_pred_locks_per_page = 2 # min 0 - - -#------------------------------------------------------------------------------ -# VERSION AND PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -#array_nulls = on -#backslash_quote = safe_encoding # on, off, or safe_encoding -#escape_string_warning = on -#lo_compat_privileges = off -#quote_all_identifiers = off -#standard_conforming_strings = on -#synchronize_seqscans = on - -# - Other Platforms and Clients - - -#transform_null_equals = off - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -#exit_on_error = off # terminate session on any error? -#restart_after_crash = on # reinitialize after backend crash? -#data_sync_retry = off # retry or panic on failure to fsync - # data? - # (change requires restart) -#recovery_init_sync_method = fsync # fsync, syncfs (Linux 5.8+) - - #------------------------------------------------------------------------------ # CONFIG FILE INCLUDES #------------------------------------------------------------------------------ @@ -750,29 +158,4 @@ jit_provider = 'llvmjit' # JIT library to use # default postgresql.conf. Note that these are directives, not variable # assignments, so they can usefully be given more than once. -#include_dir = '...' # include files ending in '.conf' from - # a directory, e.g., 'conf.d' -#include_if_exists = '...' # include file only if it exists -#include = '...' # include file - -# Automatically generated optimizations -#include = '/etc/postgresql-custom/generated-optimizations.conf' -# User-supplied custom parameters, override any automatically generated ones -#include = '/etc/postgresql-custom/custom-overrides.conf' - -# WAL-G specific configurations -#include = '/etc/postgresql-custom/wal-g.conf' - -# read replica specific configurations -include = '/etc/postgresql-custom/read-replica.conf' - -# supautils specific configurations -#include = '/etc/postgresql-custom/supautils.conf' - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here -auto_explain.log_min_duration = 10s -cron.database_name = 'postgres' +include_dir = '/etc/postgresql-custom' # include files ending in '.conf' from a directory, e.g., 'conf.d' diff --git a/ansible/tasks/finalize-ami.yml b/ansible/tasks/finalize-ami.yml index 1cc729fc0..da6b8fe8d 100644 --- a/ansible/tasks/finalize-ami.yml +++ b/ansible/tasks/finalize-ami.yml @@ -1,9 +1,20 @@ - name: PG logging conf ansible.builtin.template: - dest: '/etc/postgresql/logging.conf' + dest: '/etc/postgresql-custom/00-logging.conf' group: 'postgres' src: 'files/postgresql_config/postgresql-csvlog.conf' +- name: auto_explain and pg_cron confs + ansible.builtin.template: + dest: "/etc/postgresql-custom/{{ ext_item }}.conf" + group: 'postgres' + src: "files/postgresql_config/{{ ext_item | split('_') | join('') }}.conf" + loop: + - auto_explain + - pg_cron + loop_control: + loop_var: 'ext_item' + - name: UFW - Allow SSH connections community.general.ufw: name: 'OpenSSH' diff --git a/ansible/tasks/internal/supautils.yml b/ansible/tasks/internal/supautils.yml index 33811b5ac..38e911f52 100644 --- a/ansible/tasks/internal/supautils.yml +++ b/ansible/tasks/internal/supautils.yml @@ -39,10 +39,10 @@ regexp: "#session_preload_libraries = ''" replace: session_preload_libraries = 'supautils' -- name: supautils - write custom supautils.conf +- name: supautils - write custom 05-supautils.conf template: src: "files/postgresql_config/supautils.conf.j2" - dest: /etc/postgresql-custom/supautils.conf + dest: /etc/postgresql-custom/05-supautils.conf mode: 0664 owner: postgres group: postgres @@ -62,13 +62,6 @@ recurse: yes become: yes -- name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf - become: yes - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#include = '/etc/postgresql-custom/supautils.conf'" - replace: "include = '/etc/postgresql-custom/supautils.conf'" - - name: supautils - remove build dependencies apt: pkg: diff --git a/ansible/tasks/setup-docker.yml b/ansible/tasks/setup-docker.yml index 6a3a12cc4..bb5991bc6 100644 --- a/ansible/tasks/setup-docker.yml +++ b/ansible/tasks/setup-docker.yml @@ -51,7 +51,7 @@ - name: supautils - write custom supautils.conf ansible.builtin.template: - dest: '/etc/postgresql-custom/supautils.conf' + dest: '/etc/postgresql-custom/05-supautils.conf' mode: '0664' group: 'postgres' owner: 'postgres' @@ -72,13 +72,6 @@ recurse: true become: true - - name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf - ansible.builtin.replace: - path: '/etc/postgresql/postgresql.conf' - regexp: "#include = '/etc/postgresql-custom/supautils.conf'" - replace: "include = '/etc/postgresql-custom/supautils.conf'" - become: true - - name: Cleanup - extension packages ansible.builtin.file: path: '/tmp/extensions' diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 2fe302488..691c24da4 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -126,8 +126,8 @@ group: postgres mode: 0664 with_items: - - 'generated-optimizations.conf' - - 'custom-overrides.conf' + - '01-generated-optimizations.conf' + - '02-custom-overrides.conf' when: debpkg_mode or nixpkg_mode # Move Postgres configuration files into /etc/postgresql @@ -156,10 +156,10 @@ when: debpkg_mode or nixpkg_mode # Add custom config for read replicas set up -- name: Move custom read-replica.conf file to /etc/postgresql-custom/read-replica.conf +- name: Move custom read-replica.conf file to /etc/postgresql-custom/04-read-replica.conf template: src: "files/postgresql_config/custom_read_replica.conf.j2" - dest: /etc/postgresql-custom/read-replica.conf + dest: /etc/postgresql-custom/04-read-replica.conf mode: 0664 owner: postgres group: postgres @@ -212,7 +212,7 @@ group: postgres when: nixpkg_mode -- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary +- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary block: - name: Check if psql_version is psql_orioledb set_fact: diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index d63f3abad..74327911a 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -84,20 +84,6 @@ state: directory owner: vector -- name: Include file for generated optimizations in postgresql.conf - become: true - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#include = '/etc/postgresql-custom/generated-optimizations.conf'" - replace: "include = '/etc/postgresql-custom/generated-optimizations.conf'" - -- name: Include file for custom overrides in postgresql.conf - become: true - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#include = '/etc/postgresql-custom/custom-overrides.conf'" - replace: "include = '/etc/postgresql-custom/custom-overrides.conf'" - - name: Install Postgres exporter import_tasks: internal/postgres-exporter.yml diff --git a/ansible/tasks/setup-wal-g.yml b/ansible/tasks/setup-wal-g.yml index a05106ede..28fda91af 100644 --- a/ansible/tasks/setup-wal-g.yml +++ b/ansible/tasks/setup-wal-g.yml @@ -60,10 +60,10 @@ mode: '0664' when: stage2_nix -- name: Move custom wal-g.conf file to /etc/postgresql-custom/wal-g.conf +- name: Move custom wal-g.conf file to /etc/postgresql-custom/03-wal-g.conf template: src: "files/postgresql_config/custom_walg.conf.j2" - dest: /etc/postgresql-custom/wal-g.conf + dest: /etc/postgresql-custom/03-wal-g.conf mode: 0664 owner: postgres group: postgres @@ -85,11 +85,3 @@ mode: 0700 owner: root when: stage2_nix - -- name: Include /etc/postgresql-custom/wal-g.conf in postgresql.conf - become: yes - replace: - path: /etc/postgresql/postgresql.conf - regexp: "#include = '/etc/postgresql-custom/wal-g.conf'" - replace: "include = '/etc/postgresql-custom/wal-g.conf'" - when: stage2_nix diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 74da50a57..6f696d5d3 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -4,7 +4,7 @@ # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task -- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary +- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary block: - name: Check if psql_version is psql_orioledb-17 set_fact: @@ -26,11 +26,11 @@ when: is_psql_oriole or is_psql_17 and stage2_nix become: yes - - name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build + - name: Remove specified extensions from 05-supautils.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > sed -i 's/ timescaledb,//g; s/ plv8,//g' - /etc/postgresql-custom/supautils.conf + /etc/postgresql-custom/05-supautils.conf when: is_psql_oriole or is_psql_17 and stage2_nix become: yes diff --git a/nix/packages/lib.nix b/nix/packages/lib.nix index 971909162..5e4d38753 100644 --- a/nix/packages/lib.nix +++ b/nix/packages/lib.nix @@ -41,9 +41,17 @@ path = ../../ansible/files/postgresql_config/supautils.conf.j2; }; loggingConfigFile = builtins.path { - name = "logging.conf"; + name = "00-logging.conf"; path = ../../ansible/files/postgresql_config/postgresql-csvlog.conf; }; + autoexplainConfigFile = builtins.path { + name = "auto_explain.conf"; + path = ../../ansible/files/postgresql_config/autoexplain.conf; + }; + pgcronConfigFile = builtins.path { + name = "pg_cron.conf"; + path = ../../ansible/files/postgresql_config/pgcron.conf; + }; readReplicaConfigFile = builtins.path { name = "readreplica.conf"; path = ../../ansible/files/postgresql_config/custom_read_replica.conf.j2; @@ -83,6 +91,8 @@ PGSODIUM_GETKEY = "${paths.getkeyScript}"; READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; + AUTOEXPLAIN_CONF_FILE = "${paths.autoexplainConfigFile}"; + PGCRON_CONF_FILE = "${paths.pgcronConfigFile}"; SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; PG_HBA = "${paths.pgHbaConfigFile}"; PG_IDENT = "${paths.pgIdentConfigFile}"; @@ -110,19 +120,18 @@ mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts # Copy config files with error handling - cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } + cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/05-supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } - cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } - cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } + cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/00-logging.conf || { echo "Failed to copy logging.conf"; exit 1; } + cp ${paths.autoexplainConfigFile} $out/etc/postgresql-custom/auto_explain.conf || { echo "Failed to copy auto_explain.conf"; exit 1; } + cp ${paths.pgcronConfigFile} $out/etc/postgresql-custom/pg_cron.conf || { echo "Failed to copy pg_cron.conf"; exit 1; } + cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/04-read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } echo "Copy operation completed" - chmod 644 $out/etc/postgresql-custom/supautils.conf - chmod 644 $out/etc/postgresql/postgresql.conf - chmod 644 $out/etc/postgresql-custom/logging.conf - chmod 644 $out/etc/postgresql/pg_hba.conf + chmod 644 $out/etc/postgresql-custom/05-supautils.conf $out/etc/postgresql/postgresql.conf $out/etc/postgresql-custom/00-logging.conf $out/etc/postgresql/pg_hba.conf substitute ${../tools/run-server.sh.in} $out/bin/start-postgres-server \ ${ diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 182cbe554..2191ff686 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -165,6 +165,8 @@ PSQL_CONF_FILE=@PSQL_CONF_FILE@ PORTNO="${PORTNO:-@PGSQL_DEFAULT_PORT@}" SUPAUTILS_CONFIG_FILE=@SUPAUTILS_CONF_FILE@ LOGGING_CONFIG_FILE=@LOGGING_CONF_FILE@ +AUTOEXPLAIN_CONFIG_FILE=@AUTOEXPLAIN_CONF_FILE@ +PGCRON_CONFIG_FILE=@PGCRON_CONF_FILE@ READREPL_CONFIG_FILE=@READREPL_CONF_FILE@ PG_HBA_FILE=@PG_HBA@ PG_IDENT_FILE=@PG_IDENT@ @@ -215,25 +217,29 @@ fi echo "NOTE: patching postgresql.conf files" cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf" cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf" -cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf" +mkdir -p "$DATDIR/postgresql-custom" +mkdir -p "$DATDIR/pg_log" +cp "$READREPL_CONFIG_FILE" "$DATDIR/postgresql-custom/04-read-replica.conf" +cp "$AUTOEXPLAIN_CONFIG_FILE" "$DATDIR/postgresql-custom/auto_explain.conf" +cp "$PGCRON_CONFIG_FILE" "$DATDIR/postgresql-custom/pg_cron.conf" mkdir -p "$DATDIR/extension-custom-scripts" cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts" +# Configure logging with correct log directory +sed "s|log_directory = '/var/log/postgresql'|log_directory = '$DATDIR/pg_log'|" "$LOGGING_CONFIG_FILE" > "$DATDIR/postgresql-custom/00-logging.conf" + # Configure supautils -sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" +sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/postgresql-custom/05-supautils.conf" # Configure PostgreSQL -sed -e "1i\\ -include = '$DATDIR/supautils.conf'" \ --e "\$a\\ +sed -e "\$a\\ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "\$a\\ vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "s|data_directory = '/var/lib/postgresql/data'|data_directory = '$DATDIR'|" \ -e "s|hba_file = '/etc/postgresql/pg_hba.conf'|hba_file = '$DATDIR/pg_hba.conf'|" \ -e "s|ident_file = '/etc/postgresql/pg_ident.conf'|ident_file = '$DATDIR/pg_ident.conf'|" \ --e "s|include = '/etc/postgresql/logging.conf'|#&|" \ --e "s|include = '/etc/postgresql-custom/read-replica.conf'|include = '$DATDIR/read-replica.conf'|" \ +-e "s|include_dir = '/etc/postgresql-custom'|include_dir = '$DATDIR/postgresql-custom'|" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" @@ -245,34 +251,34 @@ orioledb_config_items() { echo "non-macos oriole conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf" echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then # macOS specific configuration echo "macOS detected, applying macOS specific configuration" ls -la "$DATDIR" - + # Use perl instead of sed for macOS perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf" - - perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" - perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf" - perl -pi -e 's/ pgjwt,//g' "$DATDIR/supautils.conf" + + perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql-custom/05-supautils.conf" + perl -pi -e 's/ plv8,//g' "$DATDIR/postgresql-custom/05-supautils.conf" + perl -pi -e 's/ pgjwt,//g' "$DATDIR/postgresql-custom/05-supautils.conf" perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf" - + echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then echo "non-macos pg 17 conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" - perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" - perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf" + perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql-custom/05-supautils.conf" + perl -pi -e 's/ plv8,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" fi } From bbfc14b72be1f7fc4ff2d8fa7437acff521db8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 9 Oct 2025 22:07:26 +0200 Subject: [PATCH 121/134] fix(pgmq): replace drop_queue function if exists (#1828) * fix(pgmq): replace drop_queue function if exists We introduced a patch to override pgmq.drop_queue(TEXT) to conditionally drop objects only if they are part of the extension in `ansible/ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql` . This script might have been installed on installations with existing 1.4.4 extensions. When the user tries to upgrade pgmq from 1.4.4 to 1.5.1, the upgrade process will fail because the upgrade script doesn't expect `pgmq.drop_queue(TEXT)` to exist. This change introduce the a patch to the pgmq extension to use `CREATE OR REPLACE FUNCTION` instead of `CREATE FUNCTION` for `pgmq.drop_queue(TEXT)` in the upgrade script from 1.4.5 to 1.5.0. * feat: test that the pgmq extension works well with the after create script We create a new custom nixos test for the pgmq extension to test that the extension works well with the after-create.sql script present in `ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql`. * chore: bump versions to release post-rebase --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +- ...eplace-drop_queue-function-if-exists.patch | 29 ++++ nix/ext/{pgmq.nix => pgmq/default.nix} | 6 +- nix/ext/tests/default.nix | 1 - nix/ext/tests/lib.py | 5 + nix/ext/tests/pgmq.nix | 163 ++++++++++++++++++ nix/packages/postgres.nix | 2 +- 7 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 nix/ext/pgmq/0001-fix-replace-drop_queue-function-if-exists.patch rename nix/ext/{pgmq.nix => pgmq/default.nix} (93%) create mode 100644 nix/ext/tests/pgmq.nix diff --git a/ansible/vars.yml b/ansible/vars.yml index 4013a1052..c30069929 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.040-orioledb" - postgres17: "17.6.1.019" - postgres15: "15.14.1.019" + postgresorioledb-17: "17.5.1.041-orioledb" + postgres17: "17.6.1.020" + postgres15: "15.14.1.020" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/pgmq/0001-fix-replace-drop_queue-function-if-exists.patch b/nix/ext/pgmq/0001-fix-replace-drop_queue-function-if-exists.patch new file mode 100644 index 000000000..a354af553 --- /dev/null +++ b/nix/ext/pgmq/0001-fix-replace-drop_queue-function-if-exists.patch @@ -0,0 +1,29 @@ +From 31a9b2d736d8a85f113d592754f4832a0097bb2d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= +Date: Thu, 9 Oct 2025 10:53:50 +0200 +Subject: [PATCH] fix: replace drop_queue function if exists + +Function drop_queue might have been created by running `postgresql_extension_custom_scripts/pgmq/after-create.sql` +on a previous version of the extension. In that case, running the migration script will fail because the function already exists. + +We use `CREATE OR REPLACE FUNCTION` to avoid that issue. +--- + pgmq-extension/sql/pgmq--1.4.5--1.5.0.sql | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pgmq-extension/sql/pgmq--1.4.5--1.5.0.sql b/pgmq-extension/sql/pgmq--1.4.5--1.5.0.sql +index 5754eed..de03788 100644 +--- a/pgmq-extension/sql/pgmq--1.4.5--1.5.0.sql ++++ b/pgmq-extension/sql/pgmq--1.4.5--1.5.0.sql +@@ -122,7 +122,7 @@ BEGIN + END; + $$ LANGUAGE plpgsql; + +-CREATE FUNCTION pgmq.drop_queue(queue_name TEXT) ++CREATE OR REPLACE FUNCTION pgmq.drop_queue(queue_name TEXT) + RETURNS BOOLEAN AS $$ + DECLARE + qtable TEXT := pgmq.format_table_name(queue_name, 'q'); +-- +2.51.0 + diff --git a/nix/ext/pgmq.nix b/nix/ext/pgmq/default.nix similarity index 93% rename from nix/ext/pgmq.nix rename to nix/ext/pgmq/default.nix index 0f7ab8413..f1b288ce8 100644 --- a/nix/ext/pgmq.nix +++ b/nix/ext/pgmq/default.nix @@ -9,7 +9,7 @@ let pname = "pgmq"; # Load version configuration from external file - allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; + allVersions = (builtins.fromJSON (builtins.readFile ../versions.json)).${pname}; # Filter versions compatible with current PostgreSQL version supportedVersions = lib.filterAttrs ( @@ -37,6 +37,10 @@ let inherit hash; }; + patches = lib.optionals (version == latestVersion) [ + ./0001-fix-replace-drop_queue-function-if-exists.patch + ]; + buildPhase = '' cd pgmq-extension ''; diff --git a/nix/ext/tests/default.nix b/nix/ext/tests/default.nix index d1f3d89ad..9a379d587 100644 --- a/nix/ext/tests/default.nix +++ b/nix/ext/tests/default.nix @@ -206,7 +206,6 @@ builtins.listToAttrs ( "pg_graphql" "pg_jsonschema" "pg_net" - "pgmq" "vector" "wrappers" ] diff --git a/nix/ext/tests/lib.py b/nix/ext/tests/lib.py index 9f81ec111..3383f2498 100644 --- a/nix/ext/tests/lib.py +++ b/nix/ext/tests/lib.py @@ -41,6 +41,11 @@ def run_sql(self, query: str) -> str: f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """ ).strip() + def run_sql_file(self, file: str) -> str: + return self.vm.succeed( + f"""sudo -u postgres psql -v ON_ERROR_STOP=1 -f \"{file}\"""" + ).strip() + def drop_extension(self): self.run_sql(f"DROP EXTENSION IF EXISTS {self.extension_name};") diff --git a/nix/ext/tests/pgmq.nix b/nix/ext/tests/pgmq.nix new file mode 100644 index 000000000..eabebff9b --- /dev/null +++ b/nix/ext/tests/pgmq.nix @@ -0,0 +1,163 @@ +{ self, pkgs }: +let + pname = "pgmq"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = "timescaledb"; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + services.postgresql = { + enable = true; + package = (postgresqlWithExtension psql_15); + settings = (installedExtension "15").defaultSettings or { }; + }; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = psql_15; + newPostgresql = psql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + from pathlib import Path + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + extension_name = "${pname}" + support_upgrade = True + pg17_configuration = "${pg17-configuration}" + ext_has_background_worker = ${ + if (installedExtension "15") ? hasBackgroundWorker then "True" else "False" + } + sql_test_directory = Path("${../../tests}") + pg_regress_test_name = "${(installedExtension "15").pgRegressTestName or pname}" + + ${builtins.readFile ./lib.py} + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade) + + with subtest("Check upgrade path with postgresql 15"): + test.check_upgrade_path("15") + test.run_sql_file("${../../../ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql}") + + with subtest("Check pg_regress with postgresql 15 after extension upgrade"): + test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) + + last_version = None + with subtest("Check the install of the last version of the extension"): + last_version = test.check_install_last_version("15") + test.run_sql_file("${../../../ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql}") + + if ext_has_background_worker: + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") + + with subtest("Check pg_regress with postgresql 15 after installing the last version"): + test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) + + with subtest("switch to postgresql 17"): + server.succeed( + f"{pg17_configuration}/bin/switch-to-configuration test >&2" + ) + + with subtest("Check last version of the extension after postgresql upgrade"): + test.assert_version_matches(last_version) + test.run_sql_file("${../../../ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql}") + + with subtest("Check upgrade path with postgresql 17"): + test.check_upgrade_path("17") + test.run_sql_file("${../../../ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql}") + + with subtest("Check pg_regress with postgresql 17 after extension upgrade"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) + + with subtest("Check the install of the last version of the extension"): + test.check_install_last_version("17") + test.run_sql_file("${../../../ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql}") + + with subtest("Check pg_regress with postgresql 17 after installing the last version"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) + ''; +} diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index ce7d22c43..bc13180d0 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -22,7 +22,7 @@ ../ext/pgroonga.nix ../ext/index_advisor.nix ../ext/wal2json.nix - ../ext/pgmq.nix + ../ext/pgmq ../ext/pg_repack.nix ../ext/pg-safeupdate.nix ../ext/plpgsql-check.nix From af4a2ba353cc85929dcbb1f26a5a8ffc9fb76b3f Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Thu, 9 Oct 2025 17:00:01 -0400 Subject: [PATCH 122/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1821) --- ansible/tasks/setup-nginx.yml | 101 +++++++++++++++++----------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/ansible/tasks/setup-nginx.yml b/ansible/tasks/setup-nginx.yml index 77fb7707a..1f10ceec2 100644 --- a/ansible/tasks/setup-nginx.yml +++ b/ansible/tasks/setup-nginx.yml @@ -1,79 +1,78 @@ - name: nginx - system user - user: name=nginx + ansible.builtin.user: + name: 'nginx' + state: 'present' # Kong installation steps from http://archive.vn/3HRQx - name: nginx - system dependencies - apt: + ansible.builtin.apt: pkg: - - openssl - libpcre3-dev - libssl-dev + - openssl - zlib1g-dev - name: nginx - download source - get_url: - url: "https://nginx.org/download/nginx-%7B%7B%20nginx_release%20%7D%7D.tar.gz" - dest: /tmp/nginx-{{ nginx_release }}.tar.gz + ansible.builtin.get_url: checksum: "{{ nginx_release_checksum }}" + dest: '/tmp/nginx-{{ nginx_release }}.tar.gz' + url: "https://nginx.org/download/nginx-%7B%7B%20nginx_release%20%7D%7D.tar.gz" - name: nginx - unpack archive - unarchive: - remote_src: yes - src: /tmp/nginx-{{ nginx_release }}.tar.gz - dest: /tmp + ansible.builtin.unarchive: + dest: '/tmp' + remote_src: true + src: "/tmp/nginx-{{ nginx_release }}.tar.gz" - name: nginx - configure - shell: - chdir: /tmp/nginx-{{ nginx_release }} - cmd: | - set -e + ansible.builtin.command: + argv: + - ./configure + - --prefix=/usr/local/nginx + - --conf-path=/etc/nginx/nginx.conf + - --with-http_ssl_module + - --with-http_realip_module + - --with-threads + args: + chdir: "/tmp/nginx-{{ nginx_release }}" + become: true - ./configure \ - --prefix=/usr/local/nginx \ - --conf-path=/etc/nginx/nginx.conf \ - --with-http_ssl_module \ - --with-http_realip_module \ - --with-threads - become: yes - -- name: nginx - build +- name: nginx - build and install community.general.make: - target: build - chdir: /tmp/nginx-{{ nginx_release }} + chdir: "/tmp/nginx-{{ nginx_release }}" jobs: "{{ parallel_jobs | default(omit) }}" - become: yes - -- name: nginx - install - make: - chdir: /tmp/nginx-{{ nginx_release }} - target: install - become: yes - -- name: nginx - hand over ownership of /usr/local/nginx to user nginx - file: - path: /usr/local/nginx - recurse: yes - owner: nginx + target: "{{ make_target }}" + become: true + loop: + - 'build' + - 'install' + loop_control: + loop_var: 'make_target' -- name: nginx - hand over ownership of /etc/nginx to user nginx - file: - path: /etc/nginx - recurse: yes - owner: nginx +- name: nginx - hand over ownership of /etc/nginx and /usr/local/nginx to user nginx + ansible.builtin.file: + owner: 'nginx' + path: "{{ nginx_dir_item }}" + recurse: true + loop: + - /etc/nginx + - /usr/local/nginx + loop_control: + loop_var: 'nginx_dir_item' # [warn] ulimit is currently set to "1024". For better performance set it to at least # "4096" using "ulimit -n" - name: nginx - bump up ulimit - pam_limits: - limit_item: nofile - limit_type: soft - domain: nginx - value: "4096" + community.general.pam_limits: + domain: 'nginx' + limit_item: 'nofile' + limit_type: 'soft' + value: '4096' - name: nginx - create service file - template: - src: files/nginx.service.j2 - dest: /etc/systemd/system/nginx.service + ansible.builtin.template: + dest: '/etc/systemd/system/nginx.service' + src: 'files/nginx.service.j2' # Keep it dormant for the timebeing From 309557bfc0f2bbf9add4372319e765e0fcbd65cc Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 10 Oct 2025 17:08:16 -0400 Subject: [PATCH 123/134] Revert "refactor(postgresq): switch to 'include_dir' and then rename conf files to ensure ordering" (#1835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "refactor(postgresq): switch to 'include_dir' and then renames conf fi…" This reverts commit 098740642e5bacb8df0ef7d9b8d7d48b4c12b6ee. * chore: bump version to create release from this branch --- Dockerfile-15 | 13 +- Dockerfile-17 | 15 +- Dockerfile-orioledb-17 | 15 +- .../pg_upgrade_scripts/initiate.sh | 2 +- .../files/database-optimizations.service.j2 | 2 +- ansible/files/postgres_prestart.sh.j2 | 4 +- .../files/postgresql_config/autoexplain.conf | 3 - ansible/files/postgresql_config/pgcron.conf | 3 - .../postgresql_config/postgresql.conf.j2 | 643 +++++++++++++++++- ansible/tasks/finalize-ami.yml | 13 +- ansible/tasks/internal/supautils.yml | 11 +- ansible/tasks/setup-docker.yml | 9 +- ansible/tasks/setup-postgres.yml | 10 +- ansible/tasks/setup-supabase-internal.yml | 14 + ansible/tasks/setup-wal-g.yml | 12 +- ansible/tasks/stage2-setup-postgres.yml | 6 +- ansible/vars.yml | 6 +- nix/packages/lib.nix | 25 +- nix/tools/run-server.sh.in | 40 +- 19 files changed, 732 insertions(+), 114 deletions(-) delete mode 100644 ansible/files/postgresql_config/autoexplain.conf delete mode 100644 ansible/files/postgresql_config/pgcron.conf diff --git a/Dockerfile-15 b/Dockerfile-15 index 4c5904e4f..28f5122c0 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -158,21 +158,20 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - /etc/postgresql/postgresql.conf && \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ diff --git a/Dockerfile-17 b/Dockerfile-17 index dcd80bcb1..3ad03b37c 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -162,21 +162,20 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - /etc/postgresql/postgresql.conf && \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ @@ -190,7 +189,7 @@ RUN sed -i \ RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" -RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/05-supautils.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g' "/etc/postgresql-custom/supautils.conf" diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 0c6bc299f..29f2fa527 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -162,21 +162,20 @@ COPY --from=walg /tmp/wal-g /usr/local/bin/ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql-custom/00-logging.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/autoexplain.conf /etc/postgresql-custom/auto_explain.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/pgcron.conf /etc/postgresql-custom/pg_cron.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/05-supautils.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/bin/pgsodium_getkey.sh -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/04-read-replica.conf -COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/03-wal-g.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_read_replica.conf.j2 /etc/postgresql-custom/read-replica.conf +COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh RUN sed -i \ -e "s|#unix_socket_directories = '/tmp'|unix_socket_directories = '/var/run/postgresql'|g" \ -e "s|#session_preload_libraries = ''|session_preload_libraries = 'supautils'|g" \ - /etc/postgresql/postgresql.conf && \ + -e "s|#include = '/etc/postgresql-custom/supautils.conf'|include = '/etc/postgresql-custom/supautils.conf'|g" \ + -e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \ echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \ #echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \ echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \ @@ -190,7 +189,7 @@ RUN sed -i \ RUN sed -i 's/ timescaledb,//g;' "/etc/postgresql/postgresql.conf" #as of pg 16.4 + this db_user_namespace totally deprecated and will break the server if setting is present RUN sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "/etc/postgresql/postgresql.conf" -RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/05-supautils.conf" +RUN sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ postgis,//g; s/ pgrouting,//g' "/etc/postgresql-custom/supautils.conf" RUN sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "/etc/postgresql/postgresql.conf" RUN echo "default_table_access_method = 'orioledb'" >> "/etc/postgresql/postgresql.conf" diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 5f1e7ed87..71016a294 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -515,7 +515,7 @@ EOF mkdir -p "$MOUNT_POINT/conf" cp -R /etc/postgresql-custom/* "$MOUNT_POINT/conf/" # removing supautils config as to allow the latest one provided by the latest image to be used - rm -f "$MOUNT_POINT/conf/05-supautils.conf" || true + rm -f "$MOUNT_POINT/conf/supautils.conf" || true rm -rf "$MOUNT_POINT/conf/extension-custom-scripts" || true # removing wal-g config as to allow it to be explicitly enabled on the new instance diff --git a/ansible/files/database-optimizations.service.j2 b/ansible/files/database-optimizations.service.j2 index f2ad41ead..f25fc09c6 100644 --- a/ansible/files/database-optimizations.service.j2 +++ b/ansible/files/database-optimizations.service.j2 @@ -4,7 +4,7 @@ Description=Postgresql optimizations [Service] Type=oneshot # we do not want failures from these commands to cause downstream service startup to fail -ExecStart=-/opt/supabase-admin-api optimize db --destination-config-file-path /etc/postgresql-custom/01-generated-optimizations.conf +ExecStart=-/opt/supabase-admin-api optimize db --destination-config-file-path /etc/postgresql-custom/generated-optimizations.conf ExecStart=-/opt/supabase-admin-api optimize pgbouncer --destination-config-file-path /etc/pgbouncer-custom/generated-optimizations.ini User=adminapi diff --git a/ansible/files/postgres_prestart.sh.j2 b/ansible/files/postgres_prestart.sh.j2 index da722cb3c..cc8ff53c6 100644 --- a/ansible/files/postgres_prestart.sh.j2 +++ b/ansible/files/postgres_prestart.sh.j2 @@ -15,7 +15,7 @@ check_orioledb_enabled() { } get_shared_buffers() { - local opt_conf="/etc/postgresql-custom/01-generated-optimizations.conf" + local opt_conf="/etc/postgresql-custom/generated-optimizations.conf" if [ ! -f "$opt_conf" ]; then return 0 fi @@ -134,4 +134,4 @@ if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then locale-gen fi -main +main \ No newline at end of file diff --git a/ansible/files/postgresql_config/autoexplain.conf b/ansible/files/postgresql_config/autoexplain.conf deleted file mode 100644 index 3495fb141..000000000 --- a/ansible/files/postgresql_config/autoexplain.conf +++ /dev/null @@ -1,3 +0,0 @@ -# auto_explain - -auto_explain.log_min_duration = 10s diff --git a/ansible/files/postgresql_config/pgcron.conf b/ansible/files/postgresql_config/pgcron.conf deleted file mode 100644 index 56c909431..000000000 --- a/ansible/files/postgresql_config/pgcron.conf +++ /dev/null @@ -1,3 +0,0 @@ -# pg_cron - -cron.database_name = 'postgres' diff --git a/ansible/files/postgresql_config/postgresql.conf.j2 b/ansible/files/postgresql_config/postgresql.conf.j2 index edcf2142a..5d4237068 100644 --- a/ansible/files/postgresql_config/postgresql.conf.j2 +++ b/ansible/files/postgresql_config/postgresql.conf.j2 @@ -1,15 +1,55 @@ # ----------------------------- # PostgreSQL configuration file # ----------------------------- +# +# This file consists of lines of the form: +# +# name = value +# +# (The "=" is optional.) Whitespace may be used. Comments are introduced with +# "#" anywhere on a line. The complete list of parameter names and allowed +# values can be found in the PostgreSQL documentation. +# +# The commented-out settings shown in this file represent the default values. +# Re-commenting a setting is NOT sufficient to revert it to the default value; +# you need to reload the server. +# +# This file is read on server startup and when the server receives a SIGHUP +# signal. If you edit the file on a running system, you have to SIGHUP the +# server for the changes to take effect, run "pg_ctl reload", or execute +# "SELECT pg_reload_conf()". Some parameters, which are marked below, +# require a server shutdown and restart to take effect. +# +# Any parameter can also be given as a command-line option to the server, e.g., +# "postgres -c log_connections=on". Some parameters can be changed at run time +# with the "SET" SQL command. +# +# Memory units: B = bytes Time units: us = microseconds +# kB = kilobytes ms = milliseconds +# MB = megabytes s = seconds +# GB = gigabytes min = minutes +# TB = terabytes h = hours +# d = days #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ -data_directory = '/var/lib/postgresql/data' # use data in another directory (change requires restart) -hba_file = '/etc/postgresql/pg_hba.conf' # host-based authentication file (change requires restart) -ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file (change requires restart) +# The default values of these variables are driven from the -D command-line +# option or PGDATA environment variable, represented here as ConfigDir. + +data_directory = '/var/lib/postgresql/data' # use data in another directory + # (change requires restart) +hba_file = '/etc/postgresql/pg_hba.conf' # host-based authentication file + # (change requires restart) +ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file + # (change requires restart) + +# If external_pid_file is not explicitly set, no extra PID file is written. +#external_pid_file = '' # write an extra PID file + # (change requires restart) + #------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION @@ -17,12 +57,48 @@ ident_file = '/etc/postgresql/pg_ident.conf' # ident configuration file (change # - Connection Settings - -listen_addresses = '*' # what IP address(es) to listen on; comma-separated list of addresses; defaults to 'localhost'; use '*' for all (change requires restart) +listen_addresses = '*' # what IP address(es) to listen on; + # comma-separated list of addresses; + # defaults to 'localhost'; use '*' for all + # (change requires restart) +#port = 5432 # (change requires restart) +#max_connections = 100 # (change requires restart) +#superuser_reserved_connections = 3 # (change requires restart) +#unix_socket_directories = '/tmp' # comma-separated list of directories + # (change requires restart) +#unix_socket_group = '' # (change requires restart) +#unix_socket_permissions = 0777 # begin with 0 to use octal notation + # (change requires restart) +#bonjour = off # advertise server via Bonjour + # (change requires restart) +#bonjour_name = '' # defaults to the computer name + # (change requires restart) + +# - TCP settings - +# see "man tcp" for details + +#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; + # 0 selects the system default +#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; + # 0 selects the system default +#tcp_keepalives_count = 0 # TCP_KEEPCNT; + # 0 selects the system default +#tcp_user_timeout = 0 # TCP_USER_TIMEOUT, in milliseconds; + # 0 selects the system default + +#client_connection_check_interval = 0 # time between checks for client + # disconnection while running queries; + # 0 for never # - Authentication - authentication_timeout = 1min # 1s-600s password_encryption = scram-sha-256 # scram-sha-256 or md5 +db_user_namespace = off + +# GSSAPI using Kerberos +#krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab' +#krb_caseins_users = off # - SSL - @@ -48,7 +124,77 @@ ssl_passphrase_command_supports_reload = off # - Memory - -shared_buffers = 128MB # min 128kB (change requires restart) +shared_buffers = 128MB # min 128kB + # (change requires restart) +#huge_pages = try # on, off, or try + # (change requires restart) +#huge_page_size = 0 # zero for system default + # (change requires restart) +#temp_buffers = 8MB # min 800kB +#max_prepared_transactions = 0 # zero disables the feature + # (change requires restart) +# Caution: it is not advisable to set max_prepared_transactions nonzero unless +# you actively intend to use prepared transactions. +#work_mem = 4MB # min 64kB +#hash_mem_multiplier = 1.0 # 1-1000.0 multiplier on hash table work_mem +#maintenance_work_mem = 64MB # min 1MB +#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem +#logical_decoding_work_mem = 64MB # min 64kB +#max_stack_depth = 2MB # min 100kB +#shared_memory_type = mmap # the default is the first option + # supported by the operating system: + # mmap + # sysv + # windows + # (change requires restart) +#dynamic_shared_memory_type = posix # the default is the first option + # supported by the operating system: + # posix + # sysv + # windows + # mmap + # (change requires restart) +#min_dynamic_shared_memory = 0MB # (change requires restart) + +# - Disk - + +#temp_file_limit = -1 # limits per-process temp file space + # in kilobytes, or -1 for no limit + +# - Kernel Resources - + +#max_files_per_process = 1000 # min 64 + # (change requires restart) + +# - Cost-Based Vacuum Delay - + +#vacuum_cost_delay = 0 # 0-100 milliseconds (0 disables) +#vacuum_cost_page_hit = 1 # 0-10000 credits +#vacuum_cost_page_miss = 2 # 0-10000 credits +#vacuum_cost_page_dirty = 20 # 0-10000 credits +#vacuum_cost_limit = 200 # 1-10000 credits + +# - Background Writer - + +#bgwriter_delay = 200ms # 10-10000ms between rounds +#bgwriter_lru_maxpages = 100 # max buffers written/round, 0 disables +#bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round +#bgwriter_flush_after = 0 # measured in pages, 0 disables + +# - Asynchronous Behavior - + +#backend_flush_after = 0 # measured in pages, 0 disables +#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching +#maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching +#max_worker_processes = 8 # (change requires restart) +#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers +#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers +#max_parallel_workers = 8 # maximum number of max_worker_processes that + # can be used in parallel operations +#parallel_leader_participation = on +#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate + # (change requires restart) + #------------------------------------------------------------------------------ # WRITE-AHEAD LOG @@ -56,12 +202,90 @@ shared_buffers = 128MB # min 128kB (change requires restart) # - Settings - -wal_level = logical # minimal, replica, or logical (change requires restart) +wal_level = logical # minimal, replica, or logical + # (change requires restart) +#fsync = on # flush data to disk for crash safety + # (turning this off can cause + # unrecoverable data corruption) +#synchronous_commit = on # synchronization level; + # off, local, remote_write, remote_apply, or on +#wal_sync_method = fsync # the default is the first option + # supported by the operating system: + # open_datasync + # fdatasync (default on Linux and FreeBSD) + # fsync + # fsync_writethrough + # open_sync +#full_page_writes = on # recover from partial page writes +#wal_log_hints = off # also do full page writes of non-critical updates + # (change requires restart) +#wal_compression = off # enable compression of full-page writes +#wal_init_zero = on # zero-fill new WAL files +#wal_recycle = on # recycle WAL files +#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers + # (change requires restart) +#wal_writer_delay = 200ms # 1-10000 milliseconds +#wal_writer_flush_after = 1MB # measured in pages, 0 disables +#wal_skip_threshold = 2MB + +#commit_delay = 0 # range 0-100000, in microseconds +#commit_siblings = 5 # range 1-1000 # - Checkpoints - +#checkpoint_timeout = 5min # range 30s-1d checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -checkpoint_flush_after = 32 # measured in 8k pages, 0 disables +checkpoint_flush_after = 256kB # measured in pages, 0 disables +#checkpoint_warning = 30s # 0 disables +#max_wal_size = 1GB +#min_wal_size = 80MB + +# - Archiving - + +#archive_mode = off # enables archiving; off, on, or always + # (change requires restart) +#archive_command = '' # command to use to archive a logfile segment + # placeholders: %p = path of file to archive + # %f = file name only + # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' +#archive_timeout = 0 # force a logfile segment switch after this + # number of seconds; 0 disables + +# - Archive Recovery - + +# These are only used in recovery mode. + +#restore_command = '' # command to use to restore an archived logfile segment + # placeholders: %p = path of file to restore + # %f = file name only + # e.g. 'cp /mnt/server/archivedir/%f %p' +#archive_cleanup_command = '' # command to execute at every restartpoint +#recovery_end_command = '' # command to execute at completion of recovery + +# - Recovery Target - + +# Set these only when performing a targeted recovery. + +#recovery_target = '' # 'immediate' to end recovery as soon as a + # consistent state is reached + # (change requires restart) +#recovery_target_name = '' # the named restore point to which recovery will proceed + # (change requires restart) +#recovery_target_time = '' # the time stamp up to which recovery will proceed + # (change requires restart) +#recovery_target_xid = '' # the transaction ID up to which recovery will proceed + # (change requires restart) +#recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed + # (change requires restart) +#recovery_target_inclusive = on # Specifies whether to stop: + # just after the specified recovery target (on) + # just before the recovery target (off) + # (change requires restart) +#recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID + # (change requires restart) +#recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' + # (change requires restart) + #------------------------------------------------------------------------------ # REPLICATION @@ -71,24 +295,218 @@ checkpoint_flush_after = 32 # measured in 8k pages, 0 disables # Set these on the primary and on any standby that will send replication data. -max_wal_senders = 10 # max number of walsender processes (change requires restart) -max_replication_slots = 5 # max number of replication slots (change requires restart) +max_wal_senders = 10 # max number of walsender processes + # (change requires restart) +max_replication_slots = 5 # max number of replication slots + # (change requires restart) +#wal_keep_size = 0 # in megabytes; 0 disables max_slot_wal_keep_size = 4096 # in megabytes; -1 disables +#wal_sender_timeout = 60s # in milliseconds; 0 disables +#track_commit_timestamp = off # collect timestamp of transaction commit + # (change requires restart) + +# - Primary Server - + +# These settings are ignored on a standby server. + +#synchronous_standby_names = '' # standby servers that provide sync rep + # method to choose sync standbys, number of sync standbys, + # and comma-separated list of application_name + # from standby(s); '*' = all +#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed + +# - Standby Servers - + +# These settings are ignored on a primary server. + +#primary_conninfo = '' # connection string to sending server +#primary_slot_name = '' # replication slot on sending server +#promote_trigger_file = '' # file name whose presence ends recovery +#hot_standby = on # "off" disallows queries during recovery + # (change requires restart) +#max_standby_archive_delay = 30s # max delay before canceling queries + # when reading WAL from archive; + # -1 allows indefinite delay +#max_standby_streaming_delay = 30s # max delay before canceling queries + # when reading streaming WAL; + # -1 allows indefinite delay +#wal_receiver_create_temp_slot = off # create temp slot if primary_slot_name + # is not set +#wal_receiver_status_interval = 10s # send replies at least this often + # 0 disables +#hot_standby_feedback = off # send info from standby to prevent + # query conflicts +#wal_receiver_timeout = 60s # time that receiver waits for + # communication from primary + # in milliseconds; 0 disables +#wal_retrieve_retry_interval = 5s # time to wait before retrying to + # retrieve WAL after a failed attempt +#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery + +# - Subscribers - + +# These settings are ignored on a publisher. + +#max_logical_replication_workers = 4 # taken from max_worker_processes + # (change requires restart) +#max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers + #------------------------------------------------------------------------------ # QUERY TUNING #------------------------------------------------------------------------------ +# - Planner Method Configuration - + +#enable_async_append = on +#enable_bitmapscan = on +#enable_gathermerge = on +#enable_hashagg = on +#enable_hashjoin = on +#enable_incremental_sort = on +#enable_indexscan = on +#enable_indexonlyscan = on +#enable_material = on +#enable_resultcache = on +#enable_mergejoin = on +#enable_nestloop = on +#enable_parallel_append = on +#enable_parallel_hash = on +#enable_partition_pruning = on +#enable_partitionwise_join = off +#enable_partitionwise_aggregate = off +#enable_seqscan = on +#enable_sort = on +#enable_tidscan = on + # - Planner Cost Constants - +#seq_page_cost = 1.0 # measured on an arbitrary scale +#random_page_cost = 4.0 # same scale as above +#cpu_tuple_cost = 0.01 # same scale as above +#cpu_index_tuple_cost = 0.005 # same scale as above +#cpu_operator_cost = 0.0025 # same scale as above +#parallel_setup_cost = 1000.0 # same scale as above +#parallel_tuple_cost = 0.1 # same scale as above +#min_parallel_table_scan_size = 8MB +#min_parallel_index_scan_size = 512kB effective_cache_size = 128MB +#jit_above_cost = 100000 # perform JIT compilation if available + # and query more expensive than this; + # -1 disables +#jit_inline_above_cost = 500000 # inline small functions if query is + # more expensive than this; -1 disables +#jit_optimize_above_cost = 500000 # use expensive JIT optimizations if + # query is more expensive than this; + # -1 disables + +# - Genetic Query Optimizer - + +#geqo = on +#geqo_threshold = 12 +#geqo_effort = 5 # range 1-10 +#geqo_pool_size = 0 # selects default based on effort +#geqo_generations = 0 # selects default based on effort +#geqo_selection_bias = 2.0 # range 1.5-2.0 +#geqo_seed = 0.0 # range 0.0-1.0 + +# - Other Planner Options - + +#default_statistics_target = 100 # range 1-10000 +#constraint_exclusion = partition # on, off, or partition +#cursor_tuple_fraction = 0.1 # range 0.0-1.0 +#from_collapse_limit = 8 +#jit = on # allow JIT compilation +#join_collapse_limit = 8 # 1 disables collapsing of explicit + # JOIN clauses +#plan_cache_mode = auto # auto, force_generic_plan or + # force_custom_plan + + #------------------------------------------------------------------------------ # REPORTING AND LOGGING #------------------------------------------------------------------------------ +include = '/etc/postgresql/logging.conf' + +# These are relevant when logging to syslog: +#syslog_facility = 'LOCAL0' +#syslog_ident = 'postgres' +#syslog_sequence_numbers = on +#syslog_split_messages = on + +# This is only relevant when logging to eventlog (Windows): +# (change requires restart) +#event_source = 'PostgreSQL' + +# - When to Log - + +#log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + +#log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + +#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + +#log_min_duration_sample = -1 # -1 is disabled, 0 logs a sample of statements + # and their durations, > 0 logs only a sample of + # statements running at least this number + # of milliseconds; + # sample fraction is determined by log_statement_sample_rate + +#log_statement_sample_rate = 1.0 # fraction of logged statements exceeding + # log_min_duration_sample to be logged; + # 1.0 logs all such statements, 0.0 never logs + + +#log_transaction_sample_rate = 0.0 # fraction of transactions whose statements + # are logged regardless of their duration; 1.0 logs all + # statements from all transactions, 0.0 never logs + # - What to Log - +#debug_print_parse = off +#debug_print_rewritten = off +#debug_print_plan = off +#debug_pretty_print = on +#log_autovacuum_min_duration = -1 # log autovacuum activity; + # -1 disables, 0 logs all actions and + # their durations, > 0 logs only + # actions running at least this number + # of milliseconds. +#log_checkpoints = off +#log_connections = off +#log_disconnections = off +#log_duration = off +#log_error_verbosity = default # terse, default, or verbose messages +#log_hostname = off log_line_prefix = '%h %m [%p] %q%u@%d ' # special values: # %a = application name # %u = user name @@ -113,14 +531,86 @@ log_line_prefix = '%h %m [%p] %q%u@%d ' # special values: # processes # %% = '%' # e.g. '<%u%%%d> ' +#log_lock_waits = off # log lock waits >= deadlock_timeout +#log_recovery_conflict_waits = off # log standby recovery conflict waits + # >= deadlock_timeout +#log_parameter_max_length = -1 # when logging statements, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables +#log_parameter_max_length_on_error = 0 # when logging an error, limit logged + # bind-parameter values to N bytes; + # -1 means print in full, 0 disables log_statement = 'ddl' # none, ddl, mod, all +#log_replication_commands = off +#log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes; + # -1 disables, 0 logs all temp files log_timezone = 'UTC' #------------------------------------------------------------------------------ # PROCESS TITLE #------------------------------------------------------------------------------ -cluster_name = 'main' # added to process titles if nonempty (change requires restart) +cluster_name = 'main' # added to process titles if nonempty + # (change requires restart) +#update_process_title = on + + +#------------------------------------------------------------------------------ +# STATISTICS +#------------------------------------------------------------------------------ + +# - Query and Index Statistics Collector - + +#track_activities = on +#track_activity_query_size = 1024 # (change requires restart) +#track_counts = on +#track_io_timing = off +#track_wal_io_timing = off +#track_functions = none # none, pl, all +#stats_temp_directory = 'pg_stat_tmp' + + +# - Monitoring - + +#compute_query_id = auto +#log_statement_stats = off +#log_parser_stats = off +#log_planner_stats = off +#log_executor_stats = off + + +#------------------------------------------------------------------------------ +# AUTOVACUUM +#------------------------------------------------------------------------------ + +#autovacuum = on # Enable autovacuum subprocess? 'on' + # requires track_counts to also be on. +#autovacuum_max_workers = 3 # max number of autovacuum subprocesses + # (change requires restart) +#autovacuum_naptime = 1min # time between autovacuum runs +#autovacuum_vacuum_threshold = 50 # min number of row updates before + # vacuum +#autovacuum_vacuum_insert_threshold = 1000 # min number of row inserts + # before vacuum; -1 disables insert + # vacuums +#autovacuum_analyze_threshold = 50 # min number of row updates before + # analyze +#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum +#autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table + # size before insert vacuum +#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze +#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum + # (change requires restart) +#autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age + # before forced vacuum + # (change requires restart) +#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for + # autovacuum, in milliseconds; + # -1 means use vacuum_cost_delay +#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for + # autovacuum, -1 means use + # vacuum_cost_limit #------------------------------------------------------------------------------ @@ -129,15 +619,63 @@ cluster_name = 'main' # added to process titles if nonempty (change requires r # - Statement Behavior - +#client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error +#search_path = '"$user", public' # schema names row_security = on +#default_table_access_method = 'heap' +#default_tablespace = '' # a tablespace name, '' uses the default +#default_toast_compression = 'pglz' # 'pglz' or 'lz4' +#temp_tablespaces = '' # a list of tablespace names, '' uses + # only default tablespace +#check_function_bodies = on +#default_transaction_isolation = 'read committed' +#default_transaction_read_only = off +#default_transaction_deferrable = off +#session_replication_role = 'origin' +#statement_timeout = 0 # in milliseconds, 0 is disabled +#lock_timeout = 0 # in milliseconds, 0 is disabled +#idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled +#idle_session_timeout = 0 # in milliseconds, 0 is disabled +#vacuum_freeze_table_age = 150000000 +#vacuum_freeze_min_age = 50000000 +#vacuum_failsafe_age = 1600000000 +#vacuum_multixact_freeze_table_age = 150000000 +#vacuum_multixact_freeze_min_age = 5000000 +#vacuum_multixact_failsafe_age = 1600000000 +#bytea_output = 'hex' # hex, escape +#xmlbinary = 'base64' +#xmloption = 'content' +#gin_pending_list_limit = 4MB # - Locale and Formatting - +#datestyle = 'iso, mdy' +#intervalstyle = 'postgres' timezone = 'UTC' -extra_float_digits = 0 # min -15, max 3; any value >0 actually selects precise output mode +#timezone_abbreviations = 'Default' # Select the set of available time zone + # abbreviations. Currently, there are + # Default + # Australia (historical usage) + # India + # You can create your own file in + # share/timezonesets/. +extra_float_digits = 0 # min -15, max 3; any value >0 actually + # selects precise output mode +#client_encoding = sql_ascii # actually, defaults to database + # encoding # These settings are initialized by initdb, but they can be changed. -lc_messages = 'en_US.UTF-8' # locale for system error message strings +lc_messages = 'en_US.UTF-8' # locale for system error message + # strings lc_monetary = 'en_US.UTF-8' # locale for monetary formatting lc_numeric = 'en_US.UTF-8' # locale for number formatting lc_time = 'en_US.UTF-8' # locale for time formatting @@ -147,9 +685,63 @@ default_text_search_config = 'pg_catalog.english' # - Shared Library Preloading - +#local_preload_libraries = '' +#session_preload_libraries = '' + shared_preload_libraries = 'pg_stat_statements, pgaudit, plpgsql, plpgsql_check, pg_cron, pg_net, pgsodium, timescaledb, auto_explain, pg_tle, plan_filter, supabase_vault' # (change requires restart) jit_provider = 'llvmjit' # JIT library to use +# - Other Defaults - + +#dynamic_library_path = '$libdir' +#gin_fuzzy_search_limit = 0 + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +#deadlock_timeout = 1s +#max_locks_per_transaction = 64 # min 10 + # (change requires restart) +#max_pred_locks_per_transaction = 64 # min 10 + # (change requires restart) +#max_pred_locks_per_relation = -2 # negative values mean + # (max_pred_locks_per_transaction + # / -max_pred_locks_per_relation) - 1 +#max_pred_locks_per_page = 2 # min 0 + + +#------------------------------------------------------------------------------ +# VERSION AND PLATFORM COMPATIBILITY +#------------------------------------------------------------------------------ + +# - Previous PostgreSQL Versions - + +#array_nulls = on +#backslash_quote = safe_encoding # on, off, or safe_encoding +#escape_string_warning = on +#lo_compat_privileges = off +#quote_all_identifiers = off +#standard_conforming_strings = on +#synchronize_seqscans = on + +# - Other Platforms and Clients - + +#transform_null_equals = off + + +#------------------------------------------------------------------------------ +# ERROR HANDLING +#------------------------------------------------------------------------------ + +#exit_on_error = off # terminate session on any error? +#restart_after_crash = on # reinitialize after backend crash? +#data_sync_retry = off # retry or panic on failure to fsync + # data? + # (change requires restart) +#recovery_init_sync_method = fsync # fsync, syncfs (Linux 5.8+) + + #------------------------------------------------------------------------------ # CONFIG FILE INCLUDES #------------------------------------------------------------------------------ @@ -158,4 +750,29 @@ jit_provider = 'llvmjit' # JIT library to use # default postgresql.conf. Note that these are directives, not variable # assignments, so they can usefully be given more than once. -include_dir = '/etc/postgresql-custom' # include files ending in '.conf' from a directory, e.g., 'conf.d' +#include_dir = '...' # include files ending in '.conf' from + # a directory, e.g., 'conf.d' +#include_if_exists = '...' # include file only if it exists +#include = '...' # include file + +# Automatically generated optimizations +#include = '/etc/postgresql-custom/generated-optimizations.conf' +# User-supplied custom parameters, override any automatically generated ones +#include = '/etc/postgresql-custom/custom-overrides.conf' + +# WAL-G specific configurations +#include = '/etc/postgresql-custom/wal-g.conf' + +# read replica specific configurations +include = '/etc/postgresql-custom/read-replica.conf' + +# supautils specific configurations +#include = '/etc/postgresql-custom/supautils.conf' + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +# Add settings for extensions here +auto_explain.log_min_duration = 10s +cron.database_name = 'postgres' diff --git a/ansible/tasks/finalize-ami.yml b/ansible/tasks/finalize-ami.yml index da6b8fe8d..1cc729fc0 100644 --- a/ansible/tasks/finalize-ami.yml +++ b/ansible/tasks/finalize-ami.yml @@ -1,20 +1,9 @@ - name: PG logging conf ansible.builtin.template: - dest: '/etc/postgresql-custom/00-logging.conf' + dest: '/etc/postgresql/logging.conf' group: 'postgres' src: 'files/postgresql_config/postgresql-csvlog.conf' -- name: auto_explain and pg_cron confs - ansible.builtin.template: - dest: "/etc/postgresql-custom/{{ ext_item }}.conf" - group: 'postgres' - src: "files/postgresql_config/{{ ext_item | split('_') | join('') }}.conf" - loop: - - auto_explain - - pg_cron - loop_control: - loop_var: 'ext_item' - - name: UFW - Allow SSH connections community.general.ufw: name: 'OpenSSH' diff --git a/ansible/tasks/internal/supautils.yml b/ansible/tasks/internal/supautils.yml index 38e911f52..33811b5ac 100644 --- a/ansible/tasks/internal/supautils.yml +++ b/ansible/tasks/internal/supautils.yml @@ -39,10 +39,10 @@ regexp: "#session_preload_libraries = ''" replace: session_preload_libraries = 'supautils' -- name: supautils - write custom 05-supautils.conf +- name: supautils - write custom supautils.conf template: src: "files/postgresql_config/supautils.conf.j2" - dest: /etc/postgresql-custom/05-supautils.conf + dest: /etc/postgresql-custom/supautils.conf mode: 0664 owner: postgres group: postgres @@ -62,6 +62,13 @@ recurse: yes become: yes +- name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf + become: yes + replace: + path: /etc/postgresql/postgresql.conf + regexp: "#include = '/etc/postgresql-custom/supautils.conf'" + replace: "include = '/etc/postgresql-custom/supautils.conf'" + - name: supautils - remove build dependencies apt: pkg: diff --git a/ansible/tasks/setup-docker.yml b/ansible/tasks/setup-docker.yml index bb5991bc6..6a3a12cc4 100644 --- a/ansible/tasks/setup-docker.yml +++ b/ansible/tasks/setup-docker.yml @@ -51,7 +51,7 @@ - name: supautils - write custom supautils.conf ansible.builtin.template: - dest: '/etc/postgresql-custom/05-supautils.conf' + dest: '/etc/postgresql-custom/supautils.conf' mode: '0664' group: 'postgres' owner: 'postgres' @@ -72,6 +72,13 @@ recurse: true become: true + - name: supautils - include /etc/postgresql-custom/supautils.conf in postgresql.conf + ansible.builtin.replace: + path: '/etc/postgresql/postgresql.conf' + regexp: "#include = '/etc/postgresql-custom/supautils.conf'" + replace: "include = '/etc/postgresql-custom/supautils.conf'" + become: true + - name: Cleanup - extension packages ansible.builtin.file: path: '/tmp/extensions' diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 691c24da4..2fe302488 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -126,8 +126,8 @@ group: postgres mode: 0664 with_items: - - '01-generated-optimizations.conf' - - '02-custom-overrides.conf' + - 'generated-optimizations.conf' + - 'custom-overrides.conf' when: debpkg_mode or nixpkg_mode # Move Postgres configuration files into /etc/postgresql @@ -156,10 +156,10 @@ when: debpkg_mode or nixpkg_mode # Add custom config for read replicas set up -- name: Move custom read-replica.conf file to /etc/postgresql-custom/04-read-replica.conf +- name: Move custom read-replica.conf file to /etc/postgresql-custom/read-replica.conf template: src: "files/postgresql_config/custom_read_replica.conf.j2" - dest: /etc/postgresql-custom/04-read-replica.conf + dest: /etc/postgresql-custom/read-replica.conf mode: 0664 owner: postgres group: postgres @@ -212,7 +212,7 @@ group: postgres when: nixpkg_mode -- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary +- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary block: - name: Check if psql_version is psql_orioledb set_fact: diff --git a/ansible/tasks/setup-supabase-internal.yml b/ansible/tasks/setup-supabase-internal.yml index 74327911a..d63f3abad 100644 --- a/ansible/tasks/setup-supabase-internal.yml +++ b/ansible/tasks/setup-supabase-internal.yml @@ -84,6 +84,20 @@ state: directory owner: vector +- name: Include file for generated optimizations in postgresql.conf + become: true + replace: + path: /etc/postgresql/postgresql.conf + regexp: "#include = '/etc/postgresql-custom/generated-optimizations.conf'" + replace: "include = '/etc/postgresql-custom/generated-optimizations.conf'" + +- name: Include file for custom overrides in postgresql.conf + become: true + replace: + path: /etc/postgresql/postgresql.conf + regexp: "#include = '/etc/postgresql-custom/custom-overrides.conf'" + replace: "include = '/etc/postgresql-custom/custom-overrides.conf'" + - name: Install Postgres exporter import_tasks: internal/postgres-exporter.yml diff --git a/ansible/tasks/setup-wal-g.yml b/ansible/tasks/setup-wal-g.yml index 28fda91af..a05106ede 100644 --- a/ansible/tasks/setup-wal-g.yml +++ b/ansible/tasks/setup-wal-g.yml @@ -60,10 +60,10 @@ mode: '0664' when: stage2_nix -- name: Move custom wal-g.conf file to /etc/postgresql-custom/03-wal-g.conf +- name: Move custom wal-g.conf file to /etc/postgresql-custom/wal-g.conf template: src: "files/postgresql_config/custom_walg.conf.j2" - dest: /etc/postgresql-custom/03-wal-g.conf + dest: /etc/postgresql-custom/wal-g.conf mode: 0664 owner: postgres group: postgres @@ -85,3 +85,11 @@ mode: 0700 owner: root when: stage2_nix + +- name: Include /etc/postgresql-custom/wal-g.conf in postgresql.conf + become: yes + replace: + path: /etc/postgresql/postgresql.conf + regexp: "#include = '/etc/postgresql-custom/wal-g.conf'" + replace: "include = '/etc/postgresql-custom/wal-g.conf'" + when: stage2_nix diff --git a/ansible/tasks/stage2-setup-postgres.yml b/ansible/tasks/stage2-setup-postgres.yml index 6f696d5d3..74da50a57 100644 --- a/ansible/tasks/stage2-setup-postgres.yml +++ b/ansible/tasks/stage2-setup-postgres.yml @@ -4,7 +4,7 @@ # sudo -u postgres bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile install nixpkgs#openjdk11" # It was decided to leave pljava disabled at https://github.com/supabase/postgres/pull/690 therefore removing this task -- name: Check psql_version and modify 05-supautils.conf and postgresql.conf if necessary +- name: Check psql_version and modify supautils.conf and postgresql.conf if necessary block: - name: Check if psql_version is psql_orioledb-17 set_fact: @@ -26,11 +26,11 @@ when: is_psql_oriole or is_psql_17 and stage2_nix become: yes - - name: Remove specified extensions from 05-supautils.conf if orioledb-17 or 17 build + - name: Remove specified extensions from supautils.conf if orioledb-17 or 17 build ansible.builtin.command: cmd: > sed -i 's/ timescaledb,//g; s/ plv8,//g' - /etc/postgresql-custom/05-supautils.conf + /etc/postgresql-custom/supautils.conf when: is_psql_oriole or is_psql_17 and stage2_nix become: yes diff --git a/ansible/vars.yml b/ansible/vars.yml index c30069929..0a9e3bd8f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.041-orioledb" - postgres17: "17.6.1.020" - postgres15: "15.14.1.020" + postgresorioledb-17: "17.5.1.042-orioledb" + postgres17: "17.6.1.021" + postgres15: "15.14.1.021" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/packages/lib.nix b/nix/packages/lib.nix index 5e4d38753..971909162 100644 --- a/nix/packages/lib.nix +++ b/nix/packages/lib.nix @@ -41,17 +41,9 @@ path = ../../ansible/files/postgresql_config/supautils.conf.j2; }; loggingConfigFile = builtins.path { - name = "00-logging.conf"; + name = "logging.conf"; path = ../../ansible/files/postgresql_config/postgresql-csvlog.conf; }; - autoexplainConfigFile = builtins.path { - name = "auto_explain.conf"; - path = ../../ansible/files/postgresql_config/autoexplain.conf; - }; - pgcronConfigFile = builtins.path { - name = "pg_cron.conf"; - path = ../../ansible/files/postgresql_config/pgcron.conf; - }; readReplicaConfigFile = builtins.path { name = "readreplica.conf"; path = ../../ansible/files/postgresql_config/custom_read_replica.conf.j2; @@ -91,8 +83,6 @@ PGSODIUM_GETKEY = "${paths.getkeyScript}"; READREPL_CONF_FILE = "${paths.readReplicaConfigFile}"; LOGGING_CONF_FILE = "${paths.loggingConfigFile}"; - AUTOEXPLAIN_CONF_FILE = "${paths.autoexplainConfigFile}"; - PGCRON_CONF_FILE = "${paths.pgcronConfigFile}"; SUPAUTILS_CONF_FILE = "${paths.supautilsConfigFile}"; PG_HBA = "${paths.pgHbaConfigFile}"; PG_IDENT = "${paths.pgIdentConfigFile}"; @@ -120,18 +110,19 @@ mkdir -p $out/bin $out/etc/postgresql-custom $out/etc/postgresql $out/extension-custom-scripts # Copy config files with error handling - cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/05-supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } + cp ${paths.supautilsConfigFile} $out/etc/postgresql-custom/supautils.conf || { echo "Failed to copy supautils.conf"; exit 1; } cp ${paths.pgconfigFile} $out/etc/postgresql/postgresql.conf || { echo "Failed to copy postgresql.conf"; exit 1; } - cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/00-logging.conf || { echo "Failed to copy logging.conf"; exit 1; } - cp ${paths.autoexplainConfigFile} $out/etc/postgresql-custom/auto_explain.conf || { echo "Failed to copy auto_explain.conf"; exit 1; } - cp ${paths.pgcronConfigFile} $out/etc/postgresql-custom/pg_cron.conf || { echo "Failed to copy pg_cron.conf"; exit 1; } - cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/04-read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } + cp ${paths.loggingConfigFile} $out/etc/postgresql-custom/logging.conf || { echo "Failed to copy logging.conf"; exit 1; } + cp ${paths.readReplicaConfigFile} $out/etc/postgresql-custom/read-replica.conf || { echo "Failed to copy read-replica.conf"; exit 1; } cp ${paths.pgHbaConfigFile} $out/etc/postgresql/pg_hba.conf || { echo "Failed to copy pg_hba.conf"; exit 1; } cp ${paths.pgIdentConfigFile} $out/etc/postgresql/pg_ident.conf || { echo "Failed to copy pg_ident.conf"; exit 1; } cp -r ${paths.postgresqlExtensionCustomScriptsPath}/* $out/extension-custom-scripts/ || { echo "Failed to copy custom scripts"; exit 1; } echo "Copy operation completed" - chmod 644 $out/etc/postgresql-custom/05-supautils.conf $out/etc/postgresql/postgresql.conf $out/etc/postgresql-custom/00-logging.conf $out/etc/postgresql/pg_hba.conf + chmod 644 $out/etc/postgresql-custom/supautils.conf + chmod 644 $out/etc/postgresql/postgresql.conf + chmod 644 $out/etc/postgresql-custom/logging.conf + chmod 644 $out/etc/postgresql/pg_hba.conf substitute ${../tools/run-server.sh.in} $out/bin/start-postgres-server \ ${ diff --git a/nix/tools/run-server.sh.in b/nix/tools/run-server.sh.in index 2191ff686..182cbe554 100644 --- a/nix/tools/run-server.sh.in +++ b/nix/tools/run-server.sh.in @@ -165,8 +165,6 @@ PSQL_CONF_FILE=@PSQL_CONF_FILE@ PORTNO="${PORTNO:-@PGSQL_DEFAULT_PORT@}" SUPAUTILS_CONFIG_FILE=@SUPAUTILS_CONF_FILE@ LOGGING_CONFIG_FILE=@LOGGING_CONF_FILE@ -AUTOEXPLAIN_CONFIG_FILE=@AUTOEXPLAIN_CONF_FILE@ -PGCRON_CONFIG_FILE=@PGCRON_CONF_FILE@ READREPL_CONFIG_FILE=@READREPL_CONF_FILE@ PG_HBA_FILE=@PG_HBA@ PG_IDENT_FILE=@PG_IDENT@ @@ -217,29 +215,25 @@ fi echo "NOTE: patching postgresql.conf files" cp "$PG_HBA_FILE" "$DATDIR/pg_hba.conf" cp "$PG_IDENT_FILE" "$DATDIR/pg_ident.conf" -mkdir -p "$DATDIR/postgresql-custom" -mkdir -p "$DATDIR/pg_log" -cp "$READREPL_CONFIG_FILE" "$DATDIR/postgresql-custom/04-read-replica.conf" -cp "$AUTOEXPLAIN_CONFIG_FILE" "$DATDIR/postgresql-custom/auto_explain.conf" -cp "$PGCRON_CONFIG_FILE" "$DATDIR/postgresql-custom/pg_cron.conf" +cp "$READREPL_CONFIG_FILE" "$DATDIR/read-replica.conf" mkdir -p "$DATDIR/extension-custom-scripts" cp -r "$EXTENSION_CUSTOM_SCRIPTS"/* "$DATDIR/extension-custom-scripts" -# Configure logging with correct log directory -sed "s|log_directory = '/var/log/postgresql'|log_directory = '$DATDIR/pg_log'|" "$LOGGING_CONFIG_FILE" > "$DATDIR/postgresql-custom/00-logging.conf" - # Configure supautils -sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/postgresql-custom/05-supautils.conf" +sed "s|supautils.extension_custom_scripts_path = '/etc/postgresql-custom/extension-custom-scripts'|supautils.extension_custom_scripts_path = '$DATDIR/extension-custom-scripts'|" "$SUPAUTILS_CONFIG_FILE" > "$DATDIR/supautils.conf" # Configure PostgreSQL -sed -e "\$a\\ +sed -e "1i\\ +include = '$DATDIR/supautils.conf'" \ +-e "\$a\\ pgsodium.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "\$a\\ vault.getkey_script = '$PGSODIUM_GETKEY_SCRIPT'" \ -e "s|data_directory = '/var/lib/postgresql/data'|data_directory = '$DATDIR'|" \ -e "s|hba_file = '/etc/postgresql/pg_hba.conf'|hba_file = '$DATDIR/pg_hba.conf'|" \ -e "s|ident_file = '/etc/postgresql/pg_ident.conf'|ident_file = '$DATDIR/pg_ident.conf'|" \ --e "s|include_dir = '/etc/postgresql-custom'|include_dir = '$DATDIR/postgresql-custom'|" \ +-e "s|include = '/etc/postgresql/logging.conf'|#&|" \ +-e "s|include = '/etc/postgresql-custom/read-replica.conf'|include = '$DATDIR/read-replica.conf'|" \ -e "\$a\\ session_preload_libraries = 'supautils'" \ "$PSQL_CONF_FILE" > "$DATDIR/postgresql.conf" @@ -251,34 +245,34 @@ orioledb_config_items() { echo "non-macos oriole conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g; s/ pgjwt,//g;' "$DATDIR/supautils.conf" sed -i 's/\(shared_preload_libraries.*\)'\''\(.*\)$/\1, orioledb'\''\2/' "$DATDIR/postgresql.conf" echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" elif [[ "$1" = "orioledb-17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then # macOS specific configuration echo "macOS detected, applying macOS specific configuration" ls -la "$DATDIR" - + # Use perl instead of sed for macOS perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g' "$DATDIR/postgresql.conf" - - perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql-custom/05-supautils.conf" - perl -pi -e 's/ plv8,//g' "$DATDIR/postgresql-custom/05-supautils.conf" - perl -pi -e 's/ pgjwt,//g' "$DATDIR/postgresql-custom/05-supautils.conf" + + perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ plv8,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ pgjwt,//g' "$DATDIR/supautils.conf" perl -pi -e 's/(shared_preload_libraries\s*=\s*'\''.*?)'\''/\1, orioledb'\''/' "$DATDIR/postgresql.conf" - + echo "default_table_access_method = 'orioledb'" >> "$DATDIR/postgresql.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" != "aarch64-darwin" ]]; then echo "non-macos pg 17 conf" sed -i 's/ timescaledb,//g;' "$DATDIR/postgresql.conf" sed -i 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" - sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" + sed -i 's/ timescaledb,//g; s/ plv8,//g;' "$DATDIR/supautils.conf" elif [[ "$VERSION" == "17" && "$CURRENT_SYSTEM" = "aarch64-darwin" ]]; then perl -pi -e 's/db_user_namespace = off/#db_user_namespace = off/g;' "$DATDIR/postgresql.conf" perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql.conf" - perl -pi -e 's/ timescaledb,//g' "$DATDIR/postgresql-custom/05-supautils.conf" - perl -pi -e 's/ plv8,//g;' "$DATDIR/postgresql-custom/05-supautils.conf" + perl -pi -e 's/ timescaledb,//g' "$DATDIR/supautils.conf" + perl -pi -e 's/ plv8,//g;' "$DATDIR/supautils.conf" fi } From 7ce04f4699cd0def32cdd1166ccbe728b06cda38 Mon Sep 17 00:00:00 2001 From: Etienne Stalmans Date: Tue, 14 Oct 2025 06:05:57 +0200 Subject: [PATCH 124/134] chore: systemd hardening (#1837) * chore: systemd hardening ProtectHome and InaccessiblePaths to senstive internal locations * Apply suggestion from @pcnc Co-authored-by: Paul Cioanca * chore: more paths --------- Co-authored-by: Paul Cioanca --- ansible/files/postgresql_config/postgresql.service.j2 | 4 +++- ansible/vars.yml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.service.j2 b/ansible/files/postgresql_config/postgresql.service.j2 index 4cc138ec7..30bbd5f6d 100644 --- a/ansible/files/postgresql_config/postgresql.service.j2 +++ b/ansible/files/postgresql_config/postgresql.service.j2 @@ -22,7 +22,9 @@ OOMScoreAdjust=-1000 EnvironmentFile=-/etc/environment.d/postgresql.env LimitNOFILE=16384 {% if supabase_internal is defined %} -ReadOnlyPaths=/etc +ProtectHome=yes +ReadOnlyPaths=/etc /opt +InaccessiblePaths=-/var/lib/supabase -/var/lib/supabase-admin-agent -/var/lib/cloud -/var/cache/supabase-admin-agent -/opt/saltstack -/etc/salt {% endif %} [Install] WantedBy=multi-user.target diff --git a/ansible/vars.yml b/ansible/vars.yml index 0a9e3bd8f..0f77b1820 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.042-orioledb" - postgres17: "17.6.1.021" - postgres15: "15.14.1.021" + postgresorioledb-17: "17.5.1.043-orioledb" + postgres17: "17.6.1.022" + postgres15: "15.14.1.022" # Non Postgres Extensions pgbouncer_release: 1.19.0 From da08e35521e8f0befa0ae855402a251773eb910a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 14 Oct 2025 11:45:29 +0200 Subject: [PATCH 125/134] fix(nix): remove '%' character from Nix trusted-public-keys configuration (#1840) The '%' character cannot be part of our trusted-public-keys value as it is not a valid base64 character. --- .github/workflows/ami-release-nix-single.yml | 2 +- .github/workflows/ami-release-nix.yml | 4 ++-- .github/workflows/nix-build.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- .github/workflows/testinfra-ami-build.yml | 4 ++-- Dockerfile-15 | 2 +- Dockerfile-17 | 2 +- Dockerfile-orioledb-17 | 2 +- .../files/admin_api_scripts/pg_upgrade_scripts/initiate.sh | 4 ++-- docker/nix/Dockerfile | 2 +- ebssurrogate/scripts/qemu-bootstrap-nix.sh | 2 +- scripts/nix-provision.sh | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ami-release-nix-single.yml b/.github/workflows/ami-release-nix-single.yml index 6209c5692..bb6641ff0 100644 --- a/.github/workflows/ami-release-nix-single.yml +++ b/.github/workflows/ami-release-nix-single.yml @@ -46,7 +46,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL version environment variable run: | diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index 27a1c0eb1..af003c0e2 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -30,7 +30,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions @@ -65,7 +65,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Run checks if triggered manually if: ${{ github.event_name == 'workflow_dispatch' }} diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 695dc2abf..758b9fbbd 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -73,7 +73,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= post-build-hook = /etc/nix/upload-to-cache.sh - name: Install nix uses: cachix/install-nix-action@v27 @@ -82,7 +82,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Aggressive disk cleanup for DuckDB build if: matrix.runner == 'macos-latest-xlarge' run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 766e50b72..809d2c34e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: with: extra-conf: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions run: | @@ -47,7 +47,7 @@ jobs: with: extra-conf: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL version environment variable run: echo "POSTGRES_MAJOR_VERSION=${{ matrix.postgres_version }}" >> $GITHUB_ENV - name: Strip quotes from pg major and set env var diff --git a/.github/workflows/testinfra-ami-build.yml b/.github/workflows/testinfra-ami-build.yml index 0cb0cd483..c337e6e47 100644 --- a/.github/workflows/testinfra-ami-build.yml +++ b/.github/workflows/testinfra-ami-build.yml @@ -27,7 +27,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Set PostgreSQL versions id: set-versions @@ -77,7 +77,7 @@ jobs: install_url: https://releases.nixos.org/nix/nix-2.29.1/install extra_nix_config: | substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com - trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - id: args diff --git a/Dockerfile-15 b/Dockerfile-15 index 28f5122c0..3827deffb 100644 --- a/Dockerfile-15 +++ b/Dockerfile-15 @@ -56,7 +56,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/ --init none \ --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ ---extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" diff --git a/Dockerfile-17 b/Dockerfile-17 index 3ad03b37c..23989c7b9 100644 --- a/Dockerfile-17 +++ b/Dockerfile-17 @@ -58,7 +58,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/ --init none \ --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ ---extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" diff --git a/Dockerfile-orioledb-17 b/Dockerfile-orioledb-17 index 29f2fa527..1eb9400df 100644 --- a/Dockerfile-orioledb-17 +++ b/Dockerfile-orioledb-17 @@ -58,7 +58,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/ --init none \ --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ ---extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" +--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin" diff --git a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh index 71016a294..1a602efd7 100755 --- a/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh +++ b/ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh @@ -286,13 +286,13 @@ function initiate_upgrade { chmod +x "$NIX_INSTALLER_PATH" "$NIX_INSTALLER_PATH" install --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ - --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" else echo "1.1.1. Installing Nix using the official installer" curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ --extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \ - --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + --extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" fi else echo "1.1. Nix is installed; moving on." diff --git a/docker/nix/Dockerfile b/docker/nix/Dockerfile index 226907953..89e5d8178 100644 --- a/docker/nix/Dockerfile +++ b/docker/nix/Dockerfile @@ -2,7 +2,7 @@ FROM nixpkgs/nix-flakes RUN echo "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" >> /etc/nix/nix.conf -RUN echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=%" >> /etc/nix/nix.conf +RUN echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=" >> /etc/nix/nix.conf USER $USER diff --git a/ebssurrogate/scripts/qemu-bootstrap-nix.sh b/ebssurrogate/scripts/qemu-bootstrap-nix.sh index 0b21959c3..b64cf9faf 100755 --- a/ebssurrogate/scripts/qemu-bootstrap-nix.sh +++ b/ebssurrogate/scripts/qemu-bootstrap-nix.sh @@ -84,7 +84,7 @@ execute_playbook function install_nix() { sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ --extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \ - --extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root + --extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh } diff --git a/scripts/nix-provision.sh b/scripts/nix-provision.sh index 6515ecae9..f114bc6bb 100644 --- a/scripts/nix-provision.sh +++ b/scripts/nix-provision.sh @@ -25,7 +25,7 @@ function install_packages { function install_nix() { sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \ --extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \ - --extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root + --extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh } From a638c6fce0baf90b654e762eddcdac1bc8df01ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Fri, 3 Oct 2025 16:01:24 +0200 Subject: [PATCH 126/134] fix: remove git revision from postgres package This cause unnecessary rebuilds on every commit. --- nix/packages/postgres.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index bc13180d0..576e82730 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -1,12 +1,8 @@ -{ self, inputs, ... }: +{ inputs, ... }: { perSystem = { pkgs, ... }: let - gitRev = "vcs=${self.shortRev or "dirty"}+${ - builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101") - }"; - # Custom extensions that exist in our repository. These aren't upstream # either because nobody has done the work, maintaining them here is # easier and more expedient, or because they may not be suitable, or are @@ -80,7 +76,6 @@ name = "receipt"; destination = "/receipt.json"; text = builtins.toJSON { - revision = gitRev; psql-version = pgbin.version; nixpkgs = { revision = inputs.nixpkgs.rev; From fb79d3243fe0e3690ae9cee412a932a7afb9a1b3 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 15 Oct 2025 21:17:28 -0400 Subject: [PATCH 127/134] fix: incorporate v3.0.0 supautils (#1844) * fix: incorporate v3.0.0 supautils with change that checks that an event trigger function is owned by the same superuser negating the need for after-create for postgresql_fdw introduces a test in pg_regress that checks the outcome of this change * fix: add `grant usage` for postgres_fdw * test: postgres_fdw * fix: align expected output with test * chore: update versions --------- Co-authored-by: Bobbie Soedirgo --- .../postgres_fdw/after-create.sql | 22 +------------- ansible/vars.yml | 6 ++-- nix/ext/supautils.nix | 4 +-- nix/tests/expected/postgres_fdw.out | 30 +++++++++++++++++++ nix/tests/sql/postgres_fdw.sql | 30 +++++++++++++++++++ 5 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 nix/tests/expected/postgres_fdw.out create mode 100644 nix/tests/sql/postgres_fdw.sql diff --git a/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql b/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql index 1e83ee90e..ee22527b6 100644 --- a/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql +++ b/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql @@ -1,21 +1 @@ -do $$ -declare - is_super boolean; -begin - is_super = ( - select usesuper - from pg_user - where usename = 'postgres' - ); - - -- Need to be superuser to own FDWs, so we temporarily make postgres superuser. - if not is_super then - alter role postgres superuser; - end if; - - alter foreign data wrapper postgres_fdw owner to postgres; - - if not is_super then - alter role postgres nosuperuser; - end if; -end $$; +grant usage on foreign data wrapper postgres_fdw to postgres with grant option; diff --git a/ansible/vars.yml b/ansible/vars.yml index 0f77b1820..a6b0f4e2f 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.043-orioledb" - postgres17: "17.6.1.022" - postgres15: "15.14.1.022" + postgresorioledb-17: "17.5.1.044-orioledb" + postgres17: "17.6.1.023" + postgres15: "15.14.1.023" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/ext/supautils.nix b/nix/ext/supautils.nix index 75c5c029b..7ee4a41b3 100644 --- a/nix/ext/supautils.nix +++ b/nix/ext/supautils.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { pname = "supautils"; - version = "2.9.4"; + version = "3.0.0"; buildInputs = [ postgresql ]; @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { owner = "supabase"; repo = pname; rev = "refs/tags/v${version}"; - hash = "sha256-qP9fOEWXw+wY49GopTizwxSBEGS0UoseJHVBtKS/BdI="; + hash = "sha256-EKKjNZQf7HwP/MxpHoPtbEtwXk+wO241GoXVcXpDMFs="; }; installPhase = '' diff --git a/nix/tests/expected/postgres_fdw.out b/nix/tests/expected/postgres_fdw.out new file mode 100644 index 000000000..40019e95d --- /dev/null +++ b/nix/tests/expected/postgres_fdw.out @@ -0,0 +1,30 @@ +/* + +Test to verify supautils (v3.0.0+) allows non-superuser postgres role to use postgres_fdw. + +This test ensures that the supautils extension properly handles FDW usage +for the privileged postgres role without requiring temporary superuser privileges. + +This verifies the fix that eliminated the need for: +https://github.com/supabase/postgres/blob/a638c6fce0baf90b654e762eddcdac1bc8df01ee/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql (removed) + +*/ +begin; +-- Switch to the postgres role (non-superuser) to test supautils behavior +set role postgres; +-- postgres_fdw should be owned by the superuser +select fdwowner::regrole from pg_foreign_data_wrapper where fdwname = 'postgres_fdw'; + fdwowner +---------------- + supabase_admin +(1 row) + +-- Verify that `postgres` can use the FDW despite not owning it +create server s + foreign data wrapper postgres_fdw + options ( + host '127.0.0.1', + port '5432', + dbname 'postgres' + ); +rollback; diff --git a/nix/tests/sql/postgres_fdw.sql b/nix/tests/sql/postgres_fdw.sql new file mode 100644 index 000000000..9cacd7d5e --- /dev/null +++ b/nix/tests/sql/postgres_fdw.sql @@ -0,0 +1,30 @@ +/* + +Test to verify supautils (v3.0.0+) allows non-superuser postgres role to use postgres_fdw. + +This test ensures that the supautils extension properly handles FDW usage +for the privileged postgres role without requiring temporary superuser privileges. + +This verifies the fix that eliminated the need for: +https://github.com/supabase/postgres/blob/a638c6fce0baf90b654e762eddcdac1bc8df01ee/ansible/files/postgresql_extension_custom_scripts/postgres_fdw/after-create.sql (removed) + +*/ + +begin; + +-- Switch to the postgres role (non-superuser) to test supautils behavior +set role postgres; + +-- postgres_fdw should be owned by the superuser +select fdwowner::regrole from pg_foreign_data_wrapper where fdwname = 'postgres_fdw'; + +-- Verify that `postgres` can use the FDW despite not owning it +create server s + foreign data wrapper postgres_fdw + options ( + host '127.0.0.1', + port '5432', + dbname 'postgres' + ); + +rollback; From 8b687e3332e0ba9c4f7fd9ccb27f93285ac3ec48 Mon Sep 17 00:00:00 2001 From: samrose Date: Fri, 17 Oct 2025 07:23:56 -0400 Subject: [PATCH 128/134] fix: fine tune protection rules to unblock wal-g functionality (#1846) * fix: fine tune protection rules to unblock wal-g functionality * chore: bump suffix * chore: bump to release --- ansible/files/postgresql_config/postgresql.service.j2 | 5 ++--- ansible/vars.yml | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ansible/files/postgresql_config/postgresql.service.j2 b/ansible/files/postgresql_config/postgresql.service.j2 index 30bbd5f6d..efb52f18e 100644 --- a/ansible/files/postgresql_config/postgresql.service.j2 +++ b/ansible/files/postgresql_config/postgresql.service.j2 @@ -22,9 +22,8 @@ OOMScoreAdjust=-1000 EnvironmentFile=-/etc/environment.d/postgresql.env LimitNOFILE=16384 {% if supabase_internal is defined %} -ProtectHome=yes -ReadOnlyPaths=/etc /opt -InaccessiblePaths=-/var/lib/supabase -/var/lib/supabase-admin-agent -/var/lib/cloud -/var/cache/supabase-admin-agent -/opt/saltstack -/etc/salt +ReadOnlyPaths=/etc +InaccessiblePaths=/root -/var/lib/supabase -/var/lib/supabase-admin-agent -/var/cache/supabase-admin-agent -/opt/saltstack -/etc/salt {% endif %} [Install] WantedBy=multi-user.target diff --git a/ansible/vars.yml b/ansible/vars.yml index a6b0f4e2f..027e02ea8 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.044-orioledb" - postgres17: "17.6.1.023" - postgres15: "15.14.1.023" + postgresorioledb-17: "17.5.1.045-orioledb" + postgres17: "17.6.1.024" + postgres15: "15.14.1.024" # Non Postgres Extensions pgbouncer_release: 1.19.0 From a720562df727f2f763ebff9aab6b626a3a4a797b Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Fri, 17 Oct 2025 10:50:28 -0400 Subject: [PATCH 129/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1833) --- ansible/tasks/setup-pgbouncer.yml | 191 +++++++++++++++--------------- 1 file changed, 97 insertions(+), 94 deletions(-) diff --git a/ansible/tasks/setup-pgbouncer.yml b/ansible/tasks/setup-pgbouncer.yml index 4381ba24d..576061302 100644 --- a/ansible/tasks/setup-pgbouncer.yml +++ b/ansible/tasks/setup-pgbouncer.yml @@ -1,135 +1,138 @@ # PgBouncer - name: PgBouncer - download & install dependencies - apt: + ansible.builtin.apt: pkg: - build-essential - - libssl-dev - - pkg-config - libevent-dev + - libssl-dev - libsystemd-dev - update_cache: yes + - pkg-config + update_cache: true cache_valid_time: 3600 - name: PgBouncer - download latest release - get_url: - url: "https://www.pgbouncer.org/downloads/files/%7B%7B%20pgbouncer_release%20%7D%7D/pgbouncer-%7B%7B%20pgbouncer_release%20%7D%7D.tar.gz" - dest: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz + ansible.builtin.get_url: checksum: "{{ pgbouncer_release_checksum }}" + dest: "/tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz" timeout: 60 + url: "https://www.pgbouncer.org/downloads/files/%7B%7B%20pgbouncer_release%20%7D%7D/pgbouncer-%7B%7B%20pgbouncer_release%20%7D%7D.tar.gz" - name: PgBouncer - unpack archive - unarchive: - remote_src: yes - src: /tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz - dest: /tmp - become: yes + ansible.builtin.unarchive: + dest: '/tmp' + remote_src: true + src: "/tmp/pgbouncer-{{ pgbouncer_release }}.tar.gz" + become: true - name: PgBouncer - configure - shell: - cmd: "./configure --prefix=/usr/local --with-systemd" - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - become: yes - -- name: PgBouncer - build - make: - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - become: yes - -- name: PgBouncer - install - make: - chdir: /tmp/pgbouncer-{{ pgbouncer_release }} - target: install - become: yes + ansible.builtin.command: + cmd: './configure --prefix=/usr/local --with-systemd' + args: + chdir: "/tmp/pgbouncer-{{ pgbouncer_release }}" + become: true + +- name: PgBouncer - build and install + community.general.make: + chdir: "/tmp/pgbouncer-{{ pgbouncer_release }}" + target: "{{ pgbouncer_make_item }}" + become: true + loop: + - 'all' + - 'install' + loop_control: + loop_var: 'pgbouncer_make_item' - name: Create pgbouncer user - user: - name: pgbouncer - shell: /bin/false - comment: PgBouncer user - groups: postgres,ssl-cert - -- name: PgBouncer - create a directory if it does not exist - file: - path: /etc/pgbouncer - state: directory - owner: pgbouncer - group: pgbouncer - mode: '0700' - -- name: PgBouncer - create a directory if it does not exist - file: - state: directory - owner: pgbouncer - group: pgbouncer - path: '{{ item }}' - mode: '0775' + ansible.builtin.user: + comment: 'PgBouncer user' + groups: 'postgres,ssl-cert' + name: 'pgbouncer' + shell: '/usr/sbin/nolign' + state: 'present' + +- name: Create PgBouncer directories if they do not exist + ansible.builtin.file: + group: 'pgbouncer' + mode: "{{ pgbouncer_dir_item['mode'] }}" + owner: 'pgbouncer' + path: "{{ pgbouncer_dir_item['dir'] }}" + state: 'directory' + loop_control: + loop_var: 'pgbouncer_dir_item' with_items: - - '/etc/pgbouncer-custom' - -- name: create placeholder config files - file: - path: '/etc/pgbouncer-custom/{{ item }}' - state: touch - owner: pgbouncer - group: pgbouncer - mode: 0664 + - { mode: '0700', dir: '/etc/pgbouncer' } + - { mode: '0775', dir: '/etc/pgbouncer-custom' } + +- name: create PgBouncer placeholder config files + ansible.builtin.file: + group: 'pgbouncer' + mode: '0664' + owner: 'pgbouncer' + path: "/etc/pgbouncer-custom/{{ pgbouncer_config_item }}" + state: 'touch' + loop_control: + loop_var: 'pgbouncer_config_item' with_items: - - 'generated-optimizations.ini' - 'custom-overrides.ini' + - 'generated-optimizations.ini' - 'ssl-config.ini' - name: PgBouncer - adjust pgbouncer.ini - copy: - src: files/pgbouncer_config/pgbouncer.ini.j2 - dest: /etc/pgbouncer/pgbouncer.ini - owner: pgbouncer + ansible.builtin.copy: + dest: '/etc/pgbouncer/pgbouncer.ini' mode: '0700' + owner: 'pgbouncer' + src: 'files/pgbouncer_config/pgbouncer.ini.j2' -- name: PgBouncer - create a directory if it does not exist - file: - path: /etc/pgbouncer/userlist.txt - state: touch - owner: pgbouncer +- name: PgBouncer - create a userlist file if it does not exist + ansible.builtin.file: mode: '0700' + owner: 'pgbouncer' + path: '/etc/pgbouncer/userlist.txt' + state: 'touch' - name: import /etc/tmpfiles.d/pgbouncer.conf - template: - src: files/pgbouncer_config/tmpfiles.d-pgbouncer.conf.j2 - dest: /etc/tmpfiles.d/pgbouncer.conf - become: yes + ansible.builtin.template: + dest: '/etc/tmpfiles.d/pgbouncer.conf' + src: 'files/pgbouncer_config/tmpfiles.d-pgbouncer.conf.j2' + become: true - name: PgBouncer - By default allow ssl connections. - become: yes - copy: - dest: /etc/pgbouncer-custom/ssl-config.ini - content: | - client_tls_sslmode = allow + ansible.builtin.lineinfile: + line: 'client_tls_sslmode = allow' + path: '/etc/pgbouncer-custom/ssl-config.ini' + become: true - name: Grant pg_hba and pgbouncer grp perm for adminapi updates - shell: | - chmod g+w /etc/postgresql/pg_hba.conf - chmod g+w /etc/pgbouncer-custom/ssl-config.ini + ansible.builtin.file: + mode: '0664' + path: "{{ pgbouncer_group_item }}" + loop: + - /etc/pgbouncer-custom/ssl-config.ini + - /etc/postgresql/pg_hba.conf + loop_control: + loop_var: 'pgbouncer_group_item' # Add fail2ban filter - name: import jail.d/pgbouncer.conf - template: - src: files/fail2ban_config/jail-pgbouncer.conf.j2 - dest: /etc/fail2ban/jail.d/pgbouncer.conf - become: yes + ansible.builtin.template: + dest: '/etc/fail2ban/jail.d/pgbouncer.conf' + src: 'files/fail2ban_config/jail-pgbouncer.conf.j2' + become: true - name: import filter.d/pgbouncer.conf - template: - src: files/fail2ban_config/filter-pgbouncer.conf.j2 - dest: /etc/fail2ban/filter.d/pgbouncer.conf - become: yes + ansible.builtin.template: + dest: '/etc/fail2ban/filter.d/pgbouncer.conf' + src: 'files/fail2ban_config/filter-pgbouncer.conf.j2' + become: true # Add systemd file for PgBouncer -- name: PgBouncer - import postgresql.service - template: - src: files/pgbouncer_config/pgbouncer.service.j2 - dest: /etc/systemd/system/pgbouncer.service - become: yes +- name: PgBouncer - import pgbouncer.service + ansible.builtin.template: + dest: '/etc/systemd/system/pgbouncer.service' + src: 'files/pgbouncer_config/pgbouncer.service.j2' + become: true - name: PgBouncer - reload systemd - systemd: - daemon_reload: yes + ansible.builtin.systemd_service: + daemon_reload: true From d99dc84674bae03e0bf1feebc68dcfbc0cb989a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Tue, 21 Oct 2025 20:21:16 +0200 Subject: [PATCH 130/134] feat(wrappers): support more versions (#1831) * feat(wrappers): add versions 0.4.5, 0.4.6, and 0.5.0 * feat(wrappers): add versions 0.4.3, 0.4.4, 0.5.5 * feat(wrappers): add versions 0.3.0, 0.4.1, 0.4.2 * chore: add release suffix for testing * chore: bump version for release --------- Co-authored-by: Sam Rose --- ansible/vars.yml | 6 +-- nix/cargo-pgrx/versions.json | 9 +++++ nix/ext/versions.json | 78 ++++++++++++++++++++++++++++++++++++ nix/ext/wrappers/default.nix | 38 +++++++++++------- 4 files changed, 114 insertions(+), 17 deletions(-) diff --git a/ansible/vars.yml b/ansible/vars.yml index 027e02ea8..75854490d 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -10,9 +10,9 @@ postgres_major: # Full version strings for each major version postgres_release: - postgresorioledb-17: "17.5.1.045-orioledb" - postgres17: "17.6.1.024" - postgres15: "15.14.1.024" + postgresorioledb-17: "17.5.1.046-orioledb" + postgres17: "17.6.1.025" + postgres15: "15.14.1.025" # Non Postgres Extensions pgbouncer_release: 1.19.0 diff --git a/nix/cargo-pgrx/versions.json b/nix/cargo-pgrx/versions.json index 4c8d6bef5..53b2c378c 100644 --- a/nix/cargo-pgrx/versions.json +++ b/nix/cargo-pgrx/versions.json @@ -99,5 +99,14 @@ "cargoHash": "sha256-Ny7j56pwB+2eEK62X0nWfFKQy5fBz+Q1oyvecivxLkk=" } } + }, + "0.16.0": { + "hash": "sha256-emNR7fXNVD9sY/Mdno7mwpH6l/7AD28cBUsFRn9je50=", + "rust": { + "1.87.0": { + "cargoHash": "sha256-pK6OxRNubcWhohLvIJIliRtaHSIQOhQp7Q9brPygZYA=" + } + } } + } diff --git a/nix/ext/versions.json b/nix/ext/versions.json index b5c000c7e..b7d88bbd9 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -471,6 +471,74 @@ } }, "wrappers": { + "0.3.0": { + "postgresql": [ + "15" + ], + "hash": "sha256-ogpF8NJ7kW3Ut8jaKMDiKYIXnI38nfRq2mMK4rqFAIA=", + "pgrx": "0.11.3", + "rust": "1.76.0" + }, + "0.4.1": { + "postgresql": [ + "15" + ], + "hash": "sha256-AU9Y43qEMcIBVBThu+Aor1HCtfFIg+CdkzK9IxVdkzM=", + "pgrx": "0.11.3", + "rust": "1.76.0" + }, + "0.4.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-ut3IQED6ANXgabiHoEUdfSrwkuuYYSpRoeWdtBvSe64=", + "pgrx": "0.11.3", + "rust": "1.76.0" + }, + "0.4.3": { + "postgresql": [ + "15" + ], + "hash": "sha256-CkoNMoh40zbQL4V49ZNYgv3JjoNWjODtTpHn+L8DdZA=", + "pgrx": "0.12.6", + "rust": "1.80.0" + }, + "0.4.4": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-QoGFJpq8PuvMM8SS+VZd7MlNl56uFivRjs1tCtwX+oE=", + "pgrx": "0.12.6", + "rust": "1.80.0" + }, + "0.4.5": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-IgDfVFROMCHYLZ/Iqj12MsQjPPCdRoH+3oi3Ki/iaRI=", + "pgrx": "0.12.9", + "rust": "1.81.0" + }, + "0.4.6": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-hthb3qEXT1Kf4yPoq0udEbQzlyLtI5tug6sK4YAPFjU=", + "pgrx": "0.12.9", + "rust": "1.84.0" + }, + "0.5.0": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-FbRTUcpEHBa5DI6dutvBeahYM0RZVAXIzIAZWIaxvn0=", + "pgrx": "0.12.9", + "rust": "1.84.0" + }, "0.5.4": { "postgresql": [ "15", @@ -480,6 +548,16 @@ "hash": "sha256-W1RokXH4Vfj2FIuEzGEP5SzzWsv2Pbzfa816nXKnSoc=", "pgrx": "0.14.3", "rust": "1.87.0" + }, + "0.5.5": { + "postgresql": [ + "15", + "17", + "orioledb-17" + ], + "hash": "sha256-tWa1XewJbbqarwWkJPfvCIev7Fn0hLJRzYiz0vuebyA=", + "pgrx": "0.16.0", + "rust": "1.87.0" } } } diff --git a/nix/ext/wrappers/default.nix b/nix/ext/wrappers/default.nix index 606eca7e9..620f3cba4 100644 --- a/nix/ext/wrappers/default.nix +++ b/nix/ext/wrappers/default.nix @@ -83,6 +83,16 @@ let "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; } + else if builtins.compareVersions "0.5.4" version == 0 then + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-catalog-s3tables-0.5.1" = "sha256-1JkB2JExukABlbW1lZPolNQCYb9URi8xNYY3APmiGq0="; + } + else if builtins.compareVersions "0.5.5" version == 0 then + { + "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; + "iceberg-catalog-s3tables-0.6.0" = "sha256-AUK7B0wMqQZwJho91woLs8uOC4k1RdUEEN5Khw2OoqQ="; + } else { "clickhouse-rs-1.1.0-alpha.1" = "sha256-nKiGzdsAgJej8NgyVOqHaD1sZLrNF1RPfEhu2pRwZ6o="; @@ -162,19 +172,6 @@ let } ); previouslyPackagedVersions = [ - "0.5.3" - "0.5.2" - "0.5.1" - "0.5.0" - "0.4.6" - "0.4.5" - "0.4.4" - "0.4.3" - "0.4.2" - "0.4.1" - "0.4.0" - "0.3.1" - "0.3.0" "0.2.0" "0.1.19" "0.1.18" @@ -214,6 +211,7 @@ buildEnv { "/share/postgresql/extension" ]; postBuild = '' + create_control_files() { # Create main control file pointing to latest version { @@ -233,6 +231,19 @@ buildEnv { } create_migration_sql_files() { + PREVIOUS_VERSION="" + while IFS= read -r i; do + FILENAME=$(basename "$i") + DIRNAME=$(dirname "$i") + VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)" + if [[ "$PREVIOUS_VERSION" != "" ]]; then + echo "Processing $i" + MIGRATION_FILENAME="$DIRNAME/''${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}" + cp "$i" "$MIGRATION_FILENAME" + fi + PREVIOUS_VERSION="$VERSION" + done < <(find $out -name '*.sql' | sort -V) + # Create migration SQL files from previous versions to newer versions for prev_version in ${lib.concatStringsSep " " previouslyPackagedVersions}; do for curr_version in ${lib.concatStringsSep " " versions}; do @@ -252,7 +263,6 @@ buildEnv { create_lib_files create_migration_sql_files - # checks (test "$(ls -A $out/lib/${pname}*${postgresql.dlSuffix} | wc -l)" = "${ toString (numberOfVersions + numberOfPreviouslyPackagedVersions + 1) }") From 388c2da4a4095a17c35f3e598e7fb8df97aaa3d1 Mon Sep 17 00:00:00 2001 From: Douglas J Hunley Date: Wed, 22 Oct 2025 09:44:46 -0400 Subject: [PATCH 131/134] refactor(ansible): bring our ansible up to modern ansible-lint standards (#1848) --- ansible/tasks/setup-postgres.yml | 532 ++++++++++++++++--------------- 1 file changed, 269 insertions(+), 263 deletions(-) diff --git a/ansible/tasks/setup-postgres.yml b/ansible/tasks/setup-postgres.yml index 2fe302488..916116c78 100644 --- a/ansible/tasks/setup-postgres.yml +++ b/ansible/tasks/setup-postgres.yml @@ -1,230 +1,238 @@ -- name: Postgres - copy package - copy: - src: files/postgres/ - dest: /tmp/build/ - when: debpkg_mode - -- name: Postgres - add PPA - apt_repository: - repo: "deb [ trusted=yes ] file:///tmp/build ./" - state: present - when: debpkg_mode - -- name: Postgres - install commons - apt: - name: postgresql-common - install_recommends: no - when: debpkg_mode - -- name: Do not create main cluster - shell: - cmd: sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf - when: debpkg_mode - -- name: Postgres - install server - apt: - name: postgresql-{{ postgresql_major }}={{ postgresql_release }}-1.pgdg24.04+1 - install_recommends: no - when: debpkg_mode - -- name: Postgres - remove PPA - apt_repository: - repo: "deb [ trusted=yes ] file:///tmp/build ./" - state: absent - when: debpkg_mode - -- name: Postgres - cleanup package - file: - path: /tmp/build - state: absent - when: debpkg_mode - -- name: install locales - apt: - name: locales - state: present - become: yes - when: stage2_nix - -- name: configure locales - command: echo "C.UTF-8 UTF-8" > /etc/locale.gen && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen - become: yes - when: stage2_nix - -- name: locale-gen - command: sudo locale-gen - when: stage2_nix - -- name: update-locale - command: sudo update-locale - when: stage2_nix - -- name: Create symlink to /usr/lib/postgresql/bin - shell: - cmd: ln -s /usr/lib/postgresql/{{ postgresql_major }}/bin /usr/lib/postgresql/bin - when: debpkg_mode - -- name: create ssl-cert group - group: - name: ssl-cert - state: present - when: nixpkg_mode -# the old method of installing from debian creates this group, but we must create it explicitly -# for the nix built version - -- name: create postgres group - group: - name: postgres - state: present - when: nixpkg_mode - -- name: create postgres user - shell: adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres - args: - executable: /bin/bash - become: yes - when: nixpkg_mode - -- name: add postgres user to postgres group - shell: usermod -a -G ssl-cert postgres - args: - executable: /bin/bash - become: yes - when: nixpkg_mode - -- name: Create relevant directories - file: - path: '{{ item }}' - recurse: yes - state: directory - owner: postgres - group: postgres - with_items: - - '/home/postgres' - - '/var/log/postgresql' - - '/var/lib/postgresql' - when: debpkg_mode or nixpkg_mode - -- name: Allow adminapi to write custom config - file: - path: '{{ item }}' - recurse: yes - state: directory - owner: postgres - group: postgres - mode: 0775 - with_items: - - '/etc/postgresql' - - '/etc/postgresql-custom' - when: debpkg_mode or nixpkg_mode - -- name: create placeholder config files - file: - path: '/etc/postgresql-custom/{{ item }}' - state: touch - owner: postgres - group: postgres - mode: 0664 - with_items: - - 'generated-optimizations.conf' - - 'custom-overrides.conf' - when: debpkg_mode or nixpkg_mode - -# Move Postgres configuration files into /etc/postgresql -# Add postgresql.conf -- name: import postgresql.conf - template: - src: files/postgresql_config/postgresql.conf.j2 - dest: /etc/postgresql/postgresql.conf - group: postgres - when: debpkg_mode or nixpkg_mode - -# Add pg_hba.conf -- name: import pg_hba.conf - template: - src: files/postgresql_config/pg_hba.conf.j2 - dest: /etc/postgresql/pg_hba.conf - group: postgres - when: debpkg_mode or nixpkg_mode - -# Add pg_ident.conf -- name: import pg_ident.conf - template: - src: files/postgresql_config/pg_ident.conf.j2 - dest: /etc/postgresql/pg_ident.conf - group: postgres - when: debpkg_mode or nixpkg_mode - -# Add custom config for read replicas set up -- name: Move custom read-replica.conf file to /etc/postgresql-custom/read-replica.conf - template: - src: "files/postgresql_config/custom_read_replica.conf.j2" - dest: /etc/postgresql-custom/read-replica.conf - mode: 0664 - owner: postgres - group: postgres - when: debpkg_mode or nixpkg_mode +- name: Postgres - execute debpkg_mode tasks + when: + - debpkg_mode + block: + - name: Postgres - copy package + ansible.builtin.copy: + dest: '/tmp/build/' + src: 'files/postgres/' + + - name: Postgres - add PPA + ansible.builtin.apt_repository: + repo: 'deb [ trusted=yes ] file:///tmp/build ./' + state: 'present' + + - name: Postgres - install commons + ansible.builtin.apt: + install_recommends: false + name: 'postgresql-common' + + - name: Do not create main cluster + ansible.builtin.command: + cmd: sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf + + - name: Postgres - install server + ansible.builtin.apt: + install_recommends: false + name: "postgresql-{{ postgresql_major_version }}={{ postgresql_release }}-1.pgdg24.04+1" + + - name: Postgres - remove PPA + ansible.builtin.apt_repository: + repo: 'deb [ trusted=yes ] file:///tmp/build ./' + state: 'absent' + + - name: Postgres - cleanup package + ansible.builtin.file: + path: '/tmp/build' + state: 'absent' + +- name: execute stage2_nix tasks + when: + - stage2_nix + block: + - name: install locales + ansible.builtin.apt: + name: 'locales' + state: 'present' + become: true + + - name: configure locales + ansible.builtin.lineinfile: + create: true + line: "{{ locale_item }}.UTF-8 UTF-8" + path: '/etc/locale.gen' + state: 'present' + become: true + loop: + - 'C' + - 'en_US' + loop_control: + loop_var: 'locale_item' + + - name: locale-gen + ansible.builtin.command: + cmd: 'locale-gen' + become: true + + - name: update-locale + ansible.builtin.command: + cmd: 'update-locale' + become: true + +- name: execute nixpkg_mode tasks + when: + - nixpkg_mode + block: + # the old method of installing from debian creates this group, but we must create it explicitly + # for the nix built version + - name: create ssl-cert and postgres groups + ansible.builtin.group: + name: "{{ group_item }}" + state: 'present' + loop: + - 'ssl-cert' + - 'postgres' + loop_control: + loop_var: 'group_item' + + - name: create postgres user + ansible.builtin.user: + comment: 'PostgreSQL administrator' + create_home: false + group: 'postgres' + groups: 'ssl-cert' + home: '/var/lib/postgresql' + name: 'postgres' + shell: '/bin/bash' + state: 'present' + system: true + become: yes + +- name: execute (debpkg_mode or nixpkg_mode) tasks + when: + - (debpkg_mode or nixpkg_mode) + block: + - name: Create relevant directories + ansible.builtin.file: + group: 'postgres' + mode: '0750' + owner: 'postgres' + path: "{{ pg_dir_item }}" + recurse: true + state: 'directory' + loop: + - '/data/pgdata' + - '/home/postgres' + - '/var/lib/postgresql/data' + - '/var/log/postgresql' + loop_control: + loop_var: 'pg_dir_item' + + - name: Allow adminapi to write custom config + ansible.builtin.file: + group: 'postgres' + mode: '0775' + owner: 'postgres' + path: "{{ pg_config_dir_item }}" + recurse: true + state: 'directory' + loop: + - '/etc/postgresql' + - '/etc/postgresql-custom' + loop_control: + loop_var: 'pg_config_dir_item' + + - name: create placeholder config files + ansible.builtin.file: + group: 'postgres' + mode: '0664' + owner: 'postgres' + path: "/etc/postgresql-custom/{{ pg_config_item }}" + state: 'touch' + loop: + - 'custom-overrides.conf' + - 'generated-optimizations.conf' + loop_control: + loop_var: 'pg_config_item' + + - name: import postgresql.conf, pg_hba.conf, and pg_ident.conf + ansible.builtin.template: + dest: '/etc/postgresql/{{ pg_config_item }}' + group: 'postgres' + src: 'files/postgresql_config/{{ pg_config_item }}.j2' + loop: + - 'postgresql.conf' + - 'pg_hba.conf' + - 'pg_ident.conf' + loop_control: + loop_var: 'pg_config_item' + + - name: Move custom read-replica.conf file to /etc/postgresql-custom/read-replica.conf + ansible.builtin.template: + dest: '/etc/postgresql-custom/read-replica.conf' + mode: '0664' + owner: 'postgres' + group: 'postgres' + src: 'files/postgresql_config/custom_read_replica.conf.j2' # Install extensions before init - name: Install Postgres extensions - import_tasks: tasks/setup-docker.yml - when: debpkg_mode or stage2_nix + ansible.builtin.import_tasks: + file: 'tasks/setup-docker.yml' + when: + - (debpkg_mode or stage2_nix) #stage 2 postgres tasks - name: stage2 postgres tasks - import_tasks: tasks/stage2-setup-postgres.yml - when: stage2_nix + ansible.builtin.import_tasks: + file: 'tasks/stage2-setup-postgres.yml' + when: + - stage2_nix # init DB -- name: Create directory on data volume - file: - path: '{{ item }}' - recurse: yes - state: directory - owner: postgres - group: postgres - mode: 0750 - with_items: - - "/data/pgdata" - when: debpkg_mode or nixpkg_mode - -- name: Link database data_dir to data volume directory - file: - src: "/data/pgdata" - path: "/var/lib/postgresql/data" - state: link - force: yes - when: debpkg_mode or nixpkg_mode +- name: init the db when (debpkg_mode or nixpkg_mode) + when: + - (debpkg_mode or nixpkg_mode) + block: + - name: Create directory on data volume + ansible.builtin.file: + group: 'postgres' + mode: '0750' + owner: 'postgres' + path: '/data/pgdata' + recurse: true + state: 'directory' + + - name: Link database data_dir to data volume directory + ansible.builtin.file: + force: true + path: '/var/lib/postgresql/data' + src: '/data/pgdata' + state: 'link' - name: Initialize the database - become: yes - become_user: postgres - shell: /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" + become: true + become_user: 'postgres' + ansible.builtin.command: + cmd: /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" vars: ansible_command_timeout: 60 - when: debpkg_mode + when: + - debpkg_mode - name: Make sure .bashrc exists - file: - path: /var/lib/postgresql/.bashrc - state: touch - owner: postgres - group: postgres - when: nixpkg_mode + ansible.builtin.file: + group: 'postgres' + owner: 'postgres' + path: '/var/lib/postgresql/.bashrc' + state: 'touch' + when: + - nixpkg_mode - name: Check psql_version and modify supautils.conf and postgresql.conf if necessary + when: + - stage2_nix block: - name: Check if psql_version is psql_orioledb - set_fact: - is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}" + ansible.builtin.set_fact: is_psql_17: "{{ psql_version in ['psql_17'] }}" + is_psql_oriole: "{{ psql_version in ['psql_orioledb-17'] }}" - name: Initialize the database stage2_nix (non-orioledb) - become: yes - become_user: postgres - shell: source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" - args: - executable: /bin/bash + become: true + become_user: 'postgres' + ansible.builtin.command: + cmd: /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" environment: LANG: en_US.UTF-8 LANGUAGE: en_US.UTF-8 @@ -233,20 +241,15 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive vars: ansible_command_timeout: 60 - when: stage2_nix and not is_psql_oriole and not is_psql_17 + when: + - not is_psql_oriole + - not is_psql_17 - name: Initialize the database stage2_nix (orioledb) - become: yes - become_user: postgres - shell: > - source /var/lib/postgresql/.bashrc && /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb - -o "--allow-group-access" - -o "--username=supabase_admin" - -o "--locale-provider=icu" - -o "--encoding=UTF-8" - -o "--icu-locale=en_US.UTF-8" - args: - executable: /bin/bash + become: true + become_user: 'postgres' + ansible.builtin.command: + cmd: /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data initdb -o "--allow-group-access" -o "--username=supabase_admin" -o "--locale-provider=icu" -o "--encoding=UTF-8" -o "--icu-locale=en_US.UTF-8" environment: LANG: en_US.UTF-8 LANGUAGE: en_US.UTF-8 @@ -255,68 +258,71 @@ LOCALE_ARCHIVE: /usr/lib/locale/locale-archive vars: ansible_command_timeout: 60 - when: stage2_nix and (is_psql_oriole or is_psql_17) - -- name: copy PG systemd unit - template: - src: files/postgresql_config/postgresql.service.j2 - dest: /etc/systemd/system/postgresql.service - when: debpkg_mode or stage2_nix - -- name: copy optimizations systemd unit - template: - src: files/database-optimizations.service.j2 - dest: /etc/systemd/system/database-optimizations.service - when: debpkg_mode or stage2_nix + when: + - (is_psql_oriole or is_psql_17) + +- name: copy PG and optimizations systemd units + ansible.builtin.template: + dest: "/etc/systemd/system/{{ systemd_svc_item | basename }}" + src: "files/{{ systemd_svc_item }}.j2" + loop: + - 'database-optimizations.service' + - 'postgresql_config/postgresql.service' + loop_control: + loop_var: 'systemd_svc_item' + when: + - (debpkg_mode or stage2_nix) - name: initialize pg required state - become: yes - shell: | - mkdir -p /run/postgresql - chown -R postgres:postgres /run/postgresql - when: stage2_nix and qemu_mode is defined + become: true + ansible.builtin.file: + group: 'postgres' + owner: 'postgres' + path: '/run/postgresql' + state: 'directory' + when: + - stage2_nix + - qemu_mode is defined - name: Restart Postgres Database without Systemd - become: yes - become_user: postgres - shell: | - source /var/lib/postgresql/.bashrc - /usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data start + become: true + become_user: 'postgres' + ansible.builtin.command: + cmd: '/usr/lib/postgresql/bin/pg_ctl -D /var/lib/postgresql/data start' environment: LANG: en_US.UTF-8 LANGUAGE: en_US.UTF-8 LC_ALL: en_US.UTF-8 LC_CTYPE: en_US.UTF-8 LOCALE_ARCHIVE: /usr/lib/locale/locale-archive - when: stage2_nix + when: + - stage2_nix # Reload - name: System - systemd reload - systemd: - enabled: yes - name: postgresql - daemon_reload: yes - when: debpkg_mode or stage2_nix - - -- name: Add LOCALE_ARCHIVE to .bashrc - lineinfile: - dest: "/var/lib/postgresql/.bashrc" - line: 'export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive' - create: yes - become: yes - when: nixpkg_mode - -- name: Add LANG items to .bashrc - lineinfile: - dest: "/var/lib/postgresql/.bashrc" - line: "{{ item }}" + ansible.builtin.systemd_service: + daemon_reload: true + enabled: true + name: 'postgresql' + when: + - (debpkg_mode or stage2_nix) + + +- name: Add lang and locale items to .bashrc + ansible.builtin.lineinfile: + create: true + dest: '/var/lib/postgresql/.bashrc' + line: "{{ lang_item }}" + become: true loop: + - 'export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive' - 'export LANG="en_US.UTF-8"' - 'export LANGUAGE="en_US.UTF-8"' - 'export LC_ALL="en_US.UTF-8"' - 'export LANG="en_US.UTF-8"' - 'export LC_CTYPE="en_US.UTF-8"' - become: yes - when: nixpkg_mode + loop_control: + loop_var: 'lang_item' + when: + - nixpkg_mode From 9bb2878f1e8cd7300cf4808c48379a793c6bb2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Wed, 22 Oct 2025 21:18:25 +0200 Subject: [PATCH 132/134] feat: support multiple versions of the plpgsql_check extension (#1684) * feat: support multiple versions of the plpgsql_check extension Build multiple versions of the plpgsql_check extension on different PostgreSQL versions. Add test for the extensions and their upgrade on PostgreSQL 15 and 17. * tests: refactor to use the default nixos tests * fix(plpgsql-check): add missing upgrade path files between versions Generate empty SQL files for version-to-version upgrade paths to satisfy PostgreSQL extension upgrade requirements. * feat: requires switch version script due to shared_preload * fix: test with plpgsql_check extension --------- Co-authored-by: Sam Rose --- nix/ext/plpgsql-check.nix | 167 +++++++++++++++++++++++------- nix/ext/tests/plpgsql_check.nix | 175 ++++++++++++++++++++++++++++++++ nix/ext/versions.json | 17 ++++ 3 files changed, 322 insertions(+), 37 deletions(-) create mode 100644 nix/ext/tests/plpgsql_check.nix diff --git a/nix/ext/plpgsql-check.nix b/nix/ext/plpgsql-check.nix index 41312b1c7..dc4cd946e 100644 --- a/nix/ext/plpgsql-check.nix +++ b/nix/ext/plpgsql-check.nix @@ -4,49 +4,142 @@ fetchFromGitHub, postgresql, postgresqlTestHook, + buildEnv, + makeWrapper, + switch-ext-version, }: +let + pname = "plpgsql_check"; -stdenv.mkDerivation rec { - pname = "plpgsql-check"; - version = "2.7.11"; + # Load version configuration from external file + allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; - src = fetchFromGitHub { - owner = "okbob"; - repo = "plpgsql_check"; - rev = "v${version}"; - hash = "sha256-vR3MvfmUP2QEAtXFpq0NCCKck3wZPD+H3QleHtyVQJs="; - }; + # Filter versions compatible with current PostgreSQL version + supportedVersions = lib.filterAttrs ( + _: value: builtins.elem (lib.versions.major postgresql.version) value.postgresql + ) allVersions; - buildInputs = [ postgresql ]; + # Derived version information + versions = lib.naturalSort (lib.attrNames supportedVersions); + latestVersion = lib.last versions; + numberOfVersions = builtins.length versions; + packages = builtins.attrValues ( + lib.mapAttrs (name: value: build name value.hash value.revision) supportedVersions + ); - installPhase = '' - install -D -t $out/lib *${postgresql.dlSuffix} - install -D -t $out/share/postgresql/extension *.sql - install -D -t $out/share/postgresql/extension *.control - ''; + # Build function for individual versions + build = + version: hash: revision: + stdenv.mkDerivation rec { + inherit pname version; - passthru.tests.extension = stdenv.mkDerivation { - name = "plpgsql-check-test"; - dontUnpack = true; - doCheck = true; - buildInputs = [ postgresqlTestHook ]; - nativeCheckInputs = [ (postgresql.withPackages (ps: [ ps.plpgsql_check ])) ]; - postgresqlTestUserOptions = "LOGIN SUPERUSER"; - failureHook = "postgresqlStop"; - checkPhase = '' - runHook preCheck - psql -a -v ON_ERROR_STOP=1 -c "CREATE EXTENSION plpgsql_check;" - runHook postCheck - ''; - installPhase = "touch $out"; - }; + src = fetchFromGitHub { + owner = "okbob"; + repo = "plpgsql_check"; + rev = "v${revision}"; + inherit hash; + }; + + buildInputs = [ postgresql ]; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + # Install shared library with version suffix + mv ${pname}${postgresql.dlSuffix} $out/lib/${pname}-${version}${postgresql.dlSuffix} + + # Create version-specific control file + sed -e "/^default_version =/d" \ + -e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}-${version}'|" \ + ${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control + + # For the latest version, create default control file and symlink and copy SQL upgrade scripts + if [[ "${version}" == "${latestVersion}" ]]; then + cp *.sql $out/share/postgresql/extension + else + mv ./${pname}--${version}.sql $out/share/postgresql/extension/${pname}--${version}.sql + fi + ''; + + passthru.tests.extension = stdenv.mkDerivation { + name = "plpgsql-check-test"; + dontUnpack = true; + doCheck = true; + buildInputs = [ postgresqlTestHook ]; + nativeCheckInputs = [ (postgresql.withPackages (ps: [ ps.plpgsql_check ])) ]; + postgresqlTestUserOptions = "LOGIN SUPERUSER"; + failureHook = "postgresqlStop"; + checkPhase = '' + runHook preCheck + psql -a -v ON_ERROR_STOP=1 -c "CREATE EXTENSION plpgsql_check;" + runHook postCheck + ''; + installPhase = "touch $out"; + }; + + meta = with lib; { + description = "Linter tool for language PL/pgSQL"; + homepage = "https://github.com/okbob/plpgsql_check"; + changelog = "https://github.com/okbob/plpgsql_check/releases/tag/v$%7Bversion%7D"; + license = licenses.mit; + maintainers = [ maintainers.marsam ]; + inherit (postgresql.meta) platforms; + }; + }; +in +buildEnv { + name = pname; + paths = packages; + nativeBuildInputs = [ makeWrapper ]; + + pathsToLink = [ + "/lib" + "/share/postgresql/extension" + ]; + + postBuild = '' + { + echo "default_version = '${latestVersion}'" + cat $out/share/postgresql/extension/${pname}--${latestVersion}.control + } > $out/share/postgresql/extension/${pname}.control + ln -sfn ${pname}-${latestVersion}${postgresql.dlSuffix} $out/lib/${pname}${postgresql.dlSuffix} + + # Verify all expected library files are present + expectedFiles=${toString (numberOfVersions + 1)} + actualFiles=$(ls -l $out/lib/${pname}*${postgresql.dlSuffix} | wc -l) + + if [[ "$actualFiles" != "$expectedFiles" ]]; then + echo "Error: Expected $expectedFiles library files, found $actualFiles" + echo "Files found:" + ls -la $out/lib/*${postgresql.dlSuffix} || true + exit 1 + fi + + # Create empty upgrade files between consecutive versions + # plpgsql_check ships without upgrade scripts - extensions are backward-compatible + previous_version="" + for ver in ${lib.concatStringsSep " " versions}; do + if [[ -n "$previous_version" ]]; then + touch $out/share/postgresql/extension/${pname}--''${previous_version}--''${ver}.sql + fi + previous_version=$ver + done + + makeWrapper ${lib.getExe switch-ext-version} $out/bin/switch_plpgsql_check_version \ + --prefix EXT_WRAPPER : "$out" --prefix EXT_NAME : "${pname}" + ''; - meta = with lib; { - description = "Linter tool for language PL/pgSQL"; - homepage = "https://github.com/okbob/plpgsql_check"; - changelog = "https://github.com/okbob/plpgsql_check/releases/tag/v$%7Bversion%7D"; - platforms = postgresql.meta.platforms; - license = licenses.mit; - maintainers = [ maintainers.marsam ]; + passthru = { + inherit versions numberOfVersions switch-ext-version; + pname = "${pname}-all"; + hasBackgroundWorker = true; + defaultSettings = { + shared_preload_libraries = [ + "plpgsql" + "plpgsql_check" + ]; + }; + version = + "multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions); }; } diff --git a/nix/ext/tests/plpgsql_check.nix b/nix/ext/tests/plpgsql_check.nix new file mode 100644 index 000000000..5ab950df7 --- /dev/null +++ b/nix/ext/tests/plpgsql_check.nix @@ -0,0 +1,175 @@ +{ self, pkgs }: +let + pname = "plpgsql_check"; + inherit (pkgs) lib; + installedExtension = + postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; + versions = postgresqlMajorVersion: (installedExtension postgresqlMajorVersion).versions; + postgresqlWithExtension = + postgresql: + let + majorVersion = lib.versions.major postgresql.version; + pkg = pkgs.buildEnv { + name = "postgresql-${majorVersion}-${pname}"; + paths = [ + postgresql + postgresql.lib + (installedExtension majorVersion) + ]; + passthru = { + inherit (postgresql) version psqlSchema; + lib = pkg; + withPackages = _: pkg; + }; + nativeBuildInputs = [ pkgs.makeWrapper ]; + pathsToLink = [ + "/" + "/bin" + "/lib" + ]; + postBuild = '' + wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib + wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib + ''; + }; + in + pkg; + psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; + psql_17 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_17; +in +self.inputs.nixpkgs.lib.nixos.runTest { + name = pname; + hostPkgs = pkgs; + nodes.server = + { config, ... }: + { + virtualisation = { + forwardPorts = [ + { + from = "host"; + host.port = 13022; + guest.port = 22; + } + ]; + }; + services.openssh = { + enable = true; + }; + + services.postgresql = { + enable = true; + package = psql_15; + enableTCPIP = true; + initialScript = pkgs.writeText "init-postgres-with-password" '' + CREATE USER test WITH PASSWORD 'secret'; + ''; + authentication = '' + host test postgres samenet scram-sha-256 + ''; + settings = (installedExtension "15").defaultSettings or { }; + }; + + networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ]; + + specialisation.postgresql17.configuration = { + services.postgresql = { + package = lib.mkForce psql_17; + }; + + systemd.services.postgresql-migrate = { + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "postgres"; + Group = "postgres"; + StateDirectory = "postgresql"; + WorkingDirectory = "${builtins.dirOf config.services.postgresql.dataDir}"; + }; + script = + let + oldPostgresql = psql_15; + newPostgresql = psql_17; + oldDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${oldPostgresql.psqlSchema}"; + newDataDir = "${builtins.dirOf config.services.postgresql.dataDir}/${newPostgresql.psqlSchema}"; + in + '' + if [[ ! -d ${newDataDir} ]]; then + install -d -m 0700 -o postgres -g postgres "${newDataDir}" + ${newPostgresql}/bin/initdb -D "${newDataDir}" + ${newPostgresql}/bin/pg_upgrade --old-datadir "${oldDataDir}" --new-datadir "${newDataDir}" \ + --old-bindir "${oldPostgresql}/bin" --new-bindir "${newPostgresql}/bin" + else + echo "${newDataDir} already exists" + fi + ''; + }; + + systemd.services.postgresql = { + after = [ "postgresql-migrate.service" ]; + requires = [ "postgresql-migrate.service" ]; + }; + }; + }; + testScript = + { nodes, ... }: + let + pg17-configuration = "${nodes.server.system.build.toplevel}/specialisation/postgresql17"; + in + '' + from pathlib import Path + versions = { + "15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "15"))}], + "17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}], + } + extension_name = "${pname}" + support_upgrade = True + pg17_configuration = "${pg17-configuration}" + ext_has_background_worker = ${ + if (installedExtension "15") ? hasBackgroundWorker then "True" else "False" + } + sql_test_directory = Path("${../../tests}") + pg_regress_test_name = "${(installedExtension "15").pgRegressTestName or pname}" + + ${builtins.readFile ./lib.py} + + start_all() + + server.wait_for_unit("multi-user.target") + server.wait_for_unit("postgresql.service") + + test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade) + + if ext_has_background_worker: + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") + + with subtest("Check pg_regress with postgresql 15 after installing the last version"): + test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name) + + with subtest("switch to postgresql 17"): + server.succeed( + f"{pg17_configuration}/bin/switch-to-configuration test >&2" + ) + + if ext_has_background_worker: + with subtest("Test switch_${pname}_version"): + test.check_switch_extension_with_background_worker(Path("${psql_17}/lib/${pname}.so"), "17") + + with subtest("Check upgrade path with postgresql 17"): + test.check_upgrade_path("17") + + last_version = versions["17"][-1] + with subtest("Check last version of the extension after postgresql upgrade"): + test.assert_version_matches(last_version) + + with subtest("Check pg_regress with postgresql 17 after extension upgrade"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) + + with subtest("Check the install of the last version of the extension"): + test.check_install_last_version("17") + + with subtest("Check pg_regress with postgresql 17 after installing the last version"): + test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name) + ''; +} diff --git a/nix/ext/versions.json b/nix/ext/versions.json index b7d88bbd9..701acb206 100644 --- a/nix/ext/versions.json +++ b/nix/ext/versions.json @@ -382,6 +382,23 @@ "hash": "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4=" } }, + "plpgsql_check": { + "2.2": { + "postgresql": [ + "15" + ], + "hash": "sha256-8HFyIzJ1iF3K2vTlibFallvkMKjFTJ2DO64fORToD8E=", + "revision": "2.2.6" + }, + "2.7": { + "postgresql": [ + "15", + "17" + ], + "hash": "sha256-vR3MvfmUP2QEAtXFpq0NCCKck3wZPD+H3QleHtyVQJs=", + "revision": "2.7.11" + } + }, "postgis": { "3.3.2": { "postgresql": [ From 0155d5698f9596a2e82bb88234dba7a2cfea6907 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 22 Oct 2025 17:01:59 -0400 Subject: [PATCH 133/134] docs: how to update new structure (#1851) --- nix/docs/update-extension.md | 233 +++++++++++++++++++++++++++++++++-- 1 file changed, 221 insertions(+), 12 deletions(-) diff --git a/nix/docs/update-extension.md b/nix/docs/update-extension.md index 786c8c2fc..464ff2885 100644 --- a/nix/docs/update-extension.md +++ b/nix/docs/update-extension.md @@ -1,17 +1,226 @@ # Update an existing nix extension +## Overview -1. Create a branch off of `develop` -2. For instance, if we were updating https://github.com/supabase/postgres/blob/develop/nix/ext/supautils.nix we would: - 1. change the `version = "2.2.1";` to whatever our git tag release version is that we want to update to - 2. temporarily empty the `hash = "sha256-wSUEG0at00TPAoHv6+NMzuUE8mfW6fnHH0MNxvBdUiE=";` to `hash = "";` and save `supautils.nix` and `git add .` - 3. run `nix build .#psql_15/exts/supautils` or the name of the extension to update, nix will print the calculated sha256 value that you can add back the the `hash` variable, save the file again, and re-run nix build .#psql_15/exts/supautils. - 4. NOTE: This step is only necessary for `buildPgrxExtension` packages, which includes supabase-wrappers, pg_jsonschema, and pg_graphql. Otherwise you can skip this step. For our packages that are build with `buildPgrxExtension` you will need to prepend the previous version to the `previousVersions` variable before updating the version in the package (for instance if you are updating `supabase-wrappers` extension from `0.4.1` to `0.4.2` then you would prepend `0.4.1` to this line https://github.com/supabase/postgres/blob/develop/nix/ext/wrappers/default.nix#L18 ). - 5. Add any needed migrations into the `supabase/postgres` migrations directory - 6. update the version in `ansible/vars.yml` as usual - 7. You can then run the `nix flake check -L` tests locally to verify that the update of the package succeeded. - 8. Now it's ready for PR review. - 9. Once the PR is approved, if you want the change to go out in a release, update the common-nix.vars.yml file with the new version prior to merging. - +There are two types of extension package structures in our codebase: +1. **Old structure (deprecated, soon to be replaced)**: Extensions like `supautils.nix` that directly define a single version +2. **New structure (current standard)**: Extensions that load multiple versions from `nix/ext/versions.json` + +Most extensions now use the new structure, which supports multiple versions via the `versions.json` file. The instructions below cover both approaches. + +--- + +## Adding a Version to an Extension (New Structure - Recommended) + +The new structure uses `nix/ext/versions.json` to manage multiple versions of extensions. Extensions that use this structure typically load their versions dynamically using code like: + +```nix +allVersions = (builtins.fromJSON (builtins.readFile ./versions.json)).${pname}; +``` + +### For Typical Extensions (e.g., http, pg_net, pgsodium, postgis, vector) + +These extensions use `stdenv.mkDerivation` and require only basic fields in `versions.json`. + +1. **Create a branch off of `develop`** + +2. **Update `nix/ext/versions.json`** - Add a new version entry for your extension: + ```json + "extension_name": { + "x.y.z": { + "postgresql": ["15", "17"], + "hash": "" + } + } + ``` + + Fields: + - `"x.y.z"`: The version number (e.g., `"1.6.1"`) + - `"postgresql"`: List of PostgreSQL major versions this extension supports (e.g., `["15", "17"]`) + - `"hash"`: Initially set to `""` (we'll calculate this next) + - `"rev"` (optional): Some extensions use a specific git rev/tag (e.g., `"v1.6.4"`) + - `"patches"` (optional): Array of patch files if needed (e.g., `["pg_cron-1.3.1-pg15.patch"]`) + +3. **Calculate the hash** - Run a nix build to get the correct hash: + ```bash + nix build .#psql_15/exts/extension_name -L + ``` + + Nix will fail and print the correct hash. Copy it and update the `hash` field in `versions.json`. + +4. **Re-run the build** to verify: + ```bash + nix build .#psql_15/exts/extension_name -L + ``` + +5. **Add any needed migrations** into the `supabase/postgres` migrations directory + +6. **Update `ansible/vars.yml`** with the new version as usual + +7. **Run tests locally** to verify the update succeeded: + ```bash + nix flake check -L + ``` + + This will: + - Build all extension versions + - Run all test suites + - Verify package integrity + - Check for any breaking changes + +8. **Ready for PR review** + +9. **Once approved**: If you want the change in a release, update `common-nix.vars.yml` with the new version prior to merging + +### For Rust/pgrx Extensions (e.g., wrappers, pg_jsonschema, pg_graphql) + +These extensions use `mkPgrxExtension` and require additional Rust and pgrx version information. + +1. **Create a branch off of `develop`** + +2. **Update `nix/ext/versions.json`** - Add a new version entry with Rust/pgrx fields: + ```json + "extension_name": { + "x.y.z": { + "postgresql": ["15", "17"], + "hash": "", + "pgrx": "0.12.6", + "rust": "1.81.0" + } + } + ``` + + Fields: + - `"x.y.z"`: The version number + - `"postgresql"`: List of PostgreSQL major versions supported + - `"hash"`: Initially set to `""` (calculate in next step) + - `"pgrx"`: pgrx version (check the extension's Cargo.toml or use the current standard version) + - `"rust"`: Rust toolchain version (check the extension's requirements or use current standard) + +3. **Calculate the hash**: + + ```bash + nix build .#psql_15/exts/extension_name -L + ``` + + Nix build will fail and print the correct hash. Update the `hash` field in `versions.json`. + + If needed, you can access the extension name by running the command `nix flake show` + +4. **Update `previouslyPackagedVersions`** in the extension's `default.nix` file: + + For pgrx extensions, you need to add the previous version to the `previouslyPackagedVersions` list. For example, in `nix/ext/wrappers/default.nix`: + + ```nix + previouslyPackagedVersions = [ + "0.5.3" # ← Add the old version here when adding 0.5.4 + "0.5.2" + # ... other versions + ]; + ``` + + This ensures that migration paths are created for users upgrading from older versions. + +5. **Re-run the build** to verify: + ```bash + nix build .#psql_15/exts/extension_name -L + ``` + +6. **Add any needed migrations** into the `supabase/postgres` migrations directory + +7. **Update `ansible/vars.yml`** with the new version + +8. **Run full test suite**: + ```bash + nix flake check -L + ``` + + For pgrx extensions, this will also verify that migration paths work correctly. + +9. **Ready for PR review** + +10. **Once approved**: Update `common-nix.vars.yml` if releasing + +--- + +## Updating an Extension (Old Structure - Deprecated) + +**Note**: This structure is being phased out. New extensions should use the `versions.json` approach above. + +For extensions like `supautils.nix` that haven't been migrated to the new structure yet: + +1. **Create a branch off of `develop`** + +2. **Update the version** directly in the `.nix` file: + ```nix + version = "3.0.0"; # Update this + ``` + +3. **Temporarily clear the hash**: + ```nix + hash = ""; # Clear this temporarily + ``` + + Save the file and stage it: `git add .` + +4. **Calculate the hash**: + ```bash + nix build .#psql_15/exts/supautils -L + ``` + + Nix will print the calculated sha256 value. + +5. **Update the hash** with the calculated value: + ```nix + hash = "sha256-EKKjNZQf7HwP/MxpHoPtbEtwXk+wO241GoXVcXpDMFs="; + ``` + +6. **Re-run the build**: + ```bash + nix build .#psql_15/exts/supautils -L + ``` + +7. **Add migrations** as needed + +8. **Update `ansible/vars.yml`** + +9. **Run tests**: + ```bash + nix flake check -L + ``` + +10. **PR review and merge** (update `common-nix.vars.yml` if releasing) + +--- + +## Understanding `nix flake check -L` + +The `nix flake check -L` command is your primary local testing tool: + +- **`-L`**: Shows full build logs (useful for debugging failures) +- **What it checks**: + - All extension builds for all supported PostgreSQL versions + - Extension test suites + - Package structure integrity + - Migration path validity (for multi-version extensions) + - Integration tests + +**Tip**: Run this locally before creating a PR to catch issues early. + +--- + +## Troubleshooting + +**Hash mismatch errors**: Make sure you're building with an empty hash first (`hash = "";`), then copy the exact hash from the error output. + +**Build failures**: Check that: +- PostgreSQL versions in `versions.json` are correct +- For pgrx extensions: Rust and pgrx versions are compatible +- All required dependencies are listed + +**Test failures**: Run with `-L` flag to see detailed logs: +```bash +nix flake check -L 2>&1 | tee build.log +``` From 8608f3d662a2c5ba6c240e976ee4cf5997db5bf7 Mon Sep 17 00:00:00 2001 From: samrose Date: Wed, 22 Oct 2025 17:02:08 -0400 Subject: [PATCH 134/134] docs: getting started nix install or config revised (#1853) --- nix/docs/start-here.md | 116 +++++++++++++++++++++++++++++++++-------- 1 file changed, 94 insertions(+), 22 deletions(-) diff --git a/nix/docs/start-here.md b/nix/docs/start-here.md index acc315830..e5c45e4c1 100644 --- a/nix/docs/start-here.md +++ b/nix/docs/start-here.md @@ -1,21 +1,101 @@ -Let's go ahead and install Nix. To do that, we'll use the -**[nix-installer tool]** by Determinate Systems. This works on many platforms, -but most importantly it works on **aarch64 Linux** and **x86_64 Linux**. Use the -following command in your shell, **it should work on any Linux distro of your -choice**: +## Uninstall Previous Nix Installation (if applicable) -[nix-installer tool]: https://github.com/DeterminateSystems/nix-installer +If you previously installed Nix using the Determinate Systems installer, you'll need to uninstall it first: ```bash -curl \ - --proto '=https' --tlsv1.2 \ - -sSf -L https://install.determinate.systems/nix \ -| sh -s -- install +sudo /nix/nix-installer uninstall ``` +If you installed Nix using a different method, follow the appropriate uninstall procedure for that installation method before proceeding. + +## Update Existing Official Nix Installation + +If you already have the official Nix installer (not Determinate Systems) installed, you can simply update your configuration instead of reinstalling: + +### Step 1: Edit /etc/nix/nix.conf + +Add or update the following configuration in `/etc/nix/nix.conf`: + +``` +allowed-users = * +always-allow-substitutes = true +auto-optimise-store = false +build-users-group = nixbld +builders-use-substitutes = true +cores = 0 +experimental-features = nix-command flakes +max-jobs = auto +netrc-file = +require-sigs = true +substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com https://postgrest.cachix.org https://cache.nixos.org/ +trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= postgrest.cachix.org-1:icgW4R15fz1+LqvhPjt4EnX/r19AaqxiVV+1olwlZtI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= +trusted-substituters = +trusted-users = YOUR_USERNAME root +extra-sandbox-paths = +extra-substituters = +``` + +**Important**: Replace `YOUR_USERNAME` with your actual username in the `trusted-users` line. + +### Step 2: Restart the Nix Daemon + +After updating the configuration, restart the Nix daemon: + +**On macOS:** +```bash +sudo launchctl stop org.nixos.nix-daemon +sudo launchctl start org.nixos.nix-daemon +``` + +**On Linux (systemd):** +```bash +sudo systemctl restart nix-daemon +``` + +Your Nix installation is now configured with the proper build caches and should work without substituter errors. + +## Install Nix (Fresh Installation) + +We'll use the official Nix installer with a custom configuration that includes our build caches and settings. This works on many platforms, including **aarch64 Linux**, **x86_64 Linux**, and **macOS**. + +### Step 1: Create nix.conf + +First, create a file named `nix.conf` with the following content: + +``` +allowed-users = * +always-allow-substitutes = true +auto-optimise-store = false +build-users-group = nixbld +builders-use-substitutes = true +cores = 0 +experimental-features = nix-command flakes +max-jobs = auto +netrc-file = +require-sigs = true +substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com https://postgrest.cachix.org https://cache.nixos.org/ +trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= postgrest.cachix.org-1:icgW4R15fz1+LqvhPjt4EnX/r19AaqxiVV+1olwlZtI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= +trusted-substituters = +trusted-users = YOUR_USERNAME root +extra-sandbox-paths = +extra-substituters = +``` + +**Important**: Replace `YOUR_USERNAME` with your actual username in the `trusted-users` line. + +### Step 2: Install Nix 2.29.2 + +Run the following command to install Nix 2.29.2 (the version used in CI) with the custom configuration: + +```bash +curl -L https://releases.nixos.org/nix/nix-2.29.2/install | sh -s -- --daemon --yes --nix-extra-conf-file ./nix.conf +``` + +This will install Nix with our build caches pre-configured, which should eliminate substituter-related errors. + After you do this, **you must log in and log back out of your desktop -environment** to get a new login session. This is so that your shell can have -the Nix tools installed on `$PATH` and so that your user shell can see some +environment** (or restart your terminal session) to get a new login session. This is so that your shell can have +the Nix tools installed on `$PATH` and so that your user shell can see the extra settings. You should now be able to do something like the following; try running these @@ -23,7 +103,7 @@ same commands on your machine: ``` $ nix --version -nix (Nix) 2.16.1 +nix (Nix) 2.29.2 ``` ``` @@ -32,21 +112,13 @@ $ nix run nixpkgs#nix-info -- -m - host os: `Linux 5.15.90.1-microsoft-standard-WSL2, Ubuntu, 22.04.2 LTS (Jammy Jellyfish), nobuild` - multi-user?: `yes` - sandbox: `yes` - - version: `nix-env (Nix) 2.16.1` + - version: `nix-env (Nix) 2.29.2` - channels(root): `"nixpkgs"` - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs` ``` If the above worked, you're now cooking with gas! -> _**NOTE**_: While there is an upstream tool to install Nix, written in Bash, -> we use the Determinate Systems installer — which will hopefully replace the -> original — because it's faster, and takes care of several extra edge cases -> that the original one couldn't handle, and makes several changes to the -> default installed configuration to make things more user friendly. Determinate -> Systems is staffed by many long-time Nix contributors and the creator of Nix, -> and is trustworthy. - ## Do some fun stuff One of the best things about Nix that requires _very little_ knowledge of it is