Commit Graph
4244 Commits
Author SHA1 Message Date
renovate[bot]andWolfgang Walther 2bcd336400 chore(deps): update haskell-actions/setup action to v2.9.1 2025-12-17 18:01:04 +00:00
steve-chavez 8f34afd66e nix: jwt loadtest chain commands and split rsa gen
Chaining the target generation command after the build is done ensures
that if a build takes too long, the dynamic target generation for vegeta
won't cause 401 Unauthorized errors due to already expired JWTs.

Also split the rsa materials writing to another python program for
easier maintenance.
2025-12-16 21:15:28 -05:00
steve-chavez 4cdc4c4861 nix: show build time on postgrest-with-pgrst 2025-12-16 21:15:28 -05:00
steve-chavez 050554e2bb nix: fail jwt loadtest in case of 401
Also print last unauthorized body
2025-12-16 21:15:28 -05:00
Taimoor ZaeemandSteve Chavez b3b7bd9327 docs: add link on how to start docker service
Closes #4552.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-12-16 11:34:04 -05:00
renovate[bot]andWolfgang Walther dac8a5fb86 chore(deps): update haskell-actions/setup action to v2.9.0 2025-12-15 21:01:22 +00:00
Joel JakobssonandGitHub fd6a3bdccf fix: hasSingleUnnamedParam incorrectly matching named parameters
The hasSingleUnnamedParam function was only checking the parameter type
but not whether the parameter actually had no name. This caused functions
with a single NAMED parameter (e.g., `foo(data json)`) to incorrectly
match the single-param fallback mode.

The result was a confusing PostgreSQL error 42883 "function does not exist"
instead of a clean PGRST202 error explaining that no matching function
was found.

Added ppName == mempty check so functions with named parameters don't
incorrectly match the single-param fallback.
2025-12-15 15:34:48 -05:00
renovate[bot]andWolfgang Walther 60c70c5b37 chore(deps): update korthout/backport-action action to v4.0.1 2025-12-15 20:18:02 +00:00
renovate[bot]andWolfgang Walther c9f9b93ad7 chore(deps): update github artifact actions 2025-12-13 14:36:30 +00:00
renovate[bot]andWolfgang Walther e39b91c27b chore(deps): update korthout/backport-action action to v4 2025-12-13 14:36:12 +00:00
renovate[bot]andWolfgang Walther d694ad90e0 chore(deps): update actions/cache action to v5.0.1 2025-12-13 11:31:32 +00:00
steve-chavez 99b8246d6e nix: add --method for postgrest-loadtest
Currently the `postgrest-loadtest -k jwt-*` loadtests use the OPTIONS method,
which is good for isolating the perf changes for JWT auth.

But using GET is more accurate for actual perf improvements,
since it actually hits the database.

This adds a method argument for postgrest-loadtest, so GET can be used like:

```
postgrest-loadtest -k jwt-hs --method GET
```

CI is not changed, this is mostly useful for manually checking variance.
2025-12-12 14:46:46 -05:00
steve-chavez 90bf1762ae nix: rename genTargetsHs to genTargets
Previous name wasn't accurate as RSA is used as well.
2025-12-12 14:46:46 -05:00
renovate[bot]andWolfgang Walther c9c975ce49 chore(deps): update actions/cache action to v5 2025-12-12 08:29:32 +00:00
Taimoor ZaeemandSteve Chavez 29c2aa015f refactor: create function to handle response preferences
Centralizes handling of preferences that are used to
create `Preference-Applied` header which is returned on
responses.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-12-11 17:55:45 -05:00
Taimoor ZaeemandSteve Chavez abad47ff1b add: log error when db-schemas config contain restricted schemas
We don't allow accessing schemas "pg_catalog" and "information_schema".
Instead of silently failing requests on these schemas, this now adds
logging an error on startup when these schemas are found in `db-schemas`
config.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-12-11 14:28:08 -05:00
Laurence IslaandSteve Chavez c232e97f80 chore(changelog): move incorrectly placed fixes 2025-12-10 20:00:31 -05:00
Laurence Isla ab9b00ce88 refactor: use only Lazy.ByteString to calculate the response body length 2025-12-10 14:18:19 +00:00
Laurence Isla 9200a98087 fix: add missing Content-Length to empty HTTP 201 responses
For when a preference other than return=representation is requested.
2025-12-10 14:18:19 +00:00
Laurence Isla 3b27b2220d fix: regression that truncates error message when offset is out of bounds
- Happens when offset > the number of rows and when "Prefer: count=exact" header is sent
- Regression introduced in commit 57ef998
2025-12-10 14:18:19 +00:00
renovate[bot]andWolfgang Walther 6573953ebd chore(deps): update codecov/codecov-action action to v5.5.2 2025-12-10 12:24:43 +00:00
Taimoor ZaeemandSteve Chavez 0fa2f569a7 fix: misleading logs on unsupported postgresql versions
Postgrest fails on unsupported pg versions. However before killing
the thread, it continues to print a few more log messages which
were misleading. This commit fixes this by making sure that the
no log message should be printed after the unsupported pg version
observation and kill the thread immediately.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-12-09 13:46:34 -05:00
renovate[bot]andWolfgang Walther 24a27d17d0 chore(deps): update actions/create-github-app-token action to v2.2.1 2025-12-06 11:00:06 +00:00
renovate[bot]andGitHub 1724e4551d chore(deps): update actions/checkout digest to 8e8c483 (main) (#4511) 2025-12-03 19:32:01 +00:00
renovate[bot]andWolfgang Walther 457f20f962 chore(deps): update actions/checkout action to v6.0.1 2025-12-03 19:30:42 +00:00
renovate[bot]andWolfgang Walther 70240b0d08 chore(deps): update actions/create-github-app-token action to v2.2.0 2025-12-03 19:29:54 +00:00
Taimoor ZaeemandSteve Chavez 50eec773bf test(io): fix freeport function to prevent failures
Sometimes, a healthcheck related test fails as occurred in
https://github.com/PostgREST/postgrest/actions/runs/19771357953/job/56655949002.
This happens due to freeport function accidently picking up a used port.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-29 18:17:00 -05:00
Taimoor ZaeemandSteve Chavez 35de13eebd test(io): move fixtures to fixtures/ directory
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-27 17:08:03 -05:00
Taimoor ZaeemandSteve Chavez 3baa6b0063 test(io): rename fixtures.sql to load.sql
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-27 17:08:03 -05:00
Andrei DziahelandGitHub 6d462f762e nix: override PGRST_CMD for postgrest-loadtest from env
Enables `PGRST_CMD=postgrest-profiled-run postgrest-loadtest` running
loadtest against profiled executable, which wasn't available before
2025-11-25 19:46:23 +00:00
Taimoor ZaeemandGitHub 802cce9a28 nix(shell): remove postgrest/ directory prefix when running pg (#4502)
When running postgres from nix-shell, nix creates a directory
structure like `postgrest/postgrest-with-pg-17-XXX` in the `/tmp`
directory. This commit removes the extra `postgrest/` prefix to
shorten length of absolute path length of filenames.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-25 15:54:25 +00:00
Marek BriegerandGitHub ee334cbcf8 chore: improve grammar in README.md 2025-11-25 12:20:26 +00:00
Taimoor ZaeemandSteve Chavez c561a3749c test(io): move authentication related tests to test_auth.py
The `test_io.py` module is too bloated (2100+ lines). To
logically group related tests, as a first step, this commit
separates authentication related IO tests into `test_auth.py`
module.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-21 13:21:15 -05:00
renovate[bot]andWolfgang Walther f8b56736d7 chore(deps): update actions/checkout digest to 1af3b93 2025-11-21 17:29:18 +00:00
renovate[bot]andWolfgang Walther 7bcd46b145 chore(deps): update actions/checkout action to v6 2025-11-21 17:29:09 +00:00
Taimoor ZaeemandSteve Chavez d905592115 docs: add asterisk character to reserved characters list
The `*` character is a reserved character in the postgrest
url grammar but we didn't mention it in the docs. Now added.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-20 16:20:28 -05:00
Taimoor ZaeemandSteve Chavez 4b8dec8901 docs: clarify postgrest reserved characters in url grammar
Fixes a typo in the documentation where it said that `()`
is a reserved character, when we actually meant to say that
`(` and `)` are reserved characters.

Related discussion in #4254.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-20 16:20:28 -05:00
Taimoor ZaeemandSteve Chavez 379eaec8e0 test(io): remove stale jwt cache test
Removes a test related to jwt cache which is stale
since #4084.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-19 11:17:18 -05:00
Andrei DziahelandWolfgang Walther ae2d650516 fix: hashtables <1.4.1 fail to build with GCC 15
Introduces hashtables >= 1.4.1 requirement
2025-11-18 19:26:16 +00:00
Wolfgang Walther 4a83e79923 ci/test: remove macos x86 flake check
See previous commit.
2025-11-18 11:05:23 +01:00
Wolfgang Walther eb00c1991c ci: remove macos x86 builds
The x86 GitHub runner will not be available anymore, soon.

We might be able to re-introduce this, once we can build a static
executable via Nix on darwin, too.
2025-11-18 11:01:05 +01:00
Taimoor ZaeemandWolfgang Walther 462798dc2d nix: shorten postgrest-with-postgresql-xx scripts
Renames these scripts to `postgrest-with-pg-xx`. The renaming
helps reduce the length of temporary filenames. This is needed
to ensure that socket file names remain under the maximum
allowed length of 107 chars.

Closes #4461.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-18 09:40:16 +00:00
renovate[bot]andWolfgang Walther 1efd5781f8 chore(deps): update actions/checkout action to v5.0.1 2025-11-18 09:38:41 +00:00
Taimoor ZaeemandWolfgang Walther 08c6deba12 docs: update server-host config in docker-compose example
The docker-compose example did not work with multiple containers
when PGRST_SERVER_HOST is set to `localhost`. This updates the
value to `0.0.0.0` allowing other containers to connect.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-18 09:36:37 +00:00
renovate[bot]andWolfgang Walther 531848366d chore(deps): update ubuntu:noble docker digest to c35e29c 2025-11-15 13:52:00 +00:00
Taimoor ZaeemandSteve Chavez 91abcd49e1 test(io): move resource embedding tests to test_io.py
- Adds fixtures to `test/io/fixtures.sql` to test resource
  embedding related queries.

- Moves the resource embedding related tests that no longer
  require big schema from `test_big_schema.py` to `test_io.py`.

Closes #4417.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-11 13:43:10 -05:00
Jens TroegerandSteve Chavez 770c404ebe docs: add another project to the list of Example Apps 2025-11-11 13:25:55 -05:00
Taimoor ZaeemandSteve Chavez 99217433b1 chore(cabal): remove unused haskell dependencies
This should reduce setup time for build process.

- cache: introduced in #2928, defunct since #4084
- clock: introduced in #2928, defunct since #4084
- heredoc: introduced in #714, defunct since #4390
- iproute: introduced in #3560, defunct since #4288

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-09 13:49:18 -05:00
Taimoor ZaeemandWolfgang Walther bccf7ac97a Revert "chore: remove unused haskell dependencies"
This reverts commit b6bb8382e7.
2025-11-06 08:11:44 +00:00
Taimoor ZaeemandWolfgang Walther ed8be34b20 chore: add changelog entry for v14.1
Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
2025-11-06 08:11:32 +00:00