Back to Graphql Engine

Get Started with Hasura Cloud & Citus - Hyperscale

docs/docs/databases/postgres/citus-hyperscale-postgres/getting-started/cloud.mdx

2.49.53.6 KB
Original Source

import Thumbnail from '@site/src/components/Thumbnail';

Get Started with Hasura Cloud & Citus - Hyperscale

Introduction

Step 1: Create an account on Hasura Cloud and create a new Hasura Project

Navigate to cloud.hasura.io, and create a new Hasura Cloud account.

Once you create a project on Hasura Cloud, hit the "Launch Console" button to open the Hasura Console for your project.

<Thumbnail src="/img/getting-started/create-project.png" alt="Connect new or existing database" width="600px" />

Step 2: Add your Citus database as a source to Hasura

In the Data > Data Manager > Connect Existing Database section on the Console, select Citus from the Data Source Driver dropdown and add the connection string directly or through an environment variable. As Citus speaks the same protocol as Postgres, the connection string will start with postgres://, i.e, there is no difference between Citus’s connection strings and Postgres’s connection strings.

<Thumbnail src="/img/databases/citus-hyperscale-postgres/connect-citus-db_console_2.10.1.png" alt="Add source" width="600px" />

Once you add the database, you'll see your database pop up on the sidebar.

Step 3: Track existing tables or create new tables

If you have existing tables, head to the database page by clicking on the database name on the sidebar. You should see a list of tables.

<!-- .. thumbnail:: /img/databases/ms-sql-server/3-manage-mydb.png :alt: Manage my-db :width: 1000px -->

Track tables selectively or all of them so that Hasura can introspect the tables and create the corresponding GraphQL schema.

<!-- .. thumbnail:: /img/databases/ms-sql-server/4-track-tables.png :alt: Track tables :width: 1000px -->

If you have foreign keys, you'll also see suggested relationships. Again, you can choose to track them selectively or all at once.

<!-- .. thumbnail:: /img/databases/ms-sql-server/5-track-rels.png :alt: Track relationships :width: 1000px -->

If you don't have existing tables, go ahead and add new tables and data and try out some queries, just like with a regular Postgres database.

<!-- Step 3: Option 2: Create new tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you don't have existing tables, head to the Run SQL window to run SQL against your SQL Server database and create tables or hit the Create Table button to create a table. If you're running raw SQL queries to create your tables, Don't forget to check "track metadata" at the bottom of the Run SQL window to make sure Hasura tracks your new database objects in its GraphQL schema. .. thumbnail:: /img/databases/ms-sql-server/7-run-sql.png :alt: Run SQL to create table :width: 1000px -->

Step 4: Try out a GraphQL query

Head to the API tab in the Console and try running a GraphQL query! Use the explorer sidebar on GraphQL to get help in creating a GraphQL query.

<Thumbnail src="/img/databases/api-explorer_step-4_console_2.10.1.png" alt="Make GraphQL query" width="1100px" />

Keep up to date

Hasura supports queries, relationships, permissions, custom functions and mutations on Citus.

Please watch this space to get the latest docs on how you can try these features out via the Console or by manipulating Metadata in JSON/YAML directly.

If you'd like to stay informed about the status of Citus support, subscribe to our newsletter and join our discord!