Skip to content

Instantly share code, notes, and snippets.

View Brand2's full-sized avatar

Adam Styles Brand2

  • Melbourne, Victoria, Australia
View GitHub Profile
def execute_query(params, query):
# Build your engine
engine = create_engine("mssql+pyodbc://some_uri_here/?odbc_connect={}".format(params))
# Sanity check that you even get anything here
with engine.connect() as conn:
result = conn.execute("SELECT 1;")
print(result)
with engine.connect() as conn:
try:
return pd.read_sql_query(query, conn)

Keybase proof

I hereby claim:

  • I am Brand2 on github.
  • I am brand2 (https://keybase.io/brand2) on keybase.
  • I have a public key whose fingerprint is CD33 D3CD D667 4F6C 0370 794F 9970 EB7D 4B12 2A0C

To claim this, I am signing this object: