Demo data
To quickly test out SurrealDB and SurrealQL functionality, we've included two demo datasets here in .surql
files which you can download and import
into SurrealDB using the CLI.
Surreal Deal Store - there is a lot in store for you! (recommended)
Surreal Deal Store is our new and improved demo dataset based on our SurrealDB Store. The dataset is made up of 12 tables using both graph relations and record links.
In the diagram below, the nodes in pink are the standard tables, the ones in purple represent the edge tables which shows relationships between records and SurrealDB as a graph database. While the nodes in gray are the pre-computed table views.
Download
Dataset | URL |
---|---|
Surreal Deal Store | https://datasets.surrealdb.com/surreal-deal-store.surql |
Surreal Deal Store (mini) | https://datasets.surrealdb.com/surreal-deal-store-mini.surql |
Import
First, download any of the available datasets.
Secondly, start the server.
# Create a new in-memory server
surreal start --user root --pass root --allow-all
Lastly, use the import command to add the dataset.
Use the command below to import the surreal deal store dataset:
surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test surreal-deal-store.surql
To import the surreal downloaded the Surreal Deal store (mini) use the command below:
surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test surreal-deal-store-mini.surql
Please be aware that the import process might take a few seconds.
Using Curl
First, start the surrealdb server
# Create a new in-memory server
surreal start --user root --pass root --allow-all
Then, download the file and load it into the database
# Download the file
curl -L "https://datasets.surrealdb.com/surreal-deal-store.surql" -o surreal-deal-store.surql
# Load the file into the database using the rest endpoint
curl -v -X POST -u "root:root" -H "NS: test" -H "DB: test" -H "Accept: application/json" --data-binary @surreal-deal-store.surql http://localhost:8000/import
If you want to use the mini version:
# Download the file
curl -L "https://datasets.surrealdb.com/surreal-deal-store-mini.surql" -o surreal-deal-store-mini.surql
# Load the file into the database using the rest endpoint
curl -v -X POST -u "root:root" -H "NS: test" -H "DB: test" -H "Accept: application/json" --data-binary @surreal-deal-store-mini.surql http://localhost:8000/import
Sample queries
Here are some sample queries you can run on the Surreal Deal Store dataset. We've also included a Surrealist Mini below to help you run these queries.
Note: The query results below have been limited to 4 rows for brevity. If you remove the LIMIT 4
clause from the queries, you'll see the full results.
Surreal Deal - deals so good it's surreal!
Surreal Deal is a demo dataset based on a simplified e-commerce platform that sells artwork.
The dataset is made up of 8 tables using both graph relations and record links:
person
, order
, product
, review
, artist
, create
, avg_product_review
, daily_sales
.
In the diagram below, the nodes in pink are the standard tables, the ones in purple represent the edge tables which shows relationships between records and SurrealDB as a graph database. While the nodes in gray are the pre-computed table views.
Download
Dataset | URL |
---|---|
Surreal Deal | https://datasets.surrealdb.com/surreal-deal-store.surql |
Surreal Deal (mini) | https://datasets.surrealdb.com/surreal-deal-store-mini.surql |
Import
First, download any of the available datasets.
Secondly, start the server.
# Create a new in-memory server
surreal start --user root --pass root --allow-all
Lastly, use the import command to add the dataset.
Use the command below to import the surreal deal dataset:
surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test surreal-deal-store.surql
To import the surreal downloaded the Surreal Deal (mini) use the command below:
surreal import --conn http://localhost:8000 --user root --pass root --ns test --db test surreal-deal-store-mini.surql
Please be aware that the import process might take a few seconds.
Using Curl
First, start the surrealdb server
# Create a new in-memory server
surreal start --user root --pass root --allow-all
Then, download the file and load it into the database
# Download the file
curl -L "https://datasets.surrealdb.com/surreal-deal-store.surql" -o surreal-deal-store.surql
# Load the file into the database using the rest endpoint
curl -v -X POST -u "root:root" -H "NS: test" -H "DB: test" -H "Accept: application/json" --data-binary @surreal-deal-store.surql http://localhost:8000/import
If you want to use the mini version:
# Download the file
curl -L "https://datasets.surrealdb.com/surreal-deal-store-mini.surql" -o surreal-deal-store-mini.surql
# Load the file into the database using the rest endpoint
curl -v -X POST -u "root:root" -H "NS: test" -H "DB: test" -H "Accept: application/json" --data-binary @surreal-deal-store-mini.surql http://localhost:8000/import
Sample queries
Here are some sample queries you can run on the Surreal Deal Store dataset. We've also included a Surrealist Mini below to help you run these queries.
Note: The query results below have been limited to 4 rows for brevity. If you remove the LIMIT 4
clause from the queries, you'll see the full results.