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:
Luca Restagno 2022-10-20 17:42:00 +02:00 committed by hasura-bot
parent 0c8b80ee71
commit 9eef32d957
3 changed files with 93 additions and 83 deletions

View File

@ -964,7 +964,7 @@ multiplexed. (Default: `1000`)
<tr>
<td>
**Flag:**
###### Flag: {#stringify-numeric-types}
`--stringify-numeric-types`

View File

@ -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.

View File

@ -16,9 +16,9 @@ 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) |
| --------------------------------------- | ------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| 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) |
@ -29,7 +29,7 @@ their equivalent Hasura types:
| 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) |
| 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) |
@ -43,7 +43,7 @@ their equivalent Hasura types:
| 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) |
| 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) |
@ -232,16 +232,10 @@ through a variable of type **jsonb**.
E.g.
```graphql
mutation insert_test($value : jsonb) {
insert_test(
objects: [
{
jsonb_col: $value
}
]
) {
mutation insert_test($value: jsonb) {
insert_test(objects: [{ jsonb_col: $value }]) {
affected_rows
returning{
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