steve-chavez
887948d259
fix: missing=default error msg on generated column
2023-04-27 19:27:09 -05:00
steve-chavez
3e53796120
correct missing=default with GENERATED BY column
2023-04-14 22:12:34 -05:00
Laurence Isla and GitHub
0a2b7064c7
fix: PATCH requests not recognizing embedded filters
...
- Already fixed in #2618
- Adds tests and CHANGELOG
2023-04-14 16:42:55 -05:00
steve-chavez
1b625cb77a
feat: any/all modifiers for operators
...
Only for the eq,like,ilike,gt,gte,lt,lte,match,imatch operators
2023-04-07 13:10:57 -05:00
Laurence Isla and GitHub
d3b10e7b2a
feat: Allow filtering by IS DISTINCT FROM using the isdistinct operator
2023-04-06 13:02:03 -05:00
Steve Chavez and GitHub
acf62320ef
RPC returning table alias now works for pg 11/12 ( #2737 )
...
The new LATERAL query used for calling the function, introduced on
https://github.com/PostgREST/postgrest/pull/2677 , failed on functions
that returned a domain like `CREATE DOMAIN projects_domain AS projects`.
Work around that by changing the query conditionally, by
obtaining a bool that represents the composite alias on the SchemaCache
and only do this on pg 11 and 12.
2023-04-05 15:34:41 -05:00
steve-chavez
bc1fb67df0
drop: Prefer: params=multiple-objects on RPC
...
BREAKING CHANGE
A function with a JSON array or object parameter should be used instead
2023-04-04 19:55:10 -05:00
Laurence Isla and GitHub
1aed55be68
Ignore the Range header when the method is different than GET
...
fix: bug when using Range header on PATCH/DELETE
- Fix the "message": "syntax error at or near \"RETURNING\"" error
- Fix doing a limited update/delete when an order query parameter was present
breaking: The Range header is now only considered on GET requests and is ignored for any other method
- Other methods should use the `limit/offset` query parameters for sub-ranges
- PUT requests no longer return an error when this header is present
2023-04-03 10:40:25 -05:00
steve-chavez
032f07f3f0
refactor: remove character varying casting
2023-03-29 13:17:15 -05:00
steve-chavez
7629eff51d
undefined-keys=apply-defaults to missing=default
2023-03-29 05:33:38 -05:00
steve-chavez
46fd856fc6
test: tidy inlining plan test
2023-03-29 05:33:38 -05:00
Steve Chavez and GitHub
439a96c578
feat: undefined json keys as defaults w/ Prefer:undefined-keys
2023-03-22 02:44:14 -05:00
steve-chavez
5b6421d03a
test: fix sporadic failure on PlanSpec
2023-02-28 17:30:54 -05:00
steve-chavez
0d5d209bfb
perf: use LATERAL instead of CTE for json body
...
* add pgbench test for INSERT and RPC
* use LATERAL for RPC and INSERT
* add tests for inlining
2023-02-25 15:01:06 -05:00
Laurence Isla and GitHub
60f4446fd8
Change inaccurate error codes to new ones
...
- Code for column is not found is PGRST204
- Code for timed out when acquiring connection to db is PGRST003
2023-02-09 14:57:51 -05:00
steve-chavez
be6c30a0fb
refactor: dry RPC param parsing
2023-01-18 12:26:13 -05:00
Alexander Ljungberg and GitHub
43ad6d6aa0
feat: validate ?columns mutation targets based on schema cache ( #2542 )
...
This returns an error for trying to update or insert into invalid columns, without hitting the database. This change also switches from `json_populate_recordset` for these operations `json_to_recordset` which should make no functional difference except allowing future flexibility.
2023-01-07 22:08:30 -05:00
Laurence Isla and GitHub
5a660e0cbe
Add suggestions with fuzzy text search when no relationship is found ( #2583 )
2022-12-15 18:33:15 -05:00
steve-chavez
566c6fe53f
correct bad null filter restriction
...
When embedding using the column name.
Also make related order similarly strict to avoid the same kind of issues.
2022-12-15 18:02:25 -05:00
steve-chavez
3773cce246
feat: null filters on embedded resources
2022-12-12 17:14:54 -05:00
steve-chavez
781fa592ca
refactor: delete QueryCost, instead use PlanSpec
2022-12-12 13:31:02 -05:00
steve-chavez
1065021348
refactor: add planCost and planHdr for tests
2022-12-12 13:31:02 -05:00
Laurence Isla and GitHub
aecc53d8f9
fix: clarify error messages for functions
...
Move explanation on single unnamed parameters to the error details
2022-12-09 14:34:38 -05:00
steve-chavez
a5465e20d0
correct spread embed to '...'
2022-12-05 19:38:32 -05:00
Laurence Isla and GitHub
9e567216e9
feat: hint function names/parameters on error
2022-12-01 17:17:45 -05:00
Steve Chavez and GitHub
5e9dba5292
feat: Allow embedding without selecting any column ( #2574 )
2022-11-25 18:37:57 -05:00
steve-chavez
f7009635d6
test: move failed order parsing to doctest
2022-11-24 09:03:35 -05:00
steve-chavez
e5c77385ae
test: move failed or/and parsing to doctest
2022-11-24 09:03:35 -05:00
steve-chavez
3103060f4b
test: move failed json parsing to doctest
2022-11-24 09:03:35 -05:00
steve-chavez
315b01ebf7
test: spread embed includes junction cols
2022-11-18 18:11:14 -05:00
steve-chavez
25f65065f4
test: spread embed disambiguates recursive m2m
2022-11-18 18:11:14 -05:00
steve-chavez
60c0c11c1d
test: spread embed disambiguates 2 fks on junction
2022-11-18 18:11:14 -05:00
steve-chavez
cb99270a8f
fix: bad M2M embed on RPC
2022-11-18 17:49:24 -05:00
steve-chavez
cca0b5ae66
messages: better error for related order
2022-11-16 21:26:16 -05:00
steve-chavez
2aa0e091bb
feat: add spread embeds
2022-11-16 21:26:16 -05:00
steve-chavez
78d45b4e32
feat: add related orders
2022-11-08 17:28:50 -05:00
Laurence Isla and GitHub
b8c5d212ea
fix: Fatal error when requesting limit=0 and db-max-rows is set ( #2560 )
2022-11-04 18:14:16 -05: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 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
ecf54bef43
test: Add basic doctests for pFieldName
...
Signed-off-by: Wolfgang Walther <walther@technowledgy.de >
2022-10-27 21:54:44 +02:00
steve-chavez
45e7aac218
fix: embedding computed with normal relationship
2022-10-27 13:49:53 -05: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
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
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
steve-chavez
7ace8ace49
fix: aliasing on computed rels
2022-10-19 19:49:43 -05:00
Laurence Isla and GitHub
d5e662567b
fix: add error body when Prefer: count=exact is used and offset is out of bounds
...
* Adds error body when Prefer: count=exact is used and offset is out of bounds
* Adds details to differentiate between negative limits, lower boundaries greater than upper boundaries and out of bound ranges
2022-09-15 18:39:37 -05:00
Laurence Isla and GitHub
334f500f7c
fix: make computed relationships work when the schema name has special characters
2022-09-15 11:07:57 -05:00
steve-chavez
c45e85c5a6
feat: add one to one relationship for embedding
...
BREAKING CHANGE: For the cases where one to one relationships are
detected, json objects will be returned instead of json arrays of length
1.
If you wish to override this behavior, you can use computed
relationships to return arrays again.
2022-08-18 22:36:47 -05:00