diff --git a/docs/ecosystem.rst b/docs/ecosystem.rst index 24d56d9b3..167b3e119 100644 --- a/docs/ecosystem.rst +++ b/docs/ecosystem.rst @@ -34,7 +34,7 @@ Templates Example Apps ------------ -* `archtika `_ - self‑hosted CMS +* `archtika `_ - self-hosted CMS * `delibrium-postgrest `_ - example school API and front-end in Vue.js * `ETH-transactions-storage `_ - indexer for Ethereum to get transaction list by ETH address * `general `_ - example auth back-end diff --git a/docs/how-tos/sql-user-management.rst b/docs/how-tos/sql-user-management.rst index c167e99b7..5b78867aa 100644 --- a/docs/how-tos/sql-user-management.rst +++ b/docs/how-tos/sql-user-management.rst @@ -3,7 +3,7 @@ SQL User Management =================== -As mentioned on :ref:`jwt_generation`, an external service can provide user management and coordinate with the PostgREST server using JWT. It’s also possible to support logins entirely through SQL. It’s a fair bit of work, so get ready. +As mentioned on :ref:`jwt_generation`, an external service can provide user management and coordinate with the PostgREST server using JWT. It's also possible to support logins entirely through SQL. It's a fair bit of work, so get ready. Storing Users and Passwords --------------------------- diff --git a/docs/references/api/domain_representations.rst b/docs/references/api/domain_representations.rst index 156af90d4..caa579e55 100644 --- a/docs/references/api/domain_representations.rst +++ b/docs/references/api/domain_representations.rst @@ -173,4 +173,4 @@ Domain Representations avoid all the above drawbacks. Their only drawback is tha Why not create a `base type `_ instead? ``CREATE TYPE app_uuid (INTERNALLENGTH = 22, INPUT = app_uuid_parser, OUTPUT = app_uuid_formatter)``. - Creating base types need superuser, which is restricted on cloud hosted databases. Additionally this way lets “how the data is presented” dictate “how the data is stored” which would be backwards. + Creating base types need superuser, which is restricted on cloud hosted databases. Additionally this way lets "how the data is presented" dictate "how the data is stored" which would be backwards. diff --git a/docs/references/api/resource_embedding.rst b/docs/references/api/resource_embedding.rst index 856048a22..1647f9d52 100644 --- a/docs/references/api/resource_embedding.rst +++ b/docs/references/api/resource_embedding.rst @@ -143,7 +143,7 @@ Since the table name is plural, we can be more accurate by making it singular wi One-to-many relationships ------------------------- -The **foreign key reference** establishes the inverse one-to-many relationship. In this case, ``films`` returns as a JSON array because of the “to-many” end. +The **foreign key reference** establishes the inverse one-to-many relationship. In this case, ``films`` returns as a JSON array because of the "to-many" end. .. code-block:: bash @@ -1206,7 +1206,7 @@ Spread on resources forming :ref:`one-to-many ` and :ref:`many-to-m } ] -Note that ``films`` is no longer an array of objects, unlike regularly embedding :ref:`one-to-many`. The embedded columns become arrays and they're correlated—in the above result, we can say that "Pulp Fiction" premiered in 1994 and "Reservoir Dogs" in 1992. +Note that ``films`` is no longer an array of objects, unlike regularly embedding :ref:`one-to-many`. The embedded columns become arrays and they're correlated-in the above result, we can say that "Pulp Fiction" premiered in 1994 and "Reservoir Dogs" in 1992. Order in spread to-many ~~~~~~~~~~~~~~~~~~~~~~~ @@ -1302,7 +1302,7 @@ You can use multiple spreads at any level. For example, let's spread ``technical Note that: -- All the ``film_*`` arrays are correlated—"Reservoir Dogs" premiered in 1992, its runtime is 1:39:00 and it has the following characters: ``[ "Mr. Pink", "Mr. White" ]``. +- All the ``film_*`` arrays are correlated-"Reservoir Dogs" premiered in 1992, its runtime is 1:39:00 and it has the following characters: ``[ "Mr. Pink", "Mr. White" ]``. - The ``film_*`` arrays are ordered by ``year`` (due to ``films.order=year``). - The bottom level array ``film_characters`` is ordered (due to ``films.roles.order=character``). diff --git a/docs/references/auth.rst b/docs/references/auth.rst index 53e15f3cf..348f8486c 100644 --- a/docs/references/auth.rst +++ b/docs/references/auth.rst @@ -110,7 +110,7 @@ Symmetric Keys ~~~~~~~~~~~~~~ Each token is cryptographically signed with a secret key. In the case of symmetric cryptography the signer and verifier share the same secret passphrase, which can be configured with :ref:`jwt-secret`. -If it is set to a simple string value like “reallyreallyreallyreallyverysafe” then PostgREST interprets it as an HMAC-SHA256 passphrase. +If it is set to a simple string value like "reallyreallyreallyreallyverysafe" then PostgREST interprets it as an HMAC-SHA256 passphrase. .. _asym_keys: diff --git a/docs/references/configuration.rst b/docs/references/configuration.rst index 09ccb7774..22d2cac2a 100644 --- a/docs/references/configuration.rst +++ b/docs/references/configuration.rst @@ -409,7 +409,7 @@ db-pool-max-idletime **In-Database** `n/a` =============== ================================= - *For backwards compatibility, this config parameter is also available as “db-pool-timeout”.* + *For backwards compatibility, this config parameter is also available as "db-pool-timeout".* Time in seconds to close idle pool connections. diff --git a/docs/references/connection_pool.rst b/docs/references/connection_pool.rst index 13fdf5c4d..74385b225 100644 --- a/docs/references/connection_pool.rst +++ b/docs/references/connection_pool.rst @@ -15,7 +15,7 @@ Dynamic Connection Pool To conserve system resources, PostgREST uses a dynamic connection pool. This enables the number of connections in the pool to increase and decrease depending on request traffic. -- If all the connections are being used, a new connection is added. The pool can grow until it reaches the :ref:`db-pool` size. Note that it’s pointless to set this higher than the ``max_connections`` setting in your database. +- If all the connections are being used, a new connection is added. The pool can grow until it reaches the :ref:`db-pool` size. Note that it's pointless to set this higher than the ``max_connections`` setting in your database. - If a connection is unused for a period of time (:ref:`db-pool-max-idletime`), it will be released. - For connecting to the database, the :ref:`authenticator ` role is used. You can configure this using :ref:`db-uri`. @@ -106,4 +106,4 @@ Also set :ref:`db-channel-enabled` to ``false`` since ``LISTEN`` is not compatib .. note:: - It’s not recommended to use an external connection pooler. `Our benchmarks `_ indicate it provides much lower performance than PostgREST built-in pool. + It's not recommended to use an external connection pooler. `Our benchmarks `_ indicate it provides much lower performance than PostgREST built-in pool. diff --git a/docs/references/listener.rst b/docs/references/listener.rst index ad11a3411..3c380b345 100644 --- a/docs/references/listener.rst +++ b/docs/references/listener.rst @@ -4,7 +4,7 @@ Listener ######## PostgREST uses `LISTEN `_ to reload its :ref:`Schema Cache ` and :ref:`Configuration ` via `NOTIFY `_. -This is useful in environments where you can’t send SIGUSR1 or SIGUSR2 Unix Signals. +This is useful in environments where you can't send SIGUSR1 or SIGUSR2 Unix Signals. Like on cloud managed containers or on Windows systems. .. code:: postgresql diff --git a/docs/requirements.txt b/docs/requirements.txt index e59a65693..e26500a24 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ # This file is auto-generated by postgrest-nixpkgs-upgrade -sphinx==7.4.7 +sphinx==8.2.3 sphinx-copybutton==0.5.2 sphinx-rtd-dark-mode==1.3.0 sphinx-rtd-theme==3.0.2 sphinx-tabs==3.4.7 -sphinxext-opengraph==0.9.1 +sphinxext-opengraph==0.9.1 \ No newline at end of file diff --git a/flake.lock b/flake.lock index 9994726e2..e687ae512 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1731165248, - "narHash": "sha256-DiHFKIdBmMx5/DUARhVqaxvEIiy4EE6Eqs9Qs4oxme8=", + "lastModified": 1752006229, + "narHash": "sha256-BeuAPwNM2RBc5bvUTb0j4GRs2yBkDeRCw/8Y3v9Xesc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a90280100f41a10914edfe729a4053e60c92b8e3", + "rev": "c80edd02003fe3d8af527215a3ac069be9cfd47f", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixpkgs-25.05-darwin", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 16ccc1d80..61dd80f63 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "REST API for any Postgres database"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-25.05-darwin"; }; nixConfig = { diff --git a/nix/overlays/haskell-packages.nix b/nix/overlays/haskell-packages.nix index 489729f7e..1e0feefd5 100644 --- a/nix/overlays/haskell-packages.nix +++ b/nix/overlays/haskell-packages.nix @@ -50,34 +50,14 @@ let # jailbreak, because hspec limit for tests fuzzyset = prev.fuzzyset_0_2_4; - hasql-pool = lib.dontCheck (prev.callHackageDirect - { - pkg = "hasql-pool"; - ver = "1.0.1"; - sha256 = "sha256-Hf1f7lX0LWkjrb25SDBovCYPRdmUP1H6pAxzi7kT4Gg="; - } - { }); - - hasql-notifications = lib.dontCheck (prev.callHackageDirect - { - pkg = "hasql-notifications"; - ver = "0.2.2.2"; - sha256 = "sha256-myKwlug7OgTa/qP6mHfCD+5Q8IhM17JvpJBfSo+M01k="; - } - { }); - - # newer nixpkgs already has 0.10., so we fallback to default for forward compat - jose-jwt = prev.jose-jwt_0_10_0 or prev.jose-jwt; - - postgresql-libpq = lib.dontCheck (prev.callHackageDirect - { - pkg = "postgresql-libpq"; - ver = "0.10.1.0"; - sha256 = "sha256-tXOMqCO8opMilI9rx0D+njqjIjbZsH168Bzb8Aq8Ff4="; - } - { - postgresql = super.libpq; - }); + # Downgrade hasql and related packages while we are still on GHC 9.4 for the static build. + hasql = lib.dontCheck (lib.doJailbreak prev.hasql_1_6_4_4); + hasql-dynamic-statements = lib.dontCheck prev.hasql-dynamic-statements_0_3_1_5; + hasql-implicits = lib.dontCheck prev.hasql-implicits_0_1_1_3; + hasql-notifications = lib.dontCheck prev.hasql-notifications_0_2_2_2; + hasql-pool = lib.dontCheck prev.hasql-pool_1_0_1; + hasql-transaction = lib.dontCheck prev.hasql-transaction_1_1_0_1; + postgresql-binary = lib.dontCheck (lib.doJailbreak prev.postgresql-binary_0_13_1_3); }; in { diff --git a/nix/tools/docs.nix b/nix/tools/docs.nix index 3393c3f11..ec7bddd50 100644 --- a/nix/tools/docs.nix +++ b/nix/tools/docs.nix @@ -2,7 +2,6 @@ , aspellDicts , buildToolbox , checkedShellScript -, fetchPypi , lib , plantuml , python3 @@ -11,26 +10,14 @@ , writers }: let - selectPythonPackages = ps: - let - # TODO: Remove with next nixpkgs update - sphinx-rtd-theme = assert ps.sphinx-rtd-theme.version == "2.0.0"; ps.sphinx-rtd-theme.overrideAttrs rec { - version = "3.0.2"; - src = fetchPypi { - pname = "sphinx_rtd_theme"; - inherit version; - hash = "sha256-t0V7wl3acjsgsIamcLmVPIWeq2CioD7o6yuyPhduX4U="; - }; - }; - in - [ - ps.sphinx - ps.sphinx-copybutton - (ps.sphinx-rtd-dark-mode.override { inherit sphinx-rtd-theme; }) - sphinx-rtd-theme - ps.sphinx-tabs - ps.sphinxext-opengraph - ]; + selectPythonPackages = ps: [ + ps.sphinx + ps.sphinx-copybutton + ps.sphinx-rtd-dark-mode + ps.sphinx-rtd-theme + ps.sphinx-tabs + ps.sphinxext-opengraph + ]; requirements = writeTextFile { name = "requirements.txt"; @@ -48,6 +35,9 @@ let workingDir = "/docs"; } '' + # https://github.com/sphinx-doc/sphinx/issues/11739 + export LC_ALL=C + function build() { ${python}/bin/sphinx-build --color -W -a -n . -b "$@" } @@ -132,6 +122,8 @@ let workingDir = "/docs"; } '' + export LC_ALL=C + FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ') # shellcheck disable=SC2086 disable=SC2016 @@ -152,6 +144,8 @@ let workingDir = "/docs"; } '' + export LC_ALL=C + FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ') tail -n+2 postgrest.dict \ @@ -170,6 +164,8 @@ let workingDir = "/docs"; } '' + export LC_ALL=C + ${python}/bin/sphinx-build --color -b linkcheck . ../.docs-build ''; diff --git a/src/PostgREST/ApiRequest/Preferences.hs b/src/PostgREST/ApiRequest/Preferences.hs index 02723157f..086cb2fdc 100644 --- a/src/PostgREST/ApiRequest/Preferences.hs +++ b/src/PostgREST/ApiRequest/Preferences.hs @@ -155,7 +155,7 @@ fromHeaders allowTxDbOverride acceptedTzNames headers = listStripPrefix prefix prefList = listToMaybe $ mapMaybe (BS.stripPrefix prefix) prefList timezonePref = listStripPrefix "timezone=" prefs - isTimezonePrefAccepted = (S.member <$> (decodeUtf8 <$> timezonePref) <*> pure acceptedTzNames) == Just True + isTimezonePrefAccepted = ((S.member . decodeUtf8 <$> timezonePref) <*> pure acceptedTzNames) == Just True maxAffectedPref = listStripPrefix "max-affected=" prefs >>= readMaybe . BS.unpack diff --git a/src/PostgREST/Plan.hs b/src/PostgREST/Plan.hs index d7141170b..99f0c82c2 100644 --- a/src/PostgREST/Plan.hs +++ b/src/PostgREST/Plan.hs @@ -1119,7 +1119,7 @@ negotiateContent conf ApiRequest{iAction=act, iPreferences=Preferences{preferRep m@(MTVndPlan (MTVndSingularJSON strip) _ _) -> mtPlanToNothing $ Just (BuiltinAggSingleJson strip, m) m@(MTVndPlan MTVndArrayJSONStrip _ _) -> mtPlanToNothing $ Just (BuiltinAggArrayJsonStrip, m) -- TODO the plan should have its own MediaHandler instead of relying on MediaType - m@(MTVndPlan mType _ _) -> mtPlanToNothing $ (,) <$> (fst <$> lookupHandler mType) <*> pure m + m@(MTVndPlan mType _ _) -> mtPlanToNothing $ ((,) . fst <$> lookupHandler mType) <*> pure m -- all the other media types can be overridden x -> lookupHandler x mtPlanToNothing x = if configDbPlanEnabled conf then x else Nothing -- don't find anything if the plan media type is not allowed diff --git a/src/PostgREST/Query.hs b/src/PostgREST/Query.hs index 2749bcbf2..0ff003424 100644 --- a/src/PostgREST/Query.hs +++ b/src/PostgREST/Query.hs @@ -193,10 +193,10 @@ actionQuery (MaybeDb plan@InspectPlan{ipSchema=tSchema}) AppConfig{..} _ sCache <$> SQL.statement ([tSchema], configDbHoistedTxSettings) (SchemaCache.accessibleFuncs configDbPreparedStatements) <*> SQL.statement tSchema (SchemaCache.schemaDescription configDbPreparedStatements)) OAIgnorePriv -> - MaybeDbResult plan . Just <$> ((,,) + (MaybeDbResult plan . Just) . (,,) (HM.filterWithKey (\(QualifiedIdentifier sch _) _ -> sch == tSchema) $ SchemaCache.dbTables sCache) (HM.filterWithKey (\(QualifiedIdentifier sch _) _ -> sch == tSchema) $ SchemaCache.dbRoutines sCache) - <$> SQL.statement tSchema (SchemaCache.schemaDescription configDbPreparedStatements)) + <$> SQL.statement tSchema (SchemaCache.schemaDescription configDbPreparedStatements) OADisabled -> pure $ MaybeDbResult plan Nothing @@ -279,9 +279,9 @@ setPgLocals dbActPlan AppConfig{..} claims role ApiRequest{..} = lift $ claimsSql = [setConfigWithConstantName ("request.jwt.claims", LBS.toStrict $ JSON.encode claims)] roleSql = [setConfigWithConstantName ("role", role)] roleSettingsSql = setConfigWithDynamicName <$> HM.toList (fromMaybe mempty $ HM.lookup role configRoleSettings) - appSettingsSql = setConfigWithDynamicName <$> (join bimap toUtf8 <$> configAppSettings) + appSettingsSql = setConfigWithDynamicName . join bimap toUtf8 <$> configAppSettings timezoneSql = maybe mempty (\(PreferTimezone tz) -> [setConfigWithConstantName ("timezone", tz)]) $ preferTimezone iPreferences - funcSettingsSql = setConfigWithDynamicName <$> (join bimap toUtf8 <$> funcSettings) + funcSettingsSql = setConfigWithDynamicName . join bimap toUtf8 <$> funcSettings searchPathSql = let schemas = escapeIdentList (iSchema : configDbExtraSearchPath) in setConfigWithConstantName ("search_path", schemas) diff --git a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbMediaHandlers].yaml b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbMediaHandlers].yaml index 7b6317188..7ad8a3f44 100644 --- a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbMediaHandlers].yaml +++ b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbMediaHandlers].yaml @@ -1,3 +1,8 @@ +- - - tag: RelAnyElement + - tag: MTTextCSV + - - tag: BuiltinOvAggCsv + - tag: MTTextCSV + - - - tag: RelAnyElement - tag: MTGeoJSON - - tag: BuiltinOvAggGeoJson @@ -8,11 +13,6 @@ - - tag: BuiltinOvAggJson - tag: MTApplicationJSON -- - - tag: RelAnyElement - - tag: MTTextCSV - - - tag: BuiltinOvAggCsv - - tag: MTTextCSV - - - - tag: RelAnyElement - tag: MTAny - - tag: BuiltinOvAggJson diff --git a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbRoutines].yaml b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbRoutines].yaml index 9f68018d0..55ed52b7f 100644 --- a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbRoutines].yaml +++ b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbRoutines].yaml @@ -1,72 +1,11 @@ -- - qiName: reload_pgrst_config - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: reload_pgrst_config - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: change_max_rows_config - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: change_max_rows_config - pdParams: - - ppName: val - ppReq: true - ppType: integer - ppTypeMaxLength: integer - ppVar: false - - ppName: notify - ppReq: false - ppType: boolean - ppTypeMaxLength: boolean - ppVar: false - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: reset_invalid_role_claim_key - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: reset_invalid_role_claim_key - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: rpc_with_one_hoisted +- - qiName: rpc_with_two_hoisted qiSchema: public - - pdDescription: null pdFuncSettings: - - statement_timeout - - 7s + - 10s pdHasVariadic: false - pdName: rpc_with_one_hoisted + pdName: rpc_with_two_hoisted pdParams: [] pdReturnType: contents: @@ -79,59 +18,6 @@ pdSchema: public pdVolatility: Volatile -- - qiName: serializable_isolation_level - qiSchema: public - - - pdDescription: null - pdFuncSettings: - - - default_transaction_isolation - - serializable - pdHasVariadic: false - pdName: serializable_isolation_level - pdParams: [] - pdReturnType: - contents: - contents: - qiName: text - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: hello - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: hello - pdParams: [] - pdReturnType: - contents: - contents: - qiName: text - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: get_pgrst_version - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: get_pgrst_version - pdParams: [] - pdReturnType: - contents: - contents: - qiName: text - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - - - qiName: terminate_pgrst qiSchema: public - - pdDescription: null @@ -171,22 +57,24 @@ pdSchema: public pdVolatility: Volatile -- - qiName: rpc_with_two_hoisted +- - qiName: change_db_schema_and_full_reload qiSchema: public - - pdDescription: null - pdFuncSettings: - - - statement_timeout - - 10s + pdFuncSettings: [] pdHasVariadic: false - pdName: rpc_with_two_hoisted - pdParams: [] + pdName: change_db_schema_and_full_reload + pdParams: + - ppName: schemas + ppReq: true + ppType: text + ppTypeMaxLength: text + ppVar: false pdReturnType: contents: contents: - - qiName: items - qiSchema: public - - false - tag: Composite + qiName: void + qiSchema: pg_catalog + tag: Scalar tag: Single pdSchema: public pdVolatility: Volatile @@ -218,130 +106,6 @@ pdSchema: public pdVolatility: Volatile -- - qiName: reset_db_schemas_config - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: reset_db_schemas_config - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: change_db_schemas_config - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: change_db_schemas_config - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: change_db_schema_and_full_reload - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: change_db_schema_and_full_reload - pdParams: - - ppName: schemas - ppReq: true - ppType: text - ppTypeMaxLength: text - ppVar: false - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: invalid_role_claim_key_reload - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: invalid_role_claim_key_reload - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: reset_max_rows_config - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: reset_max_rows_config - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: root - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: root - pdParams: [] - pdReturnType: - contents: - contents: - qiName: json - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - -- - qiName: uses_prepared_statements - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: uses_prepared_statements - pdParams: [] - pdReturnType: - contents: - contents: - qiName: bool - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - - - qiName: migrate_function qiSchema: public - - pdDescription: null @@ -359,23 +123,6 @@ pdSchema: public pdVolatility: Volatile -- - qiName: create_function - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: create_function - pdParams: [] - pdReturnType: - contents: - contents: - qiName: void - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile - - - qiName: change_role_statement_timeout qiSchema: public - - pdDescription: null @@ -398,31 +145,29 @@ pdSchema: public pdVolatility: Volatile -- - qiName: repeatable_read_isolation_level +- - qiName: reset_max_rows_config qiSchema: public - - pdDescription: null - pdFuncSettings: - - - default_transaction_isolation - - REPEATABLE READ + pdFuncSettings: [] pdHasVariadic: false - pdName: repeatable_read_isolation_level + pdName: reset_max_rows_config pdParams: [] pdReturnType: contents: contents: - qiName: text + qiName: void qiSchema: pg_catalog tag: Scalar tag: Single pdSchema: public pdVolatility: Volatile -- - qiName: drop_change_cats +- - qiName: reset_invalid_role_claim_key qiSchema: public - - pdDescription: null pdFuncSettings: [] pdHasVariadic: false - pdName: drop_change_cats + pdName: reset_invalid_role_claim_key pdParams: [] pdReturnType: contents: @@ -434,6 +179,45 @@ pdSchema: public pdVolatility: Volatile +- - qiName: get_postgres_version + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: get_postgres_version + pdParams: [] + pdReturnType: + contents: + contents: + qiName: int4 + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: get_guc_value + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: get_guc_value + pdParams: + - ppName: name + ppReq: true + ppType: text + ppTypeMaxLength: text + ppVar: false + pdReturnType: + contents: + contents: + qiName: text + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + - - qiName: one_sec_timeout qiSchema: public - - pdDescription: null @@ -453,12 +237,66 @@ pdSchema: public pdVolatility: Volatile -- - qiName: notify_do_nothing +- - qiName: reload_pgrst_config qiSchema: public - - pdDescription: null pdFuncSettings: [] pdHasVariadic: false - pdName: notify_do_nothing + pdName: reload_pgrst_config + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: rpc_with_one_hoisted + qiSchema: public + - - pdDescription: null + pdFuncSettings: + - - statement_timeout + - 7s + pdHasVariadic: false + pdName: rpc_with_one_hoisted + pdParams: [] + pdReturnType: + contents: + contents: + - qiName: items + qiSchema: public + - false + tag: Composite + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: hello + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: hello + pdParams: [] + pdReturnType: + contents: + contents: + qiName: text + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: change_db_schemas_config + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: change_db_schemas_config pdParams: [] pdReturnType: contents: @@ -492,17 +330,201 @@ pdSchema: public pdVolatility: Volatile -- - qiName: get_postgres_version +- - qiName: serializable_isolation_level qiSchema: public - - pdDescription: null - pdFuncSettings: [] + pdFuncSettings: + - - default_transaction_isolation + - serializable pdHasVariadic: false - pdName: get_postgres_version + pdName: serializable_isolation_level pdParams: [] pdReturnType: contents: contents: - qiName: int4 + qiName: text + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: drop_change_cats + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: drop_change_cats + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: change_max_rows_config + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: change_max_rows_config + pdParams: + - ppName: val + ppReq: true + ppType: integer + ppTypeMaxLength: integer + ppVar: false + - ppName: notify + ppReq: false + ppType: boolean + ppTypeMaxLength: boolean + ppVar: false + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: invalid_role_claim_key_reload + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: invalid_role_claim_key_reload + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: reset_db_schemas_config + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: reset_db_schemas_config + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: root + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: root + pdParams: [] + pdReturnType: + contents: + contents: + qiName: json + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: create_function + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: create_function + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: get_pgrst_version + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: get_pgrst_version + pdParams: [] + pdReturnType: + contents: + contents: + qiName: text + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: uses_prepared_statements + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: uses_prepared_statements + pdParams: [] + pdReturnType: + contents: + contents: + qiName: bool + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: repeatable_read_isolation_level + qiSchema: public + - - pdDescription: null + pdFuncSettings: + - - default_transaction_isolation + - REPEATABLE READ + pdHasVariadic: false + pdName: repeatable_read_isolation_level + pdParams: [] + pdReturnType: + contents: + contents: + qiName: text + qiSchema: pg_catalog + tag: Scalar + tag: Single + pdSchema: public + pdVolatility: Volatile + +- - qiName: notify_do_nothing + qiSchema: public + - - pdDescription: null + pdFuncSettings: [] + pdHasVariadic: false + pdName: notify_do_nothing + pdParams: [] + pdReturnType: + contents: + contents: + qiName: void qiSchema: pg_catalog tag: Scalar tag: Single @@ -545,25 +567,3 @@ tag: Single pdSchema: public pdVolatility: Volatile - -- - qiName: get_guc_value - qiSchema: public - - - pdDescription: null - pdFuncSettings: [] - pdHasVariadic: false - pdName: get_guc_value - pdParams: - - ppName: name - ppReq: true - ppType: text - ppTypeMaxLength: text - ppVar: false - pdReturnType: - contents: - contents: - qiName: text - qiSchema: pg_catalog - tag: Scalar - tag: Single - pdSchema: public - pdVolatility: Volatile diff --git a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTables].yaml b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTables].yaml index 420e4938c..3734502fa 100644 --- a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTables].yaml +++ b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTables].yaml @@ -10,18 +10,6 @@ tableSchema: public tableUpdatable: true -- - qiName: infinite_recursion - qiSchema: public - - tableColumns: {} - tableDeletable: false - tableDescription: null - tableInsertable: false - tableIsView: true - tableName: infinite_recursion - tablePKCols: [] - tableSchema: public - tableUpdatable: false - - - qiName: cats qiSchema: public - tableColumns: @@ -53,18 +41,6 @@ tableSchema: public tableUpdatable: true -- - qiName: projects - qiSchema: public - - tableColumns: {} - tableDeletable: true - tableDescription: null - tableInsertable: true - tableIsView: false - tableName: projects - tablePKCols: [] - tableSchema: public - tableUpdatable: true - - - qiName: items_w_isolation_level qiSchema: public - tableColumns: @@ -95,6 +71,30 @@ tableSchema: public tableUpdatable: true +- - qiName: projects + qiSchema: public + - tableColumns: {} + tableDeletable: true + tableDescription: null + tableInsertable: true + tableIsView: false + tableName: projects + tablePKCols: [] + tableSchema: public + tableUpdatable: true + +- - qiName: infinite_recursion + qiSchema: public + - tableColumns: {} + tableDeletable: false + tableDescription: null + tableInsertable: false + tableIsView: true + tableName: infinite_recursion + tablePKCols: [] + tableSchema: public + tableUpdatable: false + - - qiName: items qiSchema: public - tableColumns: diff --git a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTimezones].yaml b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTimezones].yaml index eaf1fd709..cbbe4e393 100644 --- a/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTimezones].yaml +++ b/test/io/__snapshots__/test_cli/test_schema_cache_snapshot[dbTimezones].yaml @@ -97,6 +97,7 @@ - America/Coral_Harbour - America/Cordoba - America/Costa_Rica +- America/Coyhaique - America/Creston - America/Cuiaba - America/Curacao @@ -694,6 +695,7 @@ - posix/America/Coral_Harbour - posix/America/Cordoba - posix/America/Costa_Rica +- posix/America/Coyhaique - posix/America/Creston - posix/America/Cuiaba - posix/America/Curacao diff --git a/test/io/postgrest.py b/test/io/postgrest.py index db556cfdd..a75b249f9 100644 --- a/test/io/postgrest.py +++ b/test/io/postgrest.py @@ -53,6 +53,7 @@ class PostgrestSession(requests_unixsocket.Session): @dataclasses.dataclass class PostgrestProcess: "Running PostgREST process and its corresponding main and admin endpoints." + admin: object process: object session: object