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
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
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
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
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
steve-chavez
1b48531369
remove the db-embed-default-join config
2021-11-23 12:32:51 -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
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
db95bd1c37
feat: Add compatibility with connection poolers on transaction mode
...
Update the hasql-transaction library to version 1.0.1
Add hints and kill thread at configuration read when using incompatible pooling modes: statement pooling and transaction pooling with prepared statements enabled.
2021-07-15 13:39:55 -05:00
monacoremo
9568c4605a
nix: Update nixpkgs and static-haskell-nix
2021-07-15 09:41:52 +02:00
steve-chavez
f3a184af01
Correct openapi ignore mode to filter schemas
...
Also rename openapi-mode options
* follow-acl -> follow-privileges
* ignore-acl -> ignore-privileges
2021-06-27 22:48:49 -05:00
Steve Chavez and GitHub
2944cf94c7
feat: Add time to startup/worker logs ( #1872 )
...
BREAKING CHANGE
Sends startup/worker logs to stderr to differentiate them from
access logs, which go to stdout
2021-06-19 15:55:18 -05:00
steve-chavez
d3a8b5f6e1
Change db-load-guc-config to db-config
...
Make clear that in-db config is being read
2021-03-05 19:03:15 -05: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
6750a5c44d
Restrict db settings to current db and global
...
Global settings are overriden by database specific settings if they
share common ones.
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
Remo Rechkemmer and GitHub
e6973f966b
refactor: App.hs and related changes ( #1725 )
...
* Use ExceptT to avoid 'staircasing' case analysis in App.hs
* Split large function in App.hs into individual handler functions
* Adapt API of Auth.hs, OpenApi.hs etc. to simplify the use of those modules in App.hs
* Split optional rollback functionality into Middleware
* Unify SimpleError and ApiRequestError into one Error type, so it can be used across modules
2021-02-23 22:41:48 +01:00
Steve Chavez and GitHub
c93e8f9e0c
Correct hardcoded postgrest_test_authenticator ( #1743 )
...
Also remove panic from Config and correct io test not running
2021-01-25 18:38:46 -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
97d8456382
cov: Add io tests for basic cli commands and invalid config options
...
Full code coverage for Config.hs except expected overlays.
2021-01-14 16:40:29 +01:00
Wolfgang Walther and Remo Rechkemmer
568477b6af
Fix io tests not collecting coverage data when using run()
...
Before, postgrest was killed after each test and no coverage data was saved.
Now the process is terminated gracefully via SIGTERM first to allow writing the .tix file.
2020-12-30 14:51:58 +01:00
Wolfgang Walther and GitHub
c7f0d42323
Add postgrest-coverage to show and upload hpc reports to codecov
2020-12-30 13:22:25 +01:00
Remo Rechkemmer and GitHub
2425cddaed
improve io-tests
...
Tests are now run through unix socket by default allowing
parallel execution. Test setup configuration is done via
environment variables instead of config files.
2020-12-24 16:09:25 +01:00
Wolfgang Walther and Wolfgang Walther
69b459e7b6
Use environment variables for configuration in developer tooling
...
Avoid the need for configuration files for temporary database connections.
2020-12-23 19:39:40 +01:00
Wolfgang Walther and Wolfgang Walther
b7fc393e49
feat: Read config directly from environment variables
...
resolves #1624
2020-12-23 19:39:40 +01:00
monacoremo and Steve Chavez
fe09637711
catch ReadTimeout in IO tests
2020-12-17 17:05:03 -05:00
Remo Rechkemmer and GitHub
71fa87937b
Migrate io-tests from bash to pytest
...
Authored-by: monacoremo <monacoremo>
2020-12-13 16:19:26 +01:00