Skip to content
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

Merged
merged 9 commits into from
Aug 30, 2023

Conversation

cristineguadelupe
Copy link
Contributor

No description provided.

Comment on lines 210 to 217
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment on lines 288 to 291
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adbc.Connection.get_driver

@cristineguadelupe cristineguadelupe merged commit 13fe3fb into livebook-dev:main Aug 30, 2023
1 check passed
@cristineguadelupe cristineguadelupe deleted the cg-snowflake branch August 30, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants