-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from TidierOrg/add-snowflake-support
- Add snowflake support - Truncates HTTP messages to take out stacktrace and show relevant issue - Adds docs for snowflake use and best practices
- Loading branch information
Showing
11 changed files
with
371 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Establishing a connection with the Snowflake SQL Rest API requires a OAuth token specific to the Role the user will use to query tables with. | ||
|
||
# ## Connecting | ||
# Connection is established with the `connect` function as shown below. Connection requires 5 items as strings | ||
# - account identifier | ||
# - OAuth token | ||
# - Database Name | ||
# - Schema Name | ||
# - Compute Warehouse name | ||
|
||
# Three things to note: | ||
# - Your OAuth Token may frequently expire, which may require you to rerun your connection line. | ||
# - For the time being, to properly track columns in the local metadata, you must write them using ALL CAPS - this will likely be addressed and rectified in the future | ||
# - Since each time `db_table` runs, it runs a query to pull the metadata, you may choose to use run `db_table` and save the results, and use these results with`from_query()` | ||
# - This will reduce the number of queries to your database | ||
# - Allow you to build a a SQL query and `@show_query` even if the OAuth_token has expired. To `@collect` you will have to reconnect and rerun db_table if your OAuth token has expired | ||
|
||
# ```julia | ||
# ac_id = "string_id" | ||
# token = "OAuth_token_string" | ||
# con = connect(:snowflake, ac_id, token, "DEMODB", "PUBLIC", "COMPUTE_WH") | ||
# # After connection is established, a you may begin querying. | ||
# stable_table_metadata = db_table(con, "MTCARS") | ||
# @chain from_query(stable_table_metadata) begin | ||
# @select(WT) | ||
# @mutate(TEST = WT *2) | ||
# #@aside @show_query _ | ||
# @collect | ||
# end | ||
# ``` | ||
# ``` | ||
# 32×2 DataFrame | ||
# Row │ WT TEST | ||
# │ Float64 Float64 | ||
# ─────┼────────────────── | ||
# 1 │ 2.62 5.24 | ||
# 2 │ 2.875 5.75 | ||
# 3 │ 2.32 4.64 | ||
# 4 │ 3.215 6.43 | ||
# ⋮ │ ⋮ ⋮ | ||
# 29 │ 3.17 6.34 | ||
# 30 │ 2.77 5.54 | ||
# 31 │ 3.57 7.14 | ||
# 32 │ 2.78 5.56 | ||
# 24 rows omitted | ||
# ``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.