3b83f536ca
Correct inner join to use proper aliases ( #1978 )
...
"_" was used for all the internal json_agg aliases. Now an alias
with "_" plus a local table name is used.
Co-authored-by: Cole Arendt <cole.arendt@outlook.com >
2021-10-18 17:34:31 -05:00
steve-chavez
ee56dd5db1
feat: filter top-level resource with embed filter
...
This is enabled by adding `!inner` to the embedded resource
/projects?select=*,clients!inner(*)&clients.id=eq.12
This behaviour can be enabled by default with the config option
db-embed-default-join='inner'
Which saves the need for specifying `!inner` on every request.
If this is enabled, the previous behavior can be restored
per request by specifying `!left` on the embedded resource.
/projects?select=*,clients!left(*)&clients.id=eq.12`
Tested on M20/02M/M2M relationships, views, RPC.
2021-10-04 13:46:32 -05:00
laurenceisla and GitHub
ed5072f4b1
fix: Detect default values for String types in OpenAPI output ( #1928 )
2021-08-27 21:59:54 -05:00
laurenceisla and GitHub
4e4548d702
feat: Include partitioned tables into the schema cache
...
Allows embedding, UPSERT, INSERT with Location response, OPTIONS request and OpenAPI support for partitioned tables
2021-08-13 15:06:56 -05:00
laurenceisla and GitHub
59e0b006a5
fix: Location header with a null PK on a view ( #1875 )
...
Regression after #1475
2021-06-18 18:09:19 -05:00
steve-chavez
082da78f4c
fix: disregard internal junction when embedding
...
Added test cases for a lone internal junction and an internal junction
exposed homonym
2021-04-21 10:28:20 -05:00
Wolfgang Walther and GitHub
2015688312
Fix spec test concurrency issue related to tx=commit on simple_pk
2020-12-29 23:58:37 +01:00
Wolfgang Walther and Wolfgang Walther
dbe3c163bd
run spec tests in parallel
...
reduces time to run postgrest-test-spec-all by 20-25%
2020-12-14 00:42:03 +01:00
Wolfgang Walther
093fd3c8f6
fix: fix embedding through views with subqueries inside function calls
...
resolves #1608
Refactors the pfkSourceColumns query to use an intermediate JSON format
for parsing. This allows much more robust extraction of source columns.
2020-12-10 19:48:05 +01:00
Wolfgang Walther and GitHub
609c9aead8
Make transaction-rollback=true the default for test-suite ( #1663 )
...
Change test-suite to use db-tx-rollback-all = true by default
2020-12-03 18:54:33 +01:00
Wolfgang Walther and Steve Chavez
b091586394
Refactor tests: renaming json table to prevent hiding of native json type
2020-11-20 09:24:32 -05:00
Gergely Mészáros and GitHub
3f690ec78f
Removing single column limit from join table M2M mapping detection. ( #1593 )
2020-11-17 18:49:02 -05:00
Wolfgang Walther and GitHub
6e04fe7454
Enable embedding through multiple layers of views recursively ( #1625 )
...
* Include hidden views from the search path. Hidden views are views in unexposed schemas that are part of a view dependency chain.
* Change allSourceColumns to only return pk and fk columns
2020-11-15 14:58:57 -05:00
Wolfgang Walther and Steve Chavez
122fea1507
Add test to insert into a view and expect location header return
2020-11-03 10:43:06 -05:00
Wolfgang Walther and GitHub
c524531784
Fix overloaded computed columns on RPC ( #1473 )
...
* fix some typos and spelling
* fix pg_source CTE name should be prefixed with pgrst_
* added tests for overloaded computed columns on patch calls
2020-04-06 14:04:55 -05:00
691bb5640d
Allow multiple schemas to be exposed in one instance ( #1450 )
...
The schema to use can be selected through the headers `Accept-Profile` for GET/HEAD and `Content-Profile` for POST/PATCH/PUT/DELETE.
This is based on the https://www.w3.org/TR/dx-prof-conneg/ttps://www.w3.org/TR/dx-prof-conneg/ spec.
Also increase all memory tests by 1M(otherwise CI fails).
Co-authored-by: Mahmoud Kassem <MKassem@gk-software.com >
Co-authored-by: Mahmoud Kassem <mahmoud_k@mail.com >
2020-03-30 14:04:20 -05:00
Steve Chavez and GitHub
0f8838623b
Fix empty headers being added on POST/PATCH/DELETE ( #1458 )
2020-03-13 11:02:38 -05:00
steve-chavez
9b1224827a
Allow overriding headers Location,Content-Type,etc
2020-01-21 12:28:05 -05:00
Steve Chavez and GitHub
663faa1f82
Allow specifying the constraint name to disambiguate an embedding ( #1430 )
...
Makes previous duck typing regex unnecessary since the FK can be renamed
to a singular name or to any other format.
* Remove embedding with duck typed column names
* Allow embedding by foreign key name
* Add junction disambiguation tests
2020-01-06 09:42:33 -05:00
YUKISHITA Yohsuke and Steve Chavez
99b13fa25f
Upsert with "Prefer: resolution=merge-duplicates" on specified columns ( #1327 ) ( #1432 )
...
Allow query param 'on_conflict=key1,key2,...' to upsert with explicit columns with unique
constraint.
2019-12-29 11:52:58 -05:00
Steve Chávez and GitHub
80f763448f
Fix unique foreign key in view ( #1395 )
2019-10-16 12:45:38 -05:00
steve-chavez
ed2bfc09a6
Allow PATCH/DELETE w/o Prefer when no SELECT privs
...
PATCH/DELETE can now be done without adding Prefer return=minimal when
the user doesn't have SELECT privileges.
* Also fix PATCH wrong HTTP status code
2019-10-08 12:41:39 -05:00
steve-chavez
94f5894d7f
Fix self join resource embedding on PATCH
2019-09-28 13:45:18 -05:00
Steve Chávez and GitHub
186381bab2
Add support for Prefer: count=planned/estimated on GET /table ( #1386 )
2019-09-18 10:13:48 -05:00
fpusch and Steve Chávez
cefbe8f07f
Add numeric and character types to OpenAPI spec ( #1259 )
...
* Add numeric and character types
* Remove decimal type mapping
It is treated as numeric by PostgreSQL so the mapping was redundant.
2019-03-29 11:09:42 -05:00
steve-chavez
1f513f24a5
Fix #1242 , embed a view having a select in a where
2019-03-09 16:03:26 -05:00
steve-chavez
673aa25082
Fix #1221 , embedding when having a self join
2019-02-04 10:22:02 -05:00
steve-chavez
6b2778749f
Add ability to quote column names on filters
2018-12-12 12:07:30 -05:00
steve-chavez
36f86827ee
Fix #1008 , Handle columns that contain spaces
2018-12-12 12:07:30 -05:00
steve-chavez
d78410473e
Add test for embedding on a view with group by
2018-12-12 12:07:30 -05:00
Steve Chávez and GitHub
501edc718d
Add db-extra-search-path config ( #1218 )
...
For adding schemas to the search_path, solves issues related to extensions created in the public schema.
2018-12-08 11:39:31 -05:00
steve-chavez
5bfb68b982
Fix #1180 , embedding on views with composite pks
...
Also add CHANGELOG entries for previous fixes.
2018-10-12 09:24:22 -05:00
steve-chavez
b1a8bd2391
Close #709 , add test for embedding a view with CTE
...
Also add test for embedding a view with subselect in FROM clause
2018-07-18 09:43:42 -05:00
steve-chavez
69a76a627f
Close #1145 , OpenAPI materialized view columns
2018-07-18 09:43:42 -05:00
steve-chavez
105671e51a
Fix #1129 , view embedding on capitalized table
...
- Now also works on camelCase fk column
2018-07-18 09:43:42 -05:00
steve-chavez
1c6ded16d1
Add improved query for allSynonyms
...
This query works with views with subselects, and it's a lot faster,
on a complex schema the previous query was taking around 8 mins,
this query takes less than half a second(403.072 ms).
Also reorder view embedding tests
2018-07-18 09:43:42 -05:00
steve-chavez
9e3454129f
Add tests for jsonb equality filtering
2018-06-19 11:17:59 -05:00
steve-chavez
30dfadec7b
Add support for getting json by array index
...
* Also support json negative array index
2018-06-19 11:17:59 -05:00
steve-chavez
37e7398a85
Fix UPSERT bug on camelCase PK column
2018-05-31 11:57:42 -05:00
steve-chavez
30cf1d100a
Add foreign tables to OpenAPI output
2018-05-07 10:14:26 -05:00
steve-chavez
32c7e32bdf
Allow embeds alias to be used in filters, fix #821
2018-04-02 11:09:45 -05:00
steve-chavez
062a5581f5
Allow specifying source column in embed, fix #1078
2018-04-02 11:09:45 -05:00
steve-chavez
349a5ae076
Fix Parent Relation when having many views( #1044 )
2018-03-17 07:53:41 -05:00
steve-chavez
ff709a65e5
Add FROM targets aliasing to avoid conflict in embeds
2018-02-21 09:23:08 -05:00
steve-chavez
6675821c64
Allow PUT method: UPSERT of a single row
2018-02-21 07:33:54 -05:00
steve-chavez
85b1dc0eb4
Add UPSERT for POST with Prefer:resoultion=merge/ignore-duplicates
2018-02-21 07:33:54 -05:00
steve-chavez
70ce1b9329
Reduce memory usage of uniform json array restriction
2018-01-27 13:55:20 -05:00
steve-chavez
516976e32f
Add memory usage tests
2018-01-10 11:43:16 -05:00
steve-chavez
85d9feeeab
Add set schema to middleware
...
Fix #828 , breaking change: computed columns now only work if they are on
the config schema.
Fix #835 , tests now not depend on the search_path of the
postgrest_test_authenticator.
2018-01-10 09:50:20 -05:00
steve-chavez
e1cab584a3
Add test for #996 embed bug when table name = column name
2017-10-09 10:45:17 -05:00