monacoremo and Wolfgang Walther
bfbec8fa36
refactor: Carve out QueryParams module
2022-01-07 09:32:33 +01:00
steve-chavez and Wolfgang Walther
51ee072f84
fix: clarify error for failed schema cache load
2022-01-07 09:31:30 +01:00
steve-chavez and Wolfgang Walther
aa82d2e277
Consider schema cache state on the ready check
...
* empty schema cache when it fails loading so the ready check can pick
its new state
2022-01-07 09:31:30 +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
b0a0c4768d
cov: Add tests for request logging
2022-01-05 11:01:54 +01:00
steve-chavez
4a9ca9bdae
Add live endpoint to admin server
...
* refactor io tests
* add network package to windows
2022-01-04 20:12:52 -05:00
steve-chavez
65a3ae08f0
Change admin health endpoint to ready
2022-01-04 20:12:52 -05:00
steve-chavez
bba6e96fd3
Connect to main app socket on health check
2022-01-04 20:12:52 -05: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
Wolfgang Walther and Wolfgang Walther
9baad293e8
test: Refactor invalid_role_claim_key_notify_reload test to properly read all available input
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
efc7a21427
test: Refactor test-cases for admin/health endpoint
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
b9c497a3ab
test: Use .encode() end .decode default values in io-tests
...
Those default to "utf-8" anyway.
2022-01-04 09:36:22 +01:00
Wolfgang Walther and Wolfgang Walther
4f7ee6f36a
cov: Improve jwt claims test-cases
2021-12-25 13:27:53 +01:00
Wolfgang Walther and Wolfgang Walther
14f3b25022
fix: Fix wrong CORS header Authentication -> Authorization
...
Also refactors defaultCorsPolicy and corsPolicy and cleans up CORS tests
2021-12-25 13:27:53 +01:00
Wolfgang Walther and Wolfgang Walther
b99c8c897c
fix: Make recursive view parsing work with XMLTABLE + DEFAULT
2021-12-24 19:01:20 +01:00
Steve Chavez and GitHub
ac3655df1d
feat: minimal health check ( #2092 )
2021-12-23 08:00:10 -05:00
Laurence Isla and GitHub
c858d158aa
Add hint to verify table and foreign key existence on a relationship error
2021-12-20 12:11:07 -05:00
Steve Chavez and GitHub
c86e254a24
fix: is not working with upper/mixed case values ( #2081 )
2021-12-14 19:13:38 -05:00
Wolfgang Walther and Wolfgang Walther
031de4d35e
fix: Dump db-config option without quotes as it's a boolean
2021-12-11 08:12:59 +01:00
Wolfgang Walther and Remo
74f6e5225c
nix: Add weeder to postgrest-coverage
...
Removes a bit of dead code from SpecHelper.hs
2021-12-04 11:39:56 +01:00
Wolfgang Walther and Wolfgang Walther
0e20b47875
fix: Return 204 No Content without Content-Type for PUT
2021-12-01 09:19:47 +01:00
Wolfgang Walther and Wolfgang Walther
1cb00d3c62
fix: Execute deferred constraint triggers when using Prefer: tx=rollback
...
Resolves #2020
2021-11-30 15:54:12 +01:00
Wolfgang Walther and Wolfgang Walther
32ff9dfb48
nix(feat): Add postgrest-loadtest
2021-11-27 10:57:29 +01:00
steve-chavez
132ecd8d74
Correct count query when doing inner joins
2021-11-26 10:39:19 -05:00
4fb0d1279c
test: Add test to confirm ASSERT will return 500 Internal Server Error
...
Co-authored-by: Dmitry Wagin <dmitry.wagin@ya.ru >
2021-11-25 22:56:49 +01:00
Wolfgang Walther and Wolfgang Walther
a65ac9b0f6
feat: drop support for pg 9.5
2021-11-24 19:42:53 +01:00
Wolfgang Walther and Wolfgang Walther
7ed8b10776
test: Remove conditional for pgVersion95 in JsonOperatorSpec
...
pgVersion95 is the minimum already.
2021-11-24 19:42:53 +01:00
Wolfgang Walther and Remo
b7dcc63e37
nix: Simplify with_tmp_db
2021-11-24 18:06:56 +01:00
Laurence Isla and GitHub
62243852b6
feat: Improve error message for ambiguous embedding
...
- Adds a relevant hint that includes unambiguous embedding suggestions.
- Joins origin and target into one single embedding key
2021-11-23 22:23:29 -05:00
steve-chavez
1b48531369
remove the db-embed-default-join config
2021-11-23 12:32:51 -05:00
Laurence Isla and GitHub
4e07846c5d
fix: Add tests for embedding on overloaded functions with a default param
...
Resolves #1672
Was actually fixed in #1841 / 67c2ed7 , this just adds the tests to confirm it.
2021-11-19 09:00:16 +01:00
steve-chavez
bae5afbad6
feat: allow unknown on the is operator
...
Also make the IS values strict at the Parser level since IS cannot be
parametrized.
2021-11-18 17:01:58 -05:00
Laurence Isla and GitHub
91689e28f0
Remove partitions from the schema cache
...
breaking: Embedding, OpenApi and other features related to the schema cache are no longer allowed on partitions.
2021-11-18 14:12:14 -05:00
monacoremo
43c8bde8ce
refactor: Add doctests
2021-11-13 04:07:46 +01:00
Laurence Isla and GitHub
40f9a6068a
Allow overloaded functions if one has a single unnamed JSON param
...
Avoids the breaking change in #1927 : If there's a function "my_func" having a single unnamed json param and other overloaded pairs(with any number of params), PostgREST won't be able to resolve a POST request to "my_func".
2021-11-08 18:26:33 -05:00
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
laurenceisla and GitHub
627c3c34b7
feat: Make GUC names for headers, cookies and jwt claims compatible with PostgreSQL v14
...
Getting the value for a header GUC on PostgreSQL v14 is done using `current_setting('request.headers')::json->>'name-of-header'` and in a similar way for `request.cookies` and `request.jwt.claims`
PostgreSQL versions below 14 can opt in to the new JSON GUCs by setting the `db-use-legacy-gucs` config option to false (true by default)
2021-10-12 12:58:52 -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
steve-chavez
bf91187e63
Drop support for embed hints used as '.'
...
Hints used like `select=projects.client_id(*)` were already
deprecated.
'!' should be used from now on `select=projects!client_id(*)`
2021-10-04 13:46:32 -05:00
laurenceisla and GitHub
243e4f0408
test: correct limit proc results tests ( #1951 )
...
Query params where being appended using `?` instead of `&`
2021-09-16 22:03:35 -05:00
steve-chavez
72a28a145d
feat: Allow backslash escaping inside double quotes
...
Examples:
- ?col=in.("Double\"Quote")
- ?col=in.("Back\\slash")
Backslashed chars get passed as is
- ?col=in.("\a\b\c") = ?col=in.(abc)
2021-09-13 19:06:30 -05:00
steve-chavez
4a594d5e95
fix: using " and \ as values on the in filter
...
Properly escape the array literal built at the QueryBuilder
stage.
2021-09-13 19:06:30 -05:00
Wolfgang Walther and Steve Chavez
b05898d17f
fix: Return array of objects for RPCs with single-column TABLE return type
...
This is a regression after changing responses for RPCs with INOUT or OUT arguments in #1615 .
Resolves #1930 .
2021-09-02 10:13:03 -05:00
steve-chavez
d4c6abbaec
feat: RPC POST for function w/single unnamed param
...
For POST on RPC, allows:
* passing a json object without using `Prefer: params=single-object`
The function must be defined with a single unnamed json param and
`Content-Type: application/json` must be specified.
* uploading binary to a function
The function must be defined with a single unnamed bytea param and
`Content-Type: application/octet-stream` must be specified.
* uploading raw text to a function
The function must be defined with a single unnamed text param and
`Content-Type: text/plain` must be specified.
BREAKING CHANGE If there's a function "my_func" having a single
unnamed json param and other overloaded pairs(with any number of
params), PostgREST won't be able to resolve a POST request to
"my_func". For solving this, you can name the unnamed json param.
my_func(json) -> my_func(prm json)
2021-08-30 18:17:59 -05:00
steve-chavez
caaa34b5de
refactor: add CallQuery type
...
Shortens requestToCallProcQuery, which should generate SQL in a more
direct way.
2021-08-30 18:17:59 -05:00
steve-chavez
c9a60373f6
refactor: PgArg to ProcParam
...
Clarify the difference between arguments and parameters.
Parameters are part of the function definition, arguments are the values
passed to the function.
Also clarify the findProc function comments and error message.
2021-08-30 18:17:59 -05:00