Databases
Introduction
The Hasura GraphQL Engine automatically generates your GraphQL schema and resolvers based on tables/views in your database . You don't need to write a GraphQL schema or resolvers. See How Hasura GraphQL Engine works for more details.
The Hasura Console gives you UI tools that speed up your data-modeling process, or working with your existing databases. The Console also automatically generates Migrations or Metadata files that you can edit directly and check into your version control.
Supported databases
Hasura GraphQL Engine supports:
- Postgres & Postgres compatible flavours
- MS SQL Server
- Citus / Hyperscale
- CockroachDB
- BigQuery
- Snowflake
- Amazon Athena
- MySQL (in preview) - See the preview guide
Hasura also supports many other cloud database services.
Although it is safe to use Hasura with a serverless database, caution must be maintained because some functionalities - such as subscriptions or Event Triggers - will force a serverless database to be always on.
Feature support
The below matrices show the database wise support for the different GraphQL features under schema, queries, mutations and subscriptions.
Each ✅ below links directly to the feature within a particular type of database.
Schema
Postgres | Citus | SQL Server | BigQuery | CockroachDB | CosmosDB | |
---|---|---|---|---|---|---|
Table Relationships | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Remote Relationships | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Views | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Custom Functions | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
Enums | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
Computed Fields | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
Data Validations | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Relay Schema | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
Naming Conventions | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
Custom Fields | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Default Values | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Queries
Postgres | Citus | SQL Server | BigQuery | CockroachDB | CosmosDB | |
---|---|---|---|---|---|---|
Simple | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Nested Object | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Aggregation | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Filter / Search | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Sort | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Distinct | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Paginate | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Multiple Arguments | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Multiple Queries | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Variables / Aliases / Fragments | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Mutations
Postgres | Citus | SQL Server | BigQuery | CockroachDB | CosmosDB | |
---|---|---|---|---|---|---|
Insert | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Upsert | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Update | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Delete | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Multiple per Request | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
Subscriptions
Postgres | Citus | SQL Server | BigQuery | CockroachDB | CosmosDB | |
---|---|---|---|---|---|---|
Value of Field | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Updates to Rows | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
Value of Derived Field | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
Streaming Subscriptions | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ |
Event Triggers
Postgres | Citus | SQL Server | BigQuery | CockroachDB | CosmosDB | |
---|---|---|---|---|---|---|
INSERT | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
UPDATE | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
DELETE | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
MANUAL | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
Get Started with Hasura today - Watch video guide.