Commit Graph
4345 Commits
Author SHA1 Message Date
Laurence IslaandGitHub 7508230760 feat: allow to verify the PostgREST version through SQL 2023-07-03 18:31:32 -05:00
ab8ccf43a6 add domain representations (#655)
* add domain representations

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* Update docs/references/api/domain_representations.rst

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>

* add custom domain subheading and TOC

this way it can be seen at the beggining there are advantages over views
and computed fields.

* important note for scache reloading

* clarify advantages

* why not create a type?

---------

Co-authored-by: Alexander Ljungberg <aljungberg@wireload.net>
2023-07-02 14:51:47 -05:00
steve-chavez a17dd41d6b fix: Prefer: missing=default with DOMAIN defaults 2023-06-30 17:46:16 -05:00
Alexander LjungbergandSteve Chavez 0a1564ba5a feat: data representations allow custom parsing and formatting of API fields.
See PR #2523. Most notable code changes:

- Load data representation casts into schema cache.
- Data representations for reads, filters, inserts, updates, views, over joins.
- `CoercibleField` represents name references in queries where coercion may be needed.
- `ResolverContext` help facilitate field resolution during planning.
- Planner 'resolves' names in the API query and pairs them with any implicit conversions to be used in the query builder stage.
- Tests for all of the above.
- More consistent naming (TypedX -> CoercibleX).

New: unit tests for more data representation use cases; helpful as examples as well.

New: update CHANGELOG with data representations feature description.

Fixed failing idempotence test.

New: replace date formatter test with one that does something.

Fixup: inadvertent CHANGELOG change after rebase.

Cleanup: `tfName` -> `cfName` and related.

Document what IRType means.

Formatting.

New: use a subquery to interpret `IN` literals requiring data rep transformation.

- With the previous method, very long queries such as `ANY (ARRAY[test.color('000100'), test.color('CAFE12'), test.color('01E240'), ...` could be generated. Consider the case where the parser function name is 45 characters and there's a hundred literals. That's 4.5kB of SQL just for the function name alone!
- New version uses `unnest`: `ANY (SELECT test.color(unnest('{000100,CAFE12,01E240,...}'::text[]))` to produce a much shorter query.
- This is likely to be more performant and either way much more readable and debuggable in the logs.
2023-06-29 15:01:58 -05:00
steve-chavez 1a9e105227 add headings to computed fields 2023-06-28 12:12:27 -05:00
Steve Chavez 3a41d55be6 Fix inserting with defaults 2023-06-27 15:37:22 -05:00
steve-chavez d59f841d15 add request body handling 2023-06-26 17:51:21 -05:00
steve-chavez 06a3898107 nix: add HISTFILE 2023-06-26 17:51:21 -05:00
steve-chavez 078c6ec08c refactor: remove SqlFragment and use SQL.Snippet 2023-06-22 21:46:16 -05:00
Steve ChavezandGitHub 991b151b69 improve connection pool wording 2023-06-22 14:44:26 -05:00
Steve ChavezandGitHub 14de9f1dfd references: add computed fields page (#650) 2023-06-22 09:14:23 -05:00
Laurence IslaandGitHub 83cf15fb7e ci: specify GHC_VERSION for ARM build on CI config
* change cabal version from recommended to latest
2023-06-21 16:54:15 -05:00
steve-chavez 40dc46ed2e fix: compilation on Ubuntu, GHC 9.0.2 compat 2023-06-21 16:22:30 -05:00
steve-chavez d9261fa674 ci: check against GHC 9.0.2 2023-06-21 16:22:30 -05:00
JoonasandSteve Chavez 9780790cee Change example getallfilms to stable instead of immutable 2023-06-21 09:51:41 -05:00
steve-chavez 856d450775 refactor: stricter plan media type 2023-06-20 19:12:17 -05:00
Laurence IslaandGitHub c1a8661ab3 ci: Update dependabot to look for dependencies in nested folder
- Bump cachix/install-nix-action from 21 to 22

- Add actions/setup-nix to dependabot dependencies
2023-06-19 12:33:42 -05:00
dependabot[bot]andGitHub ab986b77d8 Bump cachix/install-nix-action from 21 to 22 (#648) 2023-06-19 10:22:57 -05:00
steve-chavez aa15f4782e refactor: remove MTPlanAttrs to doctest 2023-06-18 15:27:25 -05:00
steve-chavez 77cd9387d4 Revert "refactor: plan media type"
This reverts commit 3cd3a3f8c6.
2023-06-18 15:27:25 -05:00
steve-chavez 3cd3a3f8c6 refactor: plan media type 2023-06-17 23:00:32 -05:00
steve-chavez 78821a8fe7 refactor: clarify content negotiation 2023-06-16 17:36:44 -05:00
steve-chavez 5c372df487 refactor: asJsonF/asJsonSingleF Routine param 2023-06-16 17:36:44 -05:00
Laurence IslaandGitHub 772046242e Add postgrest-docs-dictcheck to CI 2023-06-14 14:55:28 -05:00
Laurence IslaandGitHub fdf85773e7 Fix jwt_secret in example 2023-06-14 14:25:54 -05:00
steve-chavez fad47324c3 fix: OPTIONS not accepting all available media 2023-06-13 22:00:21 -05:00
Laurence IslaandGitHub 396afa106e Remove old or unmaintained links from the ecosystem page 2023-06-12 19:36:06 -05:00
dependabot[bot]andGitHub 11a9849152 build(deps): bump LouisBrunner/checks-action from 1.6.0 to 1.6.1 (#2817) 2023-06-12 10:34:48 -05:00
David BaynardandGitHub 018427e2b6 Note content-type for singular objects (#639)
* Clarify vnd.pgrst.object+json is also Content-Type

The previous docs explained how the `Accept` header could be set to
`application/vnd.pgrst.object+json`. This change indicates the resulting
response `Content-Type` begins likewise.

While robust clients will correctly identify that
`application/vnd.pgrst.object+json` data are json, many others which
naively check the `Content-Type` is `application/json` will fail to
recognize what should be a valid `Content-Type`.
2023-06-09 15:23:04 -05:00
steve-chavez ee6b9c5224 pin version to 11.0.1 2023-06-07 19:56:05 -05:00
steve-chavez b1f50537e9 clarify procs intro 2023-06-07 19:56:05 -05:00
steve-chavez fb59b82c35 references: updated automatic recovery
* use bullets were possible and join paragraphs.
* add bug fixes to the unreleased page
2023-06-07 19:56:05 -05:00
steve-chavez 188461af7d references: prepared statements mention 2023-06-07 19:56:05 -05:00
steve-chavez c62d24c993 references: add dynamic pool 2023-06-07 19:56:05 -05:00
steve-chavez 1f13e43abe bump version to 11.1.0 v11.1.0 2023-06-07 19:03:31 -05:00
steve-chavez fac797c766 changelog: clarify 2781 2023-06-07 18:28:01 -05:00
steve-chavez 07cb0b582e feat: recover on pg_terminate_backend 2023-06-06 14:41:37 -05:00
steve-chavez d54a2f48de refactor: move checkIsFatal to AppState 2023-06-06 14:41:37 -05:00
steve-chavez bcce7b1c53 fix: stop retrying on "no password supplied" 2023-06-06 14:41:37 -05:00
steve-chavez 8d1961ce07 refactor: cache the isolation level 2023-06-06 14:41:37 -05:00
steve-chavez 9a19dff83e refactor: move debounceLogAcquisitionTimeout
Move it to AppState
2023-06-06 14:41:37 -05:00
paulocrandLaurence Isla e7d63a2b27 Fix boolean configuration example 2023-06-05 16:06:37 -05:00
steve-chavez a7ff2294ac references: move raise error to errors page 2023-06-03 00:20:21 -05:00
steve-chavez 54b9a0b8b3 test: fix hello function for pg 9.6 2023-06-02 17:45:25 -05:00
steve-chavez 9a3d453bf4 test: remove big_schema.sql from io tests
It was unused(test skipped) and made the scache reload slower, causing
test failure on CI.
2023-06-02 17:45:25 -05:00
steve-chavez 4f6c466031 nix: postgrest-run uses similar config to tests
Otherwise manual tests can be deceiving
2023-06-02 17:45:25 -05:00
Steve ChavezandGitHub a852b766eb Fix dropping schema cache reload notifications
* test: bad schema reload
* refactor: DRY using the "extra" lib
* refactor: move worker funtions inside AppState
* Also rename Workers.hs to Admin.hs
2023-06-02 12:22:17 -05:00
Laurence IslaandGitHub 48365188ad Add redirect to many-to-many relationships from embedding through join tables 2023-05-31 12:33:08 -05:00
dependabot[bot]andSteve Chavez d87d80108a Bump cachix/install-nix-action from 20 to 21
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 20 to 21.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-29 09:56:01 -05:00
steve-chavez d59e2498be add pre-config function 2023-05-28 10:23:37 -05:00