steve-chavez
14be3fb671
feat: add pre-config function
...
Allows using the in-database configuration without SUPERUSER
2023-05-28 10:21:13 -05:00
steve-chavez
8a3686d86b
refactor: whitelist in-db config settings
2023-05-28 10:21:13 -05:00
steve-chavez
009250006e
feat: add db-pool-timeout alias
...
For db-pool-max-idletime
2023-05-22 18:34:18 -03:00
steve-chavez
38ad8c04e1
nix: withTmpDb set search_path to test
...
It gets repetitive to set the search_path every time you go in the test
db with psql.
2023-05-22 13:46:24 -03:00
steve-chavez
a867d79c42
nix: withTmpDb psql notice can't mutate the db
...
Use the postgres role instead of the authenticator on the notice
2023-05-05 20:03:09 -03:00
steve-chavez
4197d2f739
bump version to 11.0.1
2023-04-27 21:30:40 -05:00
steve-chavez
c10ba8e214
fix: skew of 30 seconds for JWT validation
2023-04-27 21:06:06 -05:00
steve-chavez
887948d259
fix: missing=default error msg on generated column
2023-04-27 19:27:09 -05:00
steve-chavez
c63786733a
fix: no schema privilege for schema cache
...
This was due to the usage of pg_get_serial_sequence
2023-04-27 19:27:09 -05:00
steve-chavez
4fe696dd96
nix: PGRST_DB_ANON_ROLE default for postgrest-run
...
Makes manually testing a feature easier
2023-04-27 19:27:09 -05:00
steve-chavez
67936b343f
test: prove that authenticator is not a superuser
2023-04-27 19:27:09 -05:00
steve-chavez
b0e395f495
nix: no SUPERUSER for connection role
...
Change :USER to :PGUSER in SQL scripts
2023-04-27 19:27:09 -05:00
steve-chavez
dd2f5511d8
bump version to 11.0.0
2023-04-16 14:22:38 -05:00
steve-chavez
49c349c846
chore: CHANGELOG to include release 10.2.0
2023-04-16 12:18:10 -05:00
steve-chavez
aaf77902f6
feat: isolation level for roles/functions
2023-04-15 18:05:04 -05:00
steve-chavez
4c555cbd5d
refactor: authRole to ByteString
2023-04-15 18:05:04 -05:00
steve-chavez
3e53796120
correct missing=default with GENERATED BY column
2023-04-14 22:12:34 -05:00
steve-chavez
ce378e6b3a
refactor: clarify Scalar type
...
It now contains the type of the scalar. This way we can discriminate the
void type in a more obvious way.
2023-04-13 18:17:43 -05:00
steve-chavez
feadf59bb3
refactor: rename Proc module to Routine
...
Assuming that functions=procedures is wrong since pg11, which introduced
real stored procedures.
2023-04-13 18:17:43 -05:00
steve-chavez
e572d1d1a2
feat: configurable role settings
2023-04-10 14:27:08 -05:00
steve-chavez
c06237cc56
fix: db settings and pg version query not prepared
2023-04-10 14:27:08 -05:00
steve-chavez
c656a870f4
bump version to 10.2.0.20230407
2023-04-07 14:02:14 -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
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
16f2849724
refactor: wrap proc logic in asJsonF
...
* add explicit logic for returning setof scalars
2023-04-04 19:55:10 -05:00
steve-chavez
d945e8c06a
refactor: remove Maybe from RetType for Proc type
2023-04-04 19:55:10 -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
Steve Chavez and GitHub
eb777cf823
Update BACKERS.md
2023-04-03 11:09:19 -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
cae1c67b00
refactor: add iPreferences to ApiRequest
...
It avoids adding a new iPrefer.. to the ApiRequest every time a
preference is added.
2023-03-09 14:40:32 -05:00
Steve Chavez and GitHub
b05ea14122
nix: add notices for postgrest-with-* commands ( #2697 )
...
For knowing where to connect and how to get logs
2023-03-07 12:42:41 -05:00
Steve Chavez and GitHub
666114f81d
refactor: remove SchemaCache from ApiRequest ( #2695 )
2023-03-06 13:22:35 -05:00
Steve Chavez and GitHub
3e99995e6a
feat: make db-root-spec stable ( #2694 )
2023-03-01 12:23:19 -05:00
steve-chavez
8213c58452
ci: pin Nix version to avoid error
...
To 2.13.3
2023-02-28 17:30:54 -05:00
steve-chavez
ee036f8397
feat: add server-trace-header config for tracing
2023-02-28 17:30:54 -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
steve-chavez
253f2bf537
ci: remove GHC 8.10.7
2023-02-25 14:19:52 -05:00
steve-chavez
2a2889020a
nix: fix PGTZ on postgrest-with-* commands
2023-02-20 17:23:11 -05:00
Steve Chavez and GitHub
6a79de67ce
fix: log to stderr on AcquisitionTimeoutUsageError ( #2667 )
...
* refactor: remove uneeded type on checkIsFatal
* dry with a logPgrstError function
2023-02-17 17:38:31 -05:00
steve-chavez
c49932d3a8
nix: UTC by default for postgrest-with-postgresql
2023-02-14 21:30:45 -05:00
steve-chavez
a1e2fe308f
bump version to 10.2.0.20230209
2023-02-09 17:18:31 -05:00
steve-chavez
a9d66d1dac
ci: fix ghcup
2023-02-09 16:46:27 -05:00
steve-chavez
f4135bb3ff
nix: correct postgrest-release pre
2023-02-09 16:46:27 -05:00
steve-chavez
d7868235d8
refactor: add getRanges func to ApiRequest
2023-02-09 16:46:27 -05:00
steve-chavez
57e32ca0a3
bump version to 10.2.0.20230203
2023-02-03 21:16:43 -05:00
steve-chavez
52ba757ebe
nix: postgrest-release bumps pre minor
2023-01-31 19:11:45 -05:00
steve-chavez
7aadaa44e8
refactor: remove Target from infoResponse
2023-01-30 00:23:24 -05:00
steve-chavez
0139cd8261
refactor: move txMode to Plan
2023-01-30 00:23:24 -05:00
steve-chavez
7874bee879
fix: NOTIFY pgrst not reoading the catalog cache
2023-01-28 10:30:29 -05:00
steve-chavez
be6c30a0fb
refactor: dry RPC param parsing
2023-01-18 12:26:13 -05:00
steve-chavez
e0df95844b
bump version to 10.1.1.20221215
2022-12-15 23:06:32 -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
d93bb95d83
bump version to 10.1.1.20221212
2022-12-12 17:34:46 -05:00
steve-chavez
3773cce246
feat: null filters on embedded resources
2022-12-12 17:14:54 -05:00
steve-chavez
52c011f896
refactor: remove Bool from readPlanToQuery
2022-12-12 17:14:54 -05:00
steve-chavez
81cd9d4b15
refactor: delete unused TestTypes
2022-12-12 13:31:02 -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
steve-chavez
a5465e20d0
correct spread embed to '...'
2022-12-05 19:38:32 -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
steve-chavez
ef42d1c87f
test: add doctest for pOrderTerm
2022-11-08 17:28:50 -05:00
steve-chavez
aaa4fbc370
bump version to 10.1.1
2022-11-08 12:51:16 -05:00
steve-chavez
3408998629
bump version to 10.1.0.20221104
2022-11-04 18:47:48 -05:00
steve-chavez
b2935ef799
bump version to 10.1.0
2022-10-28 18:09:19 -05:00
steve-chavez
0b1f8358c6
nix: postgrest-release modifies CHANGELOG
2022-10-28 17:52:58 -05:00
steve-chavez
45e7aac218
fix: embedding computed with normal relationship
2022-10-27 13:49:53 -05:00
steve-chavez
5d126bf0a3
refactor: all aliasing in addRels
2022-10-27 13:49:53 -05:00
steve-chavez
7ace8ace49
fix: aliasing on computed rels
2022-10-19 19:49:43 -05:00
steve-chavez
c8b39c6cde
refactor: aliasing logic to addRels
...
* also shorten query builder alias logic
2022-10-19 19:49:43 -05:00
steve-chavez
5f5a0c7764
refactor: simplify join conditions logic
2022-10-19 19:49:43 -05:00
steve-chavez
922da4520f
refactor: clarify ReadPlan fields
2022-10-19 19:49:43 -05:00
steve-chavez
efecf007e8
bump version to 10.0.0.20221011
2022-10-11 11:42:40 -05:00
Steve Chavez and GitHub
0fbb116dd2
add basic ARCHITECTURE.md ( #2503 )
...
* refactor: move ApiRequest a top-level module
* refactor: rename DbStructure to SchemaCache
* refactor: GucHeader inside Response
* refactor: admin app to Workers
2022-10-10 11:24:45 -05:00
steve-chavez
e4b98d51be
fix: resource embedding opens empty transaction
...
This required untangling logic from App.hs.
Building/rejecting a plan no longer consumes a pool connection.
* Added io test for failed resource embedding not consuming connection
* optionalrollback to Query.hs and Response.hs
* delete Middleware module
* remove plan logic from App.hs
* remove RequestContext
* remove pkCols logic from App.hs
* remove proc logic from App.hs
* remove config logic from handleRequest
2022-10-07 18:52:57 -05:00
steve-chavez
d37e14c4db
refactor: readTotal into ResultSet
2022-10-07 18:52:57 -05:00
steve-chavez
6398dd2b32
refactor: add plan module
...
* rename/add plan dirs
* add read plan func/data
* add call plan func/data
* add mutate plan func/data
2022-10-04 16:13:34 -05:00
steve-chavez
11385bbd9f
refactor: move binaryField to ApiRequest
2022-10-01 11:05:49 -05:00
steve-chavez
858e4405ec
refactor: getSchema in ApiRequest
2022-10-01 11:05:49 -05:00
steve-chavez
46307ca64a
refactor: getMediaType in ApiRequest
2022-10-01 11:05:49 -05:00
steve-chavez
fd67c8480c
refactor: OpenAPI as Response submodule
...
* body after dbstructure
* rename runPgLocals to setPgLocals
2022-10-01 11:05:49 -05:00
steve-chavez
f54dc2e20e
refactor: runPgLocals to Query.hs
...
* unmmiddleware runPgLocals
2022-09-26 17:28:08 -05:00
steve-chavez
e356783cc9
refactor: add Query.hs module
...
* add readQuery
* add createQuery
* update query
* single upsert query
* delete query
* invoke query
* open api query
2022-09-26 17:28:08 -05:00
steve-chavez
b5080fa2d7
refactor: untangle query logic from request logic
2022-09-26 17:28:08 -05:00
steve-chavez
8d369a2195
refactor: add Response.hs module
...
* add response updateResponse
* add singleUpsertResponse
* add delete/invoke response
* add open api response
* add info response
* remove ApiRequest from profileHeader
* contentTypeHeaders only needs ApiRequest
2022-09-25 13:53:11 -05:00
steve-chavez
92e28bd902
refactor: untangle query logic from response logic
...
* untangle failNotSingular
* untangle failsChangesOffLimits
* untangle readTotal
2022-09-25 13:53:11 -05:00
steve-chavez
c27e7be028
refactor: move guc headers/status decoding to App
2022-09-25 13:53:11 -05:00