laurenceisla and GitHub
f6b3a5cc22
fix: Make OPTIONS consider view instead of triggers ( #1824 )
2021-04-23 18:12:43 -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
7f11c1a991
fix: Void functions return null instead of empty body ( #1795 )
...
* Change empty body reponse to null for scalar functions returning void or null values
* Add test for functions returning an integer with null value
Co-authored-by: Laurence Isla <lau.isla.c@gmail.com >
2021-04-08 01:45:13 +02:00
steve-chavez
498e77215a
Reread in-db config when recoverying connection
...
* Separate reading files from whole config re-read
* Only reload external file on SIGUSR2/NOTIFY
2021-03-05 19:03:15 -05:00
steve-chavez
e4516ab606
Correct db settings to use "_" instead of "-"
...
GUC settings with dashes cannot be shown with show or current_setting.
https://www.postgresql.org/message-id/flat/20210209144059.GA21360%40depesz.com
2021-03-05 19:03:15 -05:00
steve-chavez
6557f1f9c0
correct NOTIFY config reload dying on error
2021-01-22 15:56:08 -05:00
steve-chavez
125ea8f6d9
feat: allow reloading config with NOTIFY
...
Enables reloading the config by doing:
NOTIFY pgrst, 'reload config'
Adds an alias for reloading the schema cache:
NOTIFY pgrst, 'reload schema'
2021-01-19 13:49:40 -05:00
steve-chavez
9c005fc683
feat: get configuration parameters from the db
...
Allows configuring postgrest from the db by setting config parameters
on the connection role. For example:
ALTER ROLE postgrest_test_authenticator
SET pgrst.jwt-secret = "REALLYREALLYREALLYREALLYVERYSAFE"
The above wWill set the `jwt-secret` config option accordingly.
SUPERUSER privileges are required for ALTERing role settings,
so this might not work on some cloud-managed databases.
This feature is enabled by default, for disabling it you can add the
following to the config file:
db-load-guc-config = false
2021-01-19 13:49:40 -05:00
Wolfgang Walther and Wolfgang Walther
45ebaf0ad8
cov: Add comment on SCHEMA in test fixtures
2021-01-03 17:54:28 +01:00
Wolfgang Walther and Wolfgang Walther
1edbef0538
Add STABLE RPCs in test fixtures to increase coverage
2021-01-03 17:54:28 +01: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 and Wolfgang Walther
0c25f12825
fix: fix output of RPCs returning scalar values with multiple rows
...
resolves #1584
BREAKING CHANGE:
Changed output of RPCs to match return type better:
* single scalar return: value (unchanged)
* setof scalar return: array of values (new; was array of objects)
* single composite return: object (new; was array of objects)
* setof composite return: array of objects (unchanged)
* void return: nothing (new; was "null")
A single OUT column is now treated as "composite" instead of "scalar",
i.e. consistent with multiple OUT columns.
2020-12-10 19:55:42 +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
steve-chavez
787973f323
Add db-prepared-statements config
2020-11-23 19:00:50 -05:00
Wolfgang Walther and Steve Chavez
698fac8ff2
Add test to ignore functions unnamed arguments for rpc disambiguation, resolves #1638
2020-11-22 14:48:48 -05:00
Wolfgang Walther and Steve Chavez
d91f47e582
Remove executable bit on .nix and .sql file
2020-11-20 10:48:47 -05:00
Wolfgang Walther and Steve Chavez
e08bb3a197
Fix overloading of functions with unnamed arguments (specifically for prefer params=single-object)
2020-11-20 09:24:32 -05: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
Wolfgang Walther and Steve Chavez
ca7ffd0a70
Fix RPC return type handling for domains with composite base 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 Steve Chavez
4b4a622a17
fix non-variadic repeated param in variadic function
2020-10-30 10:06:53 -05:00
steve-chavez
04eaeec7fc
refactor: reorder PgVersion(95/96)Spec tests
...
* move json ops tests to JsonOperatorSpec
* move phfts operator tests to QuerySpec and RpcSpec
* add custom spec for pre-request header guc tests
2020-10-29 18:53:24 -05:00
Wolfgang Walther and Steve Chavez
302d4e15ad
Allow calling variadic functions with repeated query params or JSON array in body
2020-10-26 17:49:51 -05:00
Wolfgang Walther and Steve Chavez
06e85357c7
add tests to pass regular arrays properly to RPCs
2020-10-26 17:49:51 -05:00
Steve Chavez and GitHub
0f0d617951
Allow http status override through response.status guc ( #1541 )
...
Fixes https://github.com/PostgREST/postgrest/issues/1525
2020-06-05 13:01:36 -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
c7f78fa7fc
Add response.headers on GET/POST/PATCH/PUT/DELETE
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
75a42b77ea
Fix M2M resource embedding on RPC and mutations
2019-09-28 13:45:18 -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
Amédée d'Aboville and Steve Chávez
ee40e7e0d7
Fix long column descriptions being truncated at 63 characters in pg12 ( #1368 )
...
* Lengthen child_entities name comment to make tests check it does not get truncated at 63 chars.
* Don't cast column description to sql_identifier type (maxlen 63 chars) when introspecting schema in DbStructure.hs
2019-08-02 16:13:01 +00:00
Steve Chávez and GitHub
ea7d747107
Accept text/plain and text/html for raw output ( #1330 )
2019-06-21 11:51:54 -05:00
Steve Chávez and GitHub
1df749a7a8
Add option for overriding root spec ( #1317 )
...
* Only for pg >= 9.6
* Disallow specifying schema on root-spec
* Increase memory test upper bound
2019-06-10 13:45:50 -05:00
Robert Vollmert and Steve Chávez
30d5a81156
Test json rpc arguments
...
In particular, check buggy behavior around embedded quoted JSON
and Postgres versions, compare
https://www.postgresql.org/message-id/D6921B37-BD8E-4664-8D5F-DB3525765DCD%40vllmrt.net
This adds version-bounded tests for the handling of quoted JSON,
and a pending test that documents the assumption that Postgres >=10
intends to parse quoted JSON as a string (similar to how jsonb works
now).
2019-06-02 01:26:52 -05:00
Xavier Francisco and Steve Chávez
553531711b
Fix wrong status 404 when PATCH request didn't change anything ( #1272 )
2019-04-19 13:50:19 -05:00
steve-chavez
bdfb11001e
Fix #1264 , allow bulk RPC call
2019-04-05 19:10:00 -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
7c376d6e84
Delete unused files
2019-03-09 16:03:26 -05:00