Connect Structured Snowflake Data
Let’s connect PromptQL to a Snowflake database.
Add the Snowflake connector
ddn connector init my_snowflake -i
- Select hasura/snowflake and accept the default port by pressing “return”.
You’ll need a JDBC URL to connect to the database; it takes this form:
jdbc:snowflake://<organization>.<region>.<host>?user=<username>&password=<password>&db=<database-name>
The CLI will also ask for a list of schemas which should be made available. Please remember these are case-sensitive.
Introspect your data source
Introspect your data source to create a set of configuration files describing your data source in a format which the connector specifies.
ddn connector introspect my_snowflake
Add your resources
Add your resources to create metadata for models, commands, and relationships in your supergraph.
ddn model add my_snowflake '*'
ddn command add my_snowflake '*'
ddn relationship add my_snowflake '*'
Build your supergraph for the local engine
ddn supergraph build local
Create a Hasura DDN project to get PromptQL running, even if you are on local dev
ddn project init
Start your supergraph locally
ddn run docker-start
Head to your local DDN console
Run the following from your project’s directory:
ddn console --local
Talk to your data
Ask any questions you wish about your Snowflake data!