Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

KinoDB Snowflake

livebooks/kino/kino_db_snowflake.livemd

KinoDB Snowflake

Mix.install([
  {:kino_db, "~> 0.2"},
  {:kino_explorer, "~> 0.1"},
  {:adbc, "~> 0.2"}
])

Connect to DB

:ok = Adbc.download_driver!(:snowflake)

uri =
  "rwakabay:" <>
    System.fetch_env!("LB_DB_PASSWORD") <>
    "@in73999.ap-northeast-3.aws.snowflakecomputing.com/snowflake_sample_data/tpch_sf1"

{:ok, db} = Kino.start_child({Adbc.Database, driver: :snowflake, uri: uri})
{:ok, conn} = Kino.start_child({Adbc.Connection, database: db})

Execute query

result = Explorer.DataFrame.from_query!(conn, "SELECT * FROM lineitem", [])