Connecting to Vertica database using SQLAlchemy

前端 未结 2 1077
野趣味
野趣味 2020-12-20 00:44

I\'m trying to connect to a Vertica database using SQLAlchemy.

I came across and installed a Vertica dialect at https://github.com/jamescasbon/vertica-sqlalchemy. I\

2条回答
  •  眼角桃花
    2020-12-20 01:05

    SQLAlchemy is using unixODBC to connect to Vertica. You need to install the drivers and set up a DSN

    You should be able to connect with these parameters. This is what worked for me in my previous SQLAlchemy / Vertica project. Also, if this doesn't work, I would make sure it is configured properly and that you can connect using isql (comes with unixODBC).

    drivername='vertica+pyodbc',
    username='myuser',
    password='mypassword',
    host='hostname',
    database='DBNAME',
    

    You can also do this for a DSN connection:

    engine = create_engine('vertica+pyodbc://username:password@mydsn')
    

提交回复
热议问题