mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
docs: update hasura data types for > 53 bit types
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6418 Co-authored-by: Rob Dominguez <24390149+robertjdominguez@users.noreply.github.com> GitOrigin-RevId: f697c5ef96ffa9f70eecaf9af5b9658ae4db5aea
This commit is contained in:
parent
0c8b80ee71
commit
9eef32d957
@ -964,7 +964,7 @@ multiplexed. (Default: `1000`)
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
**Flag:**
|
||||
###### Flag: {#stringify-numeric-types}
|
||||
|
||||
`--stringify-numeric-types`
|
||||
|
||||
|
@ -9,14 +9,21 @@ sidebar_label: Metadata
|
||||
|
||||
# Metadata Best Practices
|
||||
|
||||
Proper Metadata management ensures the Hasura GraphQL Engine operates appropriately and as expected. You can use several different patterns to manage Metadata successfully. However, the below do's, and don'ts have been gathered through real-world practices, user experiences, and challenges when managing enterprise-scale Hasura ecosystems.
|
||||
Proper Metadata management ensures the Hasura GraphQL Engine operates appropriately and as expected. You can use several
|
||||
different patterns to manage Metadata successfully. However, the below do's, and don'ts have been gathered through
|
||||
real-world practices, user experiences, and challenges when managing enterprise-scale Hasura ecosystems.
|
||||
|
||||
### Recommended patterns
|
||||
|
||||
- Use the [Hasura CLI](/hasura-cli/index.mdx) to manage and export Metadata.
|
||||
- The CLI exports [YAML files](/migrations-metadata-seeds/manage-metadata.mdx) which is much more source-control friendly than JSON (exported by the Console and API).
|
||||
- Using the [Hasura CLI Console](/hasura-cli/commands/hasura_console.mdx) will capture all Metadata changes in the local file system as the changes are made.
|
||||
|
||||
- The CLI exports [YAML files](/migrations-metadata-seeds/manage-metadata.mdx) which is much more source-control
|
||||
friendly than JSON (exported by the Console and API).
|
||||
- Using the [Hasura CLI Console](/hasura-cli/commands/hasura_console.mdx) will capture all Metadata changes in the
|
||||
local file system as the changes are made.
|
||||
|
||||
- Use the [Hasura CLI Console](/hasura-cli/commands/hasura_console.mdx) as your development Console.
|
||||
|
||||
- [Disable the Hasura GraphQL default Console](/deployment/production-checklist.mdx#disable-console).
|
||||
- Changes via the CLI Console will be detected and will update the local file system.
|
||||
|
||||
@ -24,34 +31,51 @@ Proper Metadata management ensures the Hasura GraphQL Engine operates appropriat
|
||||
- Local files updated by the CLI Console are then committed to the source control solution.
|
||||
- We recommend retaining the CLI-exported file structure for ease of use.
|
||||
|
||||
- Automate deployments using tools such as GitHub Actions, Jenkins, or the [CLI-migrations image](/migrations-metadata-seeds/auto-apply-migrations.mdx).
|
||||
- Automate deployments using tools such as GitHub Actions, Jenkins, or the
|
||||
[CLI-migrations image](/migrations-metadata-seeds/auto-apply-migrations.mdx).
|
||||
|
||||
:::info Note
|
||||
|
||||
Hasura Cloud users can leverage the [GitHub integration](/deployment/hasura-cloud/github-integration.mdx) to automate deployments.
|
||||
Hasura Cloud users can leverage the [GitHub integration](/deployment/hasura-cloud/ci-cd/github-integration.mdx) to
|
||||
automate deployments.
|
||||
|
||||
:::
|
||||
|
||||
- Ensure good regression testing is implemented as part of the deployment workflow.
|
||||
- [graphqurl](https://github.com/hasura/graphqurl) is a simple tool that can be used to execute GraphQL queries and compare the results to known values.
|
||||
- [graphqurl](https://github.com/hasura/graphqurl) is a simple tool that can be used to execute GraphQL queries and
|
||||
compare the results to known values.
|
||||
|
||||
Use the Enterprise Edition for local development if the other Hasura tiers are Enterprise Edition. Using this image is required to allow for the configuration of Hasura Enterprise features (i.e., read-replicas), so the Hasura CLI will include the configurations in the exported Metadata.
|
||||
Use the Enterprise Edition for local development if the other Hasura tiers are Enterprise Edition. Using this image is
|
||||
required to allow for the configuration of Hasura Enterprise features (i.e., read-replicas), so the Hasura CLI will
|
||||
include the configurations in the exported Metadata.
|
||||
|
||||
### Patterns to avoid
|
||||
|
||||
- Don't use the Console or API to export Metadata.
|
||||
|
||||
- The Console and API export JSON files that are not as source-control friendly as YAML (exported by the CLI).
|
||||
|
||||
- Don't use the Hasura GraphQL default Console as your development Console.
|
||||
- Changes made via the Hasura GraphQL default Console will not capture Metadata changes and can easily cause systems to be out of sync.
|
||||
|
||||
- Don't rely on the local file system or the Hasura Metadata database as the source of truth for the Metadata configuration.
|
||||
- Changes made via the Hasura GraphQL default Console will not capture Metadata changes and can easily cause systems
|
||||
to be out of sync.
|
||||
|
||||
- Don't rely on the local file system or the Hasura Metadata database as the source of truth for the Metadata
|
||||
configuration.
|
||||
|
||||
- Local files can easily be unintentionally modified, corrupted, or lost.
|
||||
- You can unintentionally modify the Hasura Metadata database through misapplication of Metadata changes.
|
||||
- The Hasura Metadata database could be unintentionally lost if you accidentally delete the supporting database or persistent volume.
|
||||
- The Hasura Metadata database could be unintentionally lost if you accidentally delete the supporting database or
|
||||
persistent volume.
|
||||
|
||||
- Don't manually deploy. While this will work in practice, it will quickly grow beyond a reasonable level of effort as the system's complexity and frequency of deployments increase.
|
||||
- Don't manually deploy. While this will work in practice, it will quickly grow beyond a reasonable level of effort as
|
||||
the system's complexity and frequency of deployments increase.
|
||||
|
||||
- Don't skip good regression testing as Metadata changes can easily change the fundamental way the Hasura GraphQL Engine operates. Queries you structure differently may return unexpected results. You could modify security policies such as RBAC permissions or allowed queries via Metadata changes that cause unexpected behavior.
|
||||
- Don't skip good regression testing as Metadata changes can easily change the fundamental way the Hasura GraphQL Engine
|
||||
operates. Queries you structure differently may return unexpected results. You could modify security policies such as
|
||||
RBAC permissions or allowed queries via Metadata changes that cause unexpected behavior.
|
||||
|
||||
- Don't apply Metadata generated from the Community Edition to an Enterprise Edition system that has EE features configured (e.g., read-replicas). Hasura stores these configurations in the Metadata, and the Community Edition cannot configure these features. The resulting exported Metadata will not contain these values, and this Metadata would overwrite the Enterprise Edition configurations if you applied it.
|
||||
- Don't apply Metadata generated from the Community Edition to an Enterprise Edition system that has EE features
|
||||
configured (e.g., read-replicas). Hasura stores these configurations in the Metadata, and the Community Edition cannot
|
||||
configure these features. The resulting exported Metadata will not contain these values, and this Metadata would
|
||||
overwrite the Enterprise Edition configurations if you applied it.
|
||||
|
@ -15,53 +15,53 @@ keywords:
|
||||
List of PostgreSQL types supported by the Hasura GraphQL engine with
|
||||
their equivalent Hasura types:
|
||||
|
||||
| Name | Aliases | Description | Hasura Type |
|
||||
| --------------------------------------- | ------------------ | ----------------------------------------------------------- | ---------------------------------- |
|
||||
| bigint | int8 | signed eight-byte integer | [String](#string) |
|
||||
| bigserial | serial8 | autoincrementing eight-byte integer | [String](#string) |
|
||||
| bit [ (n) ] | | fixed-length bit string | [Implicit](#implicit) |
|
||||
| bit varying [ (n) ] | varbit [ (n) ] | variable-length bit string | [Implicit](#implicit) |
|
||||
| boolean | bool | logical Boolean (true/false) | [Bool](#bool) |
|
||||
| box | | rectangular box on a plane | [Implicit](#implicit) |
|
||||
| bytea | | binary data (“byte array”) | [Implicit](#implicit) |
|
||||
| character [ (n) ] | char [ (n) ] | fixed-length character string | [Char](#char) |
|
||||
| character varying [ (n) ] | varchar [ (n) ] | variable-length character string | [String](#string) |
|
||||
| cidr | | IPv4 or IPv6 network address | [Implicit](#implicit) |
|
||||
| circle | | circle on a plane | [Implicit](#implicit) |
|
||||
| date | | calendar date (year, month, day) | [Date](#date) |
|
||||
| double precision | float8 | double precision floating-point number (8 bytes) | [Float](#float) |
|
||||
| inet | | IPv4 or IPv6 host address | [Implicit](#implicit) |
|
||||
| integer | int, int4 | signed four-byte integer | [Int](#int) |
|
||||
| interval [ fields ] [ (p) ] | | time span | [Implicit](#implicit) |
|
||||
| json | | textual JSON data | [JSON](#json) |
|
||||
| jsonb | | binary JSON data, decomposed | [JSONB](#jsonb) |
|
||||
| line | | infinite line on a plane | [Implicit](#implicit) |
|
||||
| lseg | | line segment on a plane | [Implicit](#implicit) |
|
||||
| ltree | | labels of data stored in a hierarchical tree-like structure | [Implicit](#implicit) |
|
||||
| geometry | | PostGIS Geometry type | [Geometry](#geometry) |
|
||||
| geography | | PostGIS Geography type | [Geography](#geography) |
|
||||
| macaddr | | MAC (Media Access Control) address | [Implicit](#implicit) |
|
||||
| macaddr8 | | MAC (Media Access Control) address (EUI-64 format) | [Implicit](#implicit) |
|
||||
| money | | currency amount | [Implicit](#implicit) |
|
||||
| numeric [ (p, s) ] | decimal [ (p, s) ] | exact numeric of selectable precision | [Numeric](#numeric) |
|
||||
| path | | geometric path on a plane | [Implicit](#implicit) |
|
||||
| pg_lsn | | PostgreSQL Log Sequence Number | [Implicit](#implicit) |
|
||||
| point | | geometric point on a plane | [Implicit](#implicit) |
|
||||
| polygon | | closed geometric path on a plane | [Implicit](#implicit) |
|
||||
| real | float4 | single precision floating-point number (4 bytes) | [Float](#float) |
|
||||
| smallint | int2 | signed two-byte integer | [Int](#int) |
|
||||
| smallserial | serial2 | autoincrementing two-byte integer | [Int](#int) |
|
||||
| serial | serial4 | autoincrementing four-byte integer | [Int](#int) |
|
||||
| text | | variable-length character string | [String](#string) |
|
||||
| time [ (p) ] [ without time zone ] | | time of day (no time zone) | [Implicit](#implicit) |
|
||||
| time [ (p) ] with time zone | timetz | time of day, including time zone | [Timetz](#timetz) |
|
||||
| timestamp [ (p) ] [ without time zone ] | | date and time (no time zone) | [Implicit](#implicit) |
|
||||
| timestamp [ (p) ] with time zone | timestamptz | date and time, including time zone | [Timestamptz](#timestamptz) |
|
||||
| tsquery | | text search query | [Implicit](#implicit) |
|
||||
| tsvector | | text search document | [Implicit](#implicit) |
|
||||
| txid_snapshot | | user-level transaction ID snapshot | [Implicit](#implicit) |
|
||||
| uuid | | universally unique identifier | [Implicit](#implicit) |
|
||||
| xml | | XML data | [Implicit](#implicit) |
|
||||
| Name | Aliases | Description | Hasura Type |
|
||||
| --------------------------------------- | ------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
||||
| bigint | int8 | signed eight-byte integer | [Numeric](#numeric) or [String](#string) ([flag](/latest/deployment/graphql-engine-flags/reference/#stringify-numeric-types)) |
|
||||
| bigserial | serial8 | autoincrementing eight-byte integer | [Numeric](#numeric) or [String](#string) ([flag](/latest/deployment/graphql-engine-flags/reference/#stringify-numeric-types)) |
|
||||
| bit [ (n) ] | | fixed-length bit string | [Implicit](#implicit) |
|
||||
| bit varying [ (n) ] | varbit [ (n) ] | variable-length bit string | [Implicit](#implicit) |
|
||||
| boolean | bool | logical Boolean (true/false) | [Bool](#bool) |
|
||||
| box | | rectangular box on a plane | [Implicit](#implicit) |
|
||||
| bytea | | binary data (“byte array”) | [Implicit](#implicit) |
|
||||
| character [ (n) ] | char [ (n) ] | fixed-length character string | [Char](#char) |
|
||||
| character varying [ (n) ] | varchar [ (n) ] | variable-length character string | [String](#string) |
|
||||
| cidr | | IPv4 or IPv6 network address | [Implicit](#implicit) |
|
||||
| circle | | circle on a plane | [Implicit](#implicit) |
|
||||
| date | | calendar date (year, month, day) | [Date](#date) |
|
||||
| double precision | float8 | double precision floating-point number (8 bytes) | [Float](#float) or [String](#string) ([flag](/latest/deployment/graphql-engine-flags/reference/#stringify-numeric-types)) |
|
||||
| inet | | IPv4 or IPv6 host address | [Implicit](#implicit) |
|
||||
| integer | int, int4 | signed four-byte integer | [Int](#int) |
|
||||
| interval [ fields ] [ (p) ] | | time span | [Implicit](#implicit) |
|
||||
| json | | textual JSON data | [JSON](#json) |
|
||||
| jsonb | | binary JSON data, decomposed | [JSONB](#jsonb) |
|
||||
| line | | infinite line on a plane | [Implicit](#implicit) |
|
||||
| lseg | | line segment on a plane | [Implicit](#implicit) |
|
||||
| ltree | | labels of data stored in a hierarchical tree-like structure | [Implicit](#implicit) |
|
||||
| geometry | | PostGIS Geometry type | [Geometry](#geometry) |
|
||||
| geography | | PostGIS Geography type | [Geography](#geography) |
|
||||
| macaddr | | MAC (Media Access Control) address | [Implicit](#implicit) |
|
||||
| macaddr8 | | MAC (Media Access Control) address (EUI-64 format) | [Implicit](#implicit) |
|
||||
| money | | currency amount | [Implicit](#implicit) |
|
||||
| numeric [ (p, s) ] | decimal [ (p, s) ] | exact numeric of selectable precision | [Numeric](#numeric) or [String](#string) ([flag](/latest/deployment/graphql-engine-flags/reference/#stringify-numeric-types)) |
|
||||
| path | | geometric path on a plane | [Implicit](#implicit) |
|
||||
| pg_lsn | | PostgreSQL Log Sequence Number | [Implicit](#implicit) |
|
||||
| point | | geometric point on a plane | [Implicit](#implicit) |
|
||||
| polygon | | closed geometric path on a plane | [Implicit](#implicit) |
|
||||
| real | float4 | single precision floating-point number (4 bytes) | [Float](#float) |
|
||||
| smallint | int2 | signed two-byte integer | [Int](#int) |
|
||||
| smallserial | serial2 | autoincrementing two-byte integer | [Int](#int) |
|
||||
| serial | serial4 | autoincrementing four-byte integer | [Int](#int) |
|
||||
| text | | variable-length character string | [String](#string) |
|
||||
| time [ (p) ] [ without time zone ] | | time of day (no time zone) | [Implicit](#implicit) |
|
||||
| time [ (p) ] with time zone | timetz | time of day, including time zone | [Timetz](#timetz) |
|
||||
| timestamp [ (p) ] [ without time zone ] | | date and time (no time zone) | [Implicit](#implicit) |
|
||||
| timestamp [ (p) ] with time zone | timestamptz | date and time, including time zone | [Timestamptz](#timestamptz) |
|
||||
| tsquery | | text search query | [Implicit](#implicit) |
|
||||
| tsvector | | text search document | [Implicit](#implicit) |
|
||||
| txid_snapshot | | user-level transaction ID snapshot | [Implicit](#implicit) |
|
||||
| uuid | | universally unique identifier | [Implicit](#implicit) |
|
||||
| xml | | XML data | [Implicit](#implicit) |
|
||||
|
||||
## Int {#int}
|
||||
|
||||
@ -232,18 +232,12 @@ through a variable of type **jsonb**.
|
||||
E.g.
|
||||
|
||||
```graphql
|
||||
mutation insert_test($value : jsonb) {
|
||||
insert_test(
|
||||
objects: [
|
||||
{
|
||||
jsonb_col: $value
|
||||
}
|
||||
]
|
||||
) {
|
||||
affected_rows
|
||||
returning{
|
||||
jsonb_col
|
||||
}
|
||||
mutation insert_test($value: jsonb) {
|
||||
insert_test(objects: [{ jsonb_col: $value }]) {
|
||||
affected_rows
|
||||
returning {
|
||||
jsonb_col
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -268,11 +262,7 @@ E.g.
|
||||
|
||||
```graphql
|
||||
mutation insertGeometry($point: geometry!) {
|
||||
insert_test(
|
||||
objects: [{
|
||||
geometry_col: $point
|
||||
}]
|
||||
) {
|
||||
insert_test(objects: [{ geometry_col: $point }]) {
|
||||
affected_rows
|
||||
returning {
|
||||
geometry_col
|
||||
@ -302,11 +292,7 @@ E.g.
|
||||
|
||||
```graphql
|
||||
mutation insertGeography($point: geography!) {
|
||||
insert_test(
|
||||
objects: [{
|
||||
geography_col: $point
|
||||
}]
|
||||
) {
|
||||
insert_test(objects: [{ geography_col: $point }]) {
|
||||
affected_rows
|
||||
returning {
|
||||
geography_col
|
||||
|
Loading…
Reference in New Issue
Block a user