Skip to content

Instantly share code, notes, and snippets.

@RHDZMOTA
Created September 21, 2022 22:36
Show Gist options
  • Save RHDZMOTA/d2abc4f89fe4391eb00653a8d3f9400c to your computer and use it in GitHub Desktop.
Save RHDZMOTA/d2abc4f89fe4391eb00653a8d3f9400c to your computer and use it in GitHub Desktop.
import snowflake.connector
# Create the snowflake connector instance
connector_instance = snowflake.connector.connect(
user=<your-user>,
password=<your-password>,
account=<your-snowflake-account>,
)
# Create a cursor to execute your queries
cursor = connector_instance.cursor()
try:
cursor.execute("<your-query>")
first_row = cursor.fetchone()
finally:
cursor.close()
connector_instance.close()
@RHDZMOTA
Copy link
Author

Python requirements:

pip install snowflake-connector-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment