Rename master branch to main; replace whiteList with isAllowed
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
codecov:
|
codecov:
|
||||||
branch: master
|
branch: main
|
||||||
require_ci_to_pass: false
|
require_ci_to_pass: false
|
||||||
|
|
||||||
comment: false
|
comment: false
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--
|
<!--
|
||||||
When submitting a new feature or fix:
|
When submitting a new feature or fix:
|
||||||
|
|
||||||
- Add a new entry to the CHANGELOG - https://github.com/PostgREST/postgrest/blob/master/CHANGELOG.md#unreleased
|
- Add a new entry to the CHANGELOG - https://github.com/PostgREST/postgrest/blob/main/CHANGELOG.md#unreleased
|
||||||
- If relevant, update the docs - https://github.com/PostgREST/postgrest-docs
|
- If relevant, update the docs - https://github.com/PostgREST/postgrest-docs
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
[](https://gitter.im/begriffs/postgrest)
|
[](https://gitter.im/begriffs/postgrest)
|
||||||
[](http://postgrest.org)
|
[](http://postgrest.org)
|
||||||
[](https://hub.docker.com/r/postgrest/postgrest/)
|
[](https://hub.docker.com/r/postgrest/postgrest/)
|
||||||
[](https://circleci.com/gh/PostgREST/postgrest/tree/master)
|
[](https://circleci.com/gh/PostgREST/postgrest/tree/main)
|
||||||
[](https://app.codecov.io/gh/PostgREST/postgrest)
|
[](https://app.codecov.io/gh/PostgREST/postgrest)
|
||||||
[](http://hackage.haskell.org/package/postgrest)
|
[](http://hackage.haskell.org/package/postgrest)
|
||||||
|
|
||||||
PostgREST serves a fully RESTful API from any existing PostgreSQL
|
PostgREST serves a fully RESTful API from any existing PostgreSQL
|
||||||
@@ -151,8 +151,8 @@ Every donation will be spent on making PostgREST better for the whole community.
|
|||||||
|
|
||||||
The PostgREST organization is grateful to:
|
The PostgREST organization is grateful to:
|
||||||
|
|
||||||
- The project [sponsors and backers](https://github.com/PostgREST/postgrest/blob/master/BACKERS.md) who support PostgREST's development.
|
- The project [sponsors and backers](https://github.com/PostgREST/postgrest/blob/main/BACKERS.md) who support PostgREST's development.
|
||||||
- The project [contributors](https://github.com/PostgREST/postgrest/graphs/contributors) who have improved PostgREST immensely with their code
|
- The project [contributors](https://github.com/PostgREST/postgrest/graphs/contributors) who have improved PostgREST immensely with their code
|
||||||
and good judgement. See more details in the [changelog](https://github.com/PostgREST/postgrest/blob/master/CHANGELOG.md).
|
and good judgement. See more details in the [changelog](https://github.com/PostgREST/postgrest/blob/main/CHANGELOG.md).
|
||||||
|
|
||||||
The cool logo came from [Mikey Casalaina](https://github.com/casalaina).
|
The cool logo came from [Mikey Casalaina](https://github.com/casalaina).
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@ The following checklist guides you through the complete process in more detail.
|
|||||||
The pinned version of [`nixpkgs`](https://github.com/NixOS/nixpkgs) is defined
|
The pinned version of [`nixpkgs`](https://github.com/NixOS/nixpkgs) is defined
|
||||||
in [`nix/nixpkgs-version.nix`](nixpkgs-version.nix). The pin refers directly to
|
in [`nix/nixpkgs-version.nix`](nixpkgs-version.nix). The pin refers directly to
|
||||||
a GitHub tarball for the given revision, which is more efficient than pulling
|
a GitHub tarball for the given revision, which is more efficient than pulling
|
||||||
the complete Git repository. To upgrade it to the current `master` of
|
the complete Git repository. To upgrade it to the current `main` of
|
||||||
`nixpkgs`, you can use a small utility script defined in
|
`nixpkgs`, you can use a small utility script defined in
|
||||||
[`nix/nixpkgs-update.nix`](nixpkgs-update.nix):
|
[`nix/nixpkgs-update.nix`](nixpkgs-update.nix):
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ the complete Git repository. To upgrade it to the current `master` of
|
|||||||
# From the root of the repository, enter nix-shell
|
# From the root of the repository, enter nix-shell
|
||||||
nix-shell
|
nix-shell
|
||||||
|
|
||||||
# Run the utility script to pin the latest revision in master
|
# Run the utility script to pin the latest revision in main
|
||||||
postgrest-nixpkgs-upgrade
|
postgrest-nixpkgs-upgrade
|
||||||
|
|
||||||
# Exit the nix-shell with Ctrl-d
|
# Exit the nix-shell with Ctrl-d
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
[](https://www.patreon.com/postgrest)
|
[](https://www.patreon.com/postgrest)
|
||||||
[](https://www.paypal.me/postgrest)
|
[](https://www.paypal.me/postgrest)
|
||||||
[](http://postgrest.org)
|
[](http://postgrest.org)
|
||||||
[](https://circleci.com/gh/PostgREST/postgrest/tree/master)
|
[](https://circleci.com/gh/PostgREST/postgrest/tree/main)
|
||||||
|
|
||||||
PostgREST serves a fully RESTful API from any existing PostgreSQL database. It
|
PostgREST serves a fully RESTful API from any existing PostgreSQL database. It
|
||||||
provides a cleaner, more standards-compliant, faster API than you are likely to
|
provides a cleaner, more standards-compliant, faster API than you are likely to
|
||||||
@@ -24,5 +24,5 @@ The image is built from scratch using
|
|||||||
[Nix](https://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools) instead of a
|
[Nix](https://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools) instead of a
|
||||||
`Dockerfile`, which yields a higly secure and optimized image. This is also why
|
`Dockerfile`, which yields a higly secure and optimized image. This is also why
|
||||||
no commands are listed in the image history. See the [PostgREST
|
no commands are listed in the image history. See the [PostgREST
|
||||||
respository](https://github.com/PostgREST/postgrest/tree/master/nix/docker) for
|
respository](https://github.com/PostgREST/postgrest/tree/main/nix/docker) for
|
||||||
details on the build process and how to inspect the image.
|
details on the build process and how to inspect the image.
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ pgFmtFilter table (Filter fld (OpExpr hasNot oper)) = notOp <> " " <> case oper
|
|||||||
Op op val -> pgFmtFieldOp op <> " " <> case op of
|
Op op val -> pgFmtFieldOp op <> " " <> case op of
|
||||||
"like" -> unknownLiteral (T.map star val)
|
"like" -> unknownLiteral (T.map star val)
|
||||||
"ilike" -> unknownLiteral (T.map star val)
|
"ilike" -> unknownLiteral (T.map star val)
|
||||||
"is" -> whiteList val
|
"is" -> isAllowed val
|
||||||
_ -> unknownLiteral val
|
_ -> unknownLiteral val
|
||||||
|
|
||||||
-- We don't use "IN", we use "= ANY". IN has the following disadvantages:
|
-- We don't use "IN", we use "= ANY". IN has the following disadvantages:
|
||||||
@@ -172,8 +172,8 @@ pgFmtFilter table (Filter fld (OpExpr hasNot oper)) = notOp <> " " <> case oper
|
|||||||
-- IS cannot be prepared. `PREPARE boolplan AS SELECT * FROM projects where id IS $1` will give a syntax error.
|
-- IS cannot be prepared. `PREPARE boolplan AS SELECT * FROM projects where id IS $1` will give a syntax error.
|
||||||
-- The above can be fixed by using `PREPARE boolplan AS SELECT * FROM projects where id IS NOT DISTINCT FROM $1;`
|
-- The above can be fixed by using `PREPARE boolplan AS SELECT * FROM projects where id IS NOT DISTINCT FROM $1;`
|
||||||
-- However that would not accept the TRUE/FALSE/NULL keywords. See: https://stackoverflow.com/questions/6133525/proper-way-to-set-preparedstatement-parameter-to-null-under-postgres.
|
-- However that would not accept the TRUE/FALSE/NULL keywords. See: https://stackoverflow.com/questions/6133525/proper-way-to-set-preparedstatement-parameter-to-null-under-postgres.
|
||||||
whiteList :: Text -> H.Snippet
|
isAllowed :: Text -> H.Snippet
|
||||||
whiteList v = H.sql $ maybe
|
isAllowed v = H.sql $ maybe
|
||||||
(pgFmtLit v <> "::unknown") encodeUtf8
|
(pgFmtLit v <> "::unknown") encodeUtf8
|
||||||
(find ((==) . T.toLower $ v) ["null","true","false"])
|
(find ((==) . T.toLower $ v) ["null","true","false"])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user