-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snowflake - Connection Cell and SQL Cell #61
Snowflake - Connection Cell and SQL Cell #61
Conversation
lib/kino_db/connection_cell.ex
Outdated
quote do | ||
:ok = Adbc.download_driver!(:snowflake) | ||
uri = unquote(build_snowflake_uri(attrs)) | ||
{:ok, db} = Kino.start_child({Adbc.Database, driver: :snowflake, uri: uri}) | ||
|
||
{:ok, unquote(quoted_var(attrs["variable"]))} = | ||
Kino.start_child({Adbc.Connection, database: db}) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quote do | |
:ok = Adbc.download_driver!(:snowflake) | |
uri = unquote(build_snowflake_uri(attrs)) | |
{:ok, db} = Kino.start_child({Adbc.Database, driver: :snowflake, uri: uri}) | |
{:ok, unquote(quoted_var(attrs["variable"]))} = | |
Kino.start_child({Adbc.Connection, database: db}) | |
end | |
var = quoted_var(attrs["variable"]) | |
quote do | |
:ok = Adbc.download_driver!(:snowflake) | |
uri = unquote(build_snowflake_uri(attrs)) | |
{:ok, db} = Kino.start_child({Adbc.Database, driver: :snowflake, uri: uri}) | |
{:ok, unquote(var)} = Kino.start_child({Adbc.Connection, database: db}) | |
end |
lib/kino_db/sql_cell.ex
Outdated
defp is_snowflake_conn?(conn) when conn == self(), do: false | ||
defp is_snowflake_conn?(conn) when is_pid(conn), do: is_snowflake_conn?(:sys.get_state(conn)) | ||
defp is_snowflake_conn?(%{queue: _, lock: _, conn: conn}) when is_reference(conn), do: true | ||
defp is_snowflake_conn?(_), do: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp is_snowflake_conn?(conn) when conn == self(), do: false | |
defp is_snowflake_conn?(conn) when is_pid(conn), do: is_snowflake_conn?(:sys.get_state(conn)) | |
defp is_snowflake_conn?(%{queue: _, lock: _, conn: conn}) when is_reference(conn), do: true | |
defp is_snowflake_conn?(_), do: false | |
defp snowflake_conn?(conn) when conn == self(), do: false | |
defp snowflake_conn?(conn) when is_pid(conn), do: is_snowflake_conn?(:sys.get_state(conn)) | |
defp snowflake_conn?(%{queue: _, lock: _, conn: conn}) when is_reference(conn), do: true | |
defp snowflake_conn?(_), do: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adbc.Connection.get_driver
77a349c
to
c13b736
Compare
No description provided.