mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
docs: update with misc 2.0 changes
- update copyright - fix typo: comparision -> comparison - add new null in comparision exp behaviour - update cloud read replica page GitOrigin-RevId: bfd322344e7ecf89a2c1361db4bc2d7e25718b98
This commit is contained in:
parent
e0ec670b05
commit
4815c2bbc8
2
docs/_theme/djangodocs/layout.html
vendored
2
docs/_theme/djangodocs/layout.html
vendored
@ -335,7 +335,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Powered by <a target="_blank" rel="noopener" href="http://www.sphinx-doc.org">Sphinx</a>.
|
Powered by <a target="_blank" rel="noopener" href="http://www.sphinx-doc.org">Sphinx</a>.
|
||||||
| Copyright © 2020 <a target="_blank" rel="noopener" href="https://hasura.io">Hasura</a>.
|
| Copyright © 2021 <a target="_blank" rel="noopener" href="https://hasura.io">Hasura</a>.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,6 +20,81 @@ Hasura Cloud can load balance queries and subscriptions across read replicas whi
|
|||||||
Adding read replica urls
|
Adding read replica urls
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
.. rst-class:: api_tabs
|
||||||
|
.. tabs::
|
||||||
|
|
||||||
|
.. tab:: Console
|
||||||
|
|
||||||
|
Support coming very soon
|
||||||
|
|
||||||
|
.. tab:: CLI
|
||||||
|
|
||||||
|
You can add read replicas for a database by adding their config to the ``/metadata/databases/database.yaml`` file:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
:emphasize-lines: 11-17
|
||||||
|
|
||||||
|
- name: <db-name>
|
||||||
|
kind: postgres
|
||||||
|
configuration:
|
||||||
|
connection_info:
|
||||||
|
database_url:
|
||||||
|
from_env: <DATABASE_URL_ENV>
|
||||||
|
pool_settings:
|
||||||
|
idle_timeout: 180
|
||||||
|
max_connections: 50
|
||||||
|
retries: 1
|
||||||
|
read_replicas:
|
||||||
|
- database_url:
|
||||||
|
from_env: <DATABASE_REPLICA_URL_ENV>
|
||||||
|
pool_settings:
|
||||||
|
idle_timeout: 180
|
||||||
|
max_connections: 50
|
||||||
|
retries: 1
|
||||||
|
|
||||||
|
Apply the metadata by running:
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
hasura metadata apply
|
||||||
|
|
||||||
|
.. tab:: API
|
||||||
|
|
||||||
|
Currently it is only possible to add read replicas for a database at the time of creation using the :ref:`pg_add_source metadata API <pg_add_source>`
|
||||||
|
|
||||||
|
.. code-block:: http
|
||||||
|
:emphasize-lines: 15-26
|
||||||
|
|
||||||
|
POST /v1/metadata HTTP/1.1
|
||||||
|
Content-Type: application/json
|
||||||
|
X-Hasura-Role: admin
|
||||||
|
|
||||||
|
{
|
||||||
|
"type": "pg_add_source",
|
||||||
|
"args": {
|
||||||
|
"name": "<db_name>",
|
||||||
|
"configuration": {
|
||||||
|
"connection_info": {
|
||||||
|
"database_url": {
|
||||||
|
"from_env": "<DATABASE_URL_ENV>"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"read_replicas": [
|
||||||
|
{
|
||||||
|
"database_url": {
|
||||||
|
"from_env": "<DATABASE_REPLICA_URL_ENV>"
|
||||||
|
},
|
||||||
|
"pool_settings": {
|
||||||
|
"retries": 1,
|
||||||
|
"idle_timeout": 180,
|
||||||
|
"max_connections": 50
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
.. admonition:: For existing v1.3 projects
|
||||||
|
|
||||||
If you have configured your Postgres instances with replicas, the replica URLs can be added to Hasura using the following environment variable in your project ENV Vars tab:
|
If you have configured your Postgres instances with replicas, the replica URLs can be added to Hasura using the following environment variable in your project ENV Vars tab:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -28,14 +103,7 @@ If you have configured your Postgres instances with replicas, the replica URLs c
|
|||||||
|
|
||||||
If you have multiple replicas, their urls can be added as comma separated values.
|
If you have multiple replicas, their urls can be added as comma separated values.
|
||||||
|
|
||||||
Connection pool parameters
|
Additional environment variables for read replicas specifically:
|
||||||
--------------------------
|
|
||||||
|
|
||||||
Additional environment variables for connection pools, and for read replicas specifically:
|
|
||||||
|
|
||||||
``HASURA_GRAPHQL_PG_STRIPES``
|
|
||||||
|
|
||||||
``HASURA_GRAPHQL_PG_CONNECTIONS``
|
|
||||||
|
|
||||||
``HASURA_GRAPHQL_CONNECTIONS_PER_READ_REPLICA``
|
``HASURA_GRAPHQL_CONNECTIONS_PER_READ_REPLICA``
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ engine instance via the console / metadata APIs / CLI:
|
|||||||
|
|
||||||
.. code-block:: http
|
.. code-block:: http
|
||||||
|
|
||||||
POST /v2/metadata HTTP/1.1
|
POST /v1/metadata HTTP/1.1
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
X-Hasura-Role: admin
|
X-Hasura-Role: admin
|
||||||
|
|
||||||
@ -93,6 +93,11 @@ engine instance via the console / metadata APIs / CLI:
|
|||||||
"connection_info": {
|
"connection_info": {
|
||||||
"database_url": {
|
"database_url": {
|
||||||
"from_env": "<DB_URL_ENV_VAR>"
|
"from_env": "<DB_URL_ENV_VAR>"
|
||||||
|
},
|
||||||
|
"pool_settings": {
|
||||||
|
"retries": 1,
|
||||||
|
"idle_timeout": 180,
|
||||||
|
"max_connections": 50
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,10 +57,10 @@ argument to filter on equality.
|
|||||||
|
|
||||||
You can see the complete specification of the ``where`` argument in the :ref:`API reference <WhereExp>`.
|
You can see the complete specification of the ``where`` argument in the :ref:`API reference <WhereExp>`.
|
||||||
|
|
||||||
Comparision operators
|
Comparison operators
|
||||||
---------------------
|
--------------------
|
||||||
|
|
||||||
Let’s take a look at different comparision operators that can be used to filter results.
|
Let’s take a look at different comparison operators that can be used to filter results.
|
||||||
|
|
||||||
Equality operators (_eq, _neq)
|
Equality operators (_eq, _neq)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -1267,7 +1267,7 @@ For example:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
The behaviour of the comparision operators depends on whether the nested objects are a single object related via an
|
The behaviour of the comparison operators depends on whether the nested objects are a single object related via an
|
||||||
object relationship or an array of objects related via an array relationship.
|
object relationship or an array of objects related via an array relationship.
|
||||||
|
|
||||||
- In case of an **object relationship**, a row will be returned if the single nested object satisfies the defined
|
- In case of an **object relationship**, a row will be returned if the single nested object satisfies the defined
|
||||||
@ -1826,10 +1826,17 @@ The expression ``{}`` evaluates to ``true`` if an object exists (even if it's ``
|
|||||||
|
|
||||||
.. _null_value_evaluation:
|
.. _null_value_evaluation:
|
||||||
|
|
||||||
Evaluation of **null** values in comparision expressions
|
Evaluation of **null** values in comparison expressions
|
||||||
--------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
If in any comparision expression a ``null`` (or ``undefined``) value is passed, the expression currently gets
|
In **versions v2.0.0 and above**, if in any comparison expression a ``null`` value is passed, a type mismatch error
|
||||||
reduced to ``{}`` (:ref:`TRUE expression <true_expression>`)
|
will be thrown.
|
||||||
|
|
||||||
**For example**, the expression ``{ where: { _eq: null } }`` will be reduced to ``{ where: {} }``
|
For example, the expression ``{ where: {id: { _eq: null }}}`` will throw an error.
|
||||||
|
|
||||||
|
|
||||||
|
In **versions v1.3.3 and below**, if in any comparison expression a ``null`` value is passed, the expression gets
|
||||||
|
reduced to ``{}``, the :ref:`TRUE expression <true_expression>`.
|
||||||
|
|
||||||
|
For example, the expression ``{ where: { id: {_eq: null }}}`` will be reduced to ``{ where: {id: {}} }`` which
|
||||||
|
will return all objects for which an ``id`` is set, i.e. all objects will be returned.
|
||||||
|
Loading…
Reference in New Issue
Block a user