Wolfgang Walther
8df3dfeba9
ci: Fix FreeBSD build on cirrus
2024-02-17 15:27:30 +01:00
Wolfgang Walther
8a6c8cde6d
Merge branch 'docs/v10.2' into rel-10.2
2024-02-17 13:47:20 +01:00
Wolfgang Walther
a14559647b
chore: Run postgrest-style on docs files
...
This prevents CI from failing after the merge.
2024-02-17 13:43:27 +01:00
Wolfgang Walther
33c57506b4
chore: Prepare merge of postgrest-docs into postgrest main repo
...
This avoids some merge conflicts to allow git blame to detect renames properly.
2024-02-17 13:43:27 +01:00
Wolfgang Walther and Wolfgang Walther
44dd73adcc
fix: Embedding views with partial FK references broken
...
This is a regression introduced in d2719420f4 .
Fixes #2548
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-31 18:15:06 +01:00
Wolfgang Walther and Wolfgang Walther
2c31c64325
fix: Detect all relationships when multiple view columns reference the same table column
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-28 18:12:58 +02:00
Wolfgang Walther
425ab70ec7
fix: Make UPSERT work with PostgreSQL 15
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-28 16:18:42 +02:00
Wolfgang Walther
2cce82bdd5
chore: Upgrade nixpkgs to 2022-10-28
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-28 14:27:56 +02:00
Wolfgang Walther and Wolfgang Walther
e274706088
fix: Ignore leading and trailing spaces in column names, fts languages and casts
...
Fixes #2285
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
da632ac7d3
refactor: pIdentifierChar -> pIdentifier
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
b78b096ae4
fix: Stricter query string parsing - no empty fts lang
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
bbbc308b6f
fix: Stricter query string parsing - no empty casts
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
ecf54bef43
test: Add basic doctests for pFieldName
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
8c0d187044
fix: Stricter query string parsing - no hints or join types in regular fields
...
Fixes #2362
Reference #2475
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
ae8625a7b6
fix: Stricter query string parsing - no jsonpath in embedding
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
7c7a04a27e
test: Add doctests for pFieldForest
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
2289defe4b
refactor: Use stronger typing for SelectItem parser
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
Wolfgang Walther and Wolfgang Walther
772d3c4e01
chore: Update cachix actions
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:30 +02:00
Wolfgang Walther and Wolfgang Walther
f9f572a5d2
fix: Treat non-setof computed relationships as M2O/O2M
...
Fixes #2481
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 19:50:38 +02:00
Wolfgang Walther and Wolfgang Walther
88b5966a44
nix: Remove deprecation warning for dockerTools.buildImage { contents }
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 19:29:26 +02:00
Wolfgang Walther and Wolfgang Walther
3d2880d40a
fix: Return status code 200 when PATCHing without changing rows
...
This partially reverts #1257 / #1272 / 553531711b where the 404 was introduced.
A 406 error is still returned when requesting a single object via accept header.
Returning an error when no rows are changed can be introduced through a different syntax again, see the discussion in #2164 .
Fixes #2343
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 19:28:06 +02:00
Wolfgang Walther and Wolfgang Walther
958e052de5
chore: Clean up CHANGELOG
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 17:39:04 +02:00
Wolfgang Walther and Wolfgang Walther
793acd276a
test: Non-existing config options should not break anything
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 17:39:04 +02:00
Wolfgang Walther
9be6747b66
fix: Prevent infinite recursion with self-referencing views
...
Fixes #2283
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-26 21:33:30 +02:00
Wolfgang Walther
3bee6b1e27
fix: Fix regression in openapi output with mode follow-privileges
...
This was introduced in d5b92a433a . Before
this change, the OpenApi output would have <pk/> annotations for views,
too. After this change, they got lost for mode follow-privileges, because
the pks are refined in haskell code, but the request only fetches all
the tables again, but not the view dependencies.
This fix changes follow-privileges to only fetch a list of accessible
tables, which is then used to filter the tables in the schema cache.
Fixes #2356
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-26 21:29:58 +02:00
Wolfgang Walther and Wolfgang Walther
6fe1617348
fix: Expose PKs from all tables in a view
...
Fixes a regression in d2719420f4 .
Resolves #2458
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-24 16:49:32 +02:00
Wolfgang Walther and Wolfgang Walther
2158f3d039
fix: Embed views with different column ordering correctly
...
This fixes a regression introduced in d2719420f4 .
The order of relColumns in the schema cache is now consistently matching the order of columns in foreign key definitions.
Resolves #2518
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-24 16:49:32 +02:00
Wolfgang Walther and Wolfgang Walther
ca338ae401
test: Remove unused no_pk_view from fixtures
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-24 16:49:32 +02:00
Wolfgang Walther and Wolfgang Walther
5135fea797
test: grant privileges on all test tables by default
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-24 16:49:32 +02:00
Wolfgang Walther and Steve Chavez
9d3bbc736b
nix: Add hint how to derive docker image
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-09-20 16:39:37 -05:00
Wolfgang Walther and Robert Vollmert
ff56c3adf4
nix: port openssl patch to updated nixpkgs
2022-06-13 13:25:54 +02:00
Wolfgang Walther and Wolfgang Walther
e9ef876433
Add hint on how to prevent exposing computed columns as RPCs
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-28 13:14:53 +01:00
Wolfgang Walther and Wolfgang Walther
41a4396147
fix: Remove uncallable functions from schema cache and OpenAPI output
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-08 09:08:27 +01:00
Wolfgang Walther and Wolfgang Walther
d9f7f6f509
refactor: Remove pg_catalog prefix from schema cache queries
...
Since the search path is voided at the beginning, there is no need to qualify those.
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-08 09:08:27 +01:00
Wolfgang Walther and Wolfgang Walther
bd62008e1c
fix: Remove aggregates, procedures and window functions from schema cache and OpenAPI output
...
Aggregates and Window functions can't be called as RPCs in a useful way.
Procedures are not supported right now, but might be added later.
Resolves #2101
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-05 17:48:22 +01:00
Wolfgang Walther and Wolfgang Walther
ded8981368
fix: Take PG version into account in --dump-schema
...
The PG version is only read by the Connection Worker, which is not used in the case dump-schema. Now, the pg version is read in the schema cache queries directly, avoiding this problem in all cases.
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-05 17:48:22 +01:00
Wolfgang Walther and Wolfgang Walther
52d628f1ed
fix: Return 204 No Content without Content-Type for RPCs returning VOID
...
Resolves #2001
BREAKING CHANGE: Previously, those RPCs would return "null" as a body with Content-Type: application/json.
2022-02-05 09:28:28 +01:00
Wolfgang Walther and Wolfgang Walther
6aeb5065f8
Add docs about accessing array items and fields of composite types with JSON operators.
...
Added in https://github.com/PostgREST/postgrest/pull/2145
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-04 22:31:28 +01:00
Wolfgang Walther and Wolfgang Walther
4d6909a08f
Mention computed columns can be on the extra search path.
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-04 22:31:28 +01:00
Wolfgang Walther and Wolfgang Walther
9c0db849ce
Move JSON Columns and Computed Columns sections one level up
...
Both of those are about select and filters - so do not belong into "Vertical Filtering" only.
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-04 22:31:28 +01:00
Wolfgang Walther and Wolfgang Walther
71dd891d2f
fix postgrest-serve after move to docs/ folder
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-04 22:31:28 +01:00
Wolfgang Walther
9ca9a54d21
bump version to 9.0.0.20220204
2022-02-04 08:34:51 +01:00
Wolfgang Walther
bf689565a5
fix broken link in docker hub description, resolves #2148
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-04 08:34:35 +01:00
Wolfgang Walther and Wolfgang Walther
9f1b5c0a81
feat: Support accessing array items and fields of composite types through json operators
...
This is supported in select=, in filters and in order=.
Resolves #1543
Resolves #2075
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-03 08:13:38 +01:00
Wolfgang Walther and Wolfgang Walther
87bd8e72cf
fix changelog
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-02-03 08:13:38 +01:00
Wolfgang Walther and Wolfgang Walther
8934190d43
nix: Add postgrest-release tool
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 19:52:35 +01:00
Wolfgang Walther and Wolfgang Walther
43a92d4e6b
ci: Only run linkcheck in pull requests to main branch
...
Avoids running linkcheck on back branches, where links are outdated anyway.
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 16:32:14 +01:00
Wolfgang Walther and Wolfgang Walther
e7e102bc42
ci: switch to GitHub Actions
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 16:32:14 +01:00
Wolfgang Walther
c894b543b0
bump version to 9.0.0.20220130
2022-01-30 16:15:27 +01:00
Wolfgang Walther and Wolfgang Walther
91f1580f95
Fix warning when using docker host network
...
Resolves #491
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 14:24:51 +01:00
Wolfgang Walther and Wolfgang Walther
a4db05aeba
Improve docker install examples
...
Removes the PGRST_DB_SCHEMA variable which is public by default now.
Removes the PGRST_DB_ANON_ROLE variable, because using the authenticator role or even a superuser is very bad practice.
Replaces the postgres superuser with app_user, because using a superuser to connect to postgres is very bad practice.
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 14:24:51 +01:00
Wolfgang Walther and Wolfgang Walther
a85dfe9558
chore: Move *.rst files to docs/ folder
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 13:35:55 +01:00
Wolfgang Walther and Wolfgang Walther
0ae86b7e74
Fix references to full documents instead of first section
...
Resolves #492
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-30 13:31:20 +01:00
Wolfgang Walther and Wolfgang Walther
58f76f3d6d
fix: Return 405 Method Not Allowed for unsupported verbs
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
8980b09419
refactor: Sort error types
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
927ff6f1e5
test: Split spec tests into multiple subfolders
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
8a722e2cfe
refactor: Replace elem with pattern matching to highlight missing code coverage
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
271c329677
nix: Fix postgrest-git-hooks causing merge conflicts when staging files partially
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
c63420f0e7
nix: Fix postgrest-git-hooks disable not working
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 19:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
2fe2c9104b
ci: Fix weeder not stopping CI on error
...
Removes dead code that was unnoticed
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 17:12:32 +01:00
Wolfgang Walther and Wolfgang Walther
0ea36fc039
ci: Fix windows build failing because of outdated keyring
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-01-28 17:12:32 +01:00
Wolfgang Walther and Wolfgang Walther
fc7113e52e
fix: Remove trigger functions from schema cache and OpenAPI output
...
Trigger functions can't be called directly from SQL and can't be called
via the /rpc prefix either - it makes no sense to expose them in the
OpenAPI output. And we don't need to cache them in the schema cache
either.
Best practice would be to keep the trigger functions in a non-exposed
schema anyway.
2022-01-28 16:45:36 +01:00
Wolfgang Walther and Wolfgang Walther
fae1e168a7
Fix memory tests timing out after c3ade07
2022-01-24 14:56:06 +01:00
Wolfgang Walther and Wolfgang Walther
d2791ea0e5
Sort example config alphabetically
2022-01-24 14:56:06 +01:00
Wolfgang Walther and Wolfgang Walther
f4637c64c9
Remove db-root-spec from example config file
...
We are not going to support this officially right now.
2022-01-24 14:56:06 +01:00
Wolfgang Walther and Wolfgang Walther
1b9a30cff4
Make db-uri, db-schemas and db-anon-role optional in example config file
2022-01-24 14:56:06 +01:00
Wolfgang Walther and Wolfgang Walther
5a627e76b2
format comments in example config consistently
2022-01-24 14:56:06 +01:00
Wolfgang Walther and Wolfgang Walther
0824139069
Add order of precedence for config parameters
2022-01-24 10:24:39 +01:00
Wolfgang Walther and Wolfgang Walther
5f938dbe1a
Run PostgREST with zero config. Related to https://github.com/PostgREST/postgrest/pull/2112
2022-01-24 10:24:39 +01:00
Wolfgang Walther and Wolfgang Walther
5187eadd0b
Restructure configuration reloading section
2022-01-24 10:24:39 +01:00
Wolfgang Walther
d9e016be8b
feat: Allow running postgrest without configuration
...
Resolves #1823
2022-01-22 15:59:26 +01:00
Wolfgang Walther
c3ade07ad6
feat: Make db-anon-role optional
...
Without db-anon-role, PostgREST will block any anonymous access without hitting the database.
Resolves #1689 , Ref #1823
2022-01-22 15:59:26 +01:00
Wolfgang Walther
05b5ecd23b
Reformatting of some test-cases and removal of superfluous comments.
2022-01-22 15:13:21 +01:00
Wolfgang Walther
dbbde6aae1
feat: Make db-schemas optional
...
Resolves #1769 , Ref #1823
2022-01-22 15:13:21 +01:00
Wolfgang Walther
9ed30c0ba4
feat: Make db-uri optional
...
The default is now "postgresql://" which falls back to LIBPQ environment variables.
Resolves #1991 , Ref #1823
2022-01-22 15:13:19 +01:00
Wolfgang Walther
ec09b87940
test: Make io tests use environment variables instead of config files where possible.
...
Load jwt secret from file instead of stdin in tests, because stdin is not supported when reloading the config. Resolves #2126 .
2022-01-22 15:10:25 +01:00
Wolfgang Walther and Wolfgang Walther
6b5370f145
ci: Add -with-rtsopts=-KxK option to prevent introducing space leaks
...
Resolves #387
2022-01-10 22:09:32 +01:00
Wolfgang Walther and Wolfgang Walther
a25ad42644
Align columns in postgrest.cabal
2022-01-10 22:09:32 +01:00
Wolfgang Walther and Wolfgang Walther
995215c6a5
fix: Read database configuration properly when = is present in value
...
Resolves #2120
2022-01-10 09:24:49 +01:00
Wolfgang Walther and Wolfgang Walther
4b841dba61
refactor: Reformat db-config query
2022-01-10 09:24:49 +01:00
Wolfgang Walther and Wolfgang Walther
737ad76dfd
Clarify in-database configuration example regarding IN DATABASE
2022-01-08 22:25:31 +01:00
Wolfgang Walther and Wolfgang Walther
4bd090ba13
add user to logging example
2022-01-08 11:31:41 +01:00
Wolfgang Walther and Wolfgang Walther
540ef4ad9f
Update configuration page
2022-01-08 11:29:20 +01:00
Wolfgang Walther and Wolfgang Walther
62726ddcfd
force colored output in build and linkcheck tools
2022-01-08 10:50:48 +01:00
Wolfgang Walther and Wolfgang Walther
6c382c5985
replace permanently redirected URIs
2022-01-08 10:50:48 +01:00
Wolfgang Walther and Wolfgang Walther
0187410882
remove dead link to v5 docs
2022-01-07 20:33:06 +01:00
Wolfgang Walther and Wolfgang Walther
9639cd5751
feat: Add current user to apache-style request logging.
2022-01-07 20:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
d97bf3b864
refactor: Move each Wai Middleware to a separate file
2022-01-07 20:26:33 +01:00
Wolfgang Walther and Wolfgang Walther
8b63d928ae
test: Reorganize test/ folder into one subdirectory for each test type
2022-01-07 13:10:36 +01:00
Wolfgang Walther and Wolfgang Walther
8060fe3559
Remove unused dependencies from postgrest.cabal
2022-01-07 12:07:48 +01:00
Wolfgang Walther and Wolfgang Walther
df5d9400fe
test: Make io tests use admin/ready to wait for startup
2022-01-07 12:07:09 +01:00
Wolfgang Walther
6bc965e2a0
run postgrest-style
2022-01-07 11:39:41 +01:00
Wolfgang Walther and Wolfgang Walther
e13d912a79
cov: Add coverage overlay for impossible case in corsPolicy
2022-01-05 11:01:54 +01:00
Wolfgang Walther and Wolfgang Walther
826ae7459a
refactor: simplify logger middleware
2022-01-05 11:01:54 +01:00
Wolfgang Walther and Wolfgang Walther
cde9cd4ab7
cov: Remove unreachable static icon
2022-01-05 11:01:54 +01:00
Wolfgang Walther and Wolfgang Walther
b0a0c4768d
cov: Add tests for request logging
2022-01-05 11:01:54 +01:00
Wolfgang Walther and Wolfgang Walther
cc900787de
test: Remove unused unix-socket.config file
...
Unix sockets are the default in io tests and we are testing ip connections explicitly.
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
01e65f5221
test: Improve io test perfomance
...
Local test improves performance by 15%.
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
1e9031573c
test: Move io-tests SQL fixtures to a separate file
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
81ebdff977
test: Improve log output for failing io-tests
2022-01-04 09:36:22 +01:00