Skip to content

Instantly share code, notes, and snippets.

@dmitryhd
Created November 25, 2015 07:10
Show Gist options
  • Select an option

  • Save dmitryhd/8b52607b8698304cd3d7 to your computer and use it in GitHub Desktop.

Select an option

Save dmitryhd/8b52607b8698304cd3d7 to your computer and use it in GitHub Desktop.
Python various db connections
# Postgres
from sqlalchemy import create_engine
engine = create_engine('postgresql://USER:PASS@HOST/')
engine.execute('select 1').fetchall()
# Vertica
import pyodbc
conn_string = 'DSN=Vertica;'
con = pyodbc.connect(conn_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment