Create a Sample Database

Up to now, Hasura and YugabyteDB services are running in AWS, but there is no data to experiment with. In this section, we’ll use Yugabyte CloudShell to create a sample database that stores Todos assigned to specific Users. You might already be familiar with this sample database if you’ve ever completed Hasura tutorials designed for PostgreSQL.

Follow the steps below to create the Todos and Users table in YugabyteDB:

  1. Open Yugabyte Cloud and Launch the Cloud Shell:

  1. Once in the Shell, create the Users table:

  1. Create the Todos table:

  1. Initialize the Users table with two records:

  1. Execute SELECT * FROM Users and confirm the following output:
id | name | created_at | last_seen
----+-------+----------------------------+-----------
1 | Mark | 2022-02-02 18:49:45.092247 |
2 | Jenny | 2022-02-02 18:49:45.092247 |
(2 rows)
Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin
graphql-handbook