The Turso Data Connector allows for connecting to a SQLite database. This connector uses the Typescript Data Connector SDK and implements the Data Connector Spec.
- Install the new Hasura CLI — to quickly and easily create and manage your Hasura projects and builds.
- Install the Hasura VS Code extension — with support for other editors coming soon!
- Have a Turso database — for supplying data to your API.
After our prerequisites are taken care of, login to Hasura Cloud with the CLI:
ddn login
This will open up a browser window and initiate an OAuth2 login flow. If the browser window doesn't open automatically, use the link shown in the terminal output to launch the flow.
We'll use the create project
command to create a new project:
ddn create project --dir ./ddn
Let's move into the project directory:
cd ddn
Create a subgraph:
ddn create subgraph turso
Then, create a connector manifest:
ddn add connector-manifest turso_connector --subgraph turso --hub-connector hasura/turso --type cloud
You should have a connector manifest created at ddn/turso/turso_connector/connector/turso_connector.build.hml
kind: ConnectorManifest
version: v1
spec:
supergraphManifests:
- base
definition:
name: turso_connector
type: cloud
connector:
type: hub
name: hasura/turso:v0.0.10
deployments:
- context: .
env:
TURSO_AUTH_TOKEN:
value: ""
TURSO_URL:
value: ""
Fill in the value for the TURSO_AUTH_TOKEN and TURSO_URL environment variables with your Turso credentials.
(Make sure to save your changes to the file!)
Start a Hasura dev session using the following command:
ddn dev
You should see something like this if the connector has been deployed successfully:
4:13PM INF Building SupergraphManifest "base"...
+---------------+----------------------------------------------------------------------------------------------------+
| Build Version | 9c06480568 |
+---------------+----------------------------------------------------------------------------------------------------+
| API URL | https://optimum-dragon-2392-9c06480568.ddn.hasura.app/graphql |
+---------------+----------------------------------------------------------------------------------------------------+
| Console URL | https://console.hasura.io/project/optimum-dragon-2392/environment/default/build/9c06480568/graphql |
+---------------+----------------------------------------------------------------------------------------------------+
| Project Name | optimum-dragon-2392 |
+---------------+----------------------------------------------------------------------------------------------------+
| Description | Dev build - Mon, 15 Apr 2024 16:13:07 CDT |
+---------------+----------------------------------------------------------------------------------------------------+
Navigate to your Console URL and you can issue a query or mutation.
Please keep an eye out for instructions on running things locally which will be coming soon.