Unsupported SQLAlchemy of mssql instance

Issue #3962 wontfix
Ramin Farajpour Cami created an issue

Hi,

i going to connect of SQLAlchemy to other mssql instance exm: <ip>\SQLInstance but i see your docs SQAlchemy default connect to . instance,

default instance code :

from sqlalchemy import create_engine
engine = create_engine('mssql+pymssql://<user>:<pass>@<ip>:1433/database_name')

from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
from sqlalchemy import Column, Integer, String

class teeetttt(Base):
     __tablename__ = 'testtetetet'
     id = Column(Integer, primary_key=True)
     name = Column(String)
     fullname = Column(String)
     password = Column(String)



print teeetttt.__table__
ed_user = teeetttt(name='ed', fullname='Ed Jones', password='edspassword')
from sqlalchemy.orm import sessionmaker
Session = sessionmaker(bind=engine)
Session = sessionmaker()
Session.configure(bind=engine)
session = Session()
session.add(ed_user)
session.commit()
print ed_user.name
session.query(teeetttt).all()
f  = session.query(teeetttt).all()
print f[0].name
print session.query(teeetttt).all()

my goals connect to engine=create_engine('mssql+adodbapi://sa:a`123456@172.16.20.181:1433\SQLInstance/DB') that SQLInstance this is my instance and DB is database name

Comments (2)

  1. Mike Bayer repo owner

    the ADODBAPI dialect is not maintained and probably does not work. We also support pyodbc. If you need to connect to some special windows address, use ODBC with pyodbc.

    if the only problem here is "adodbapi" doesn't work, that DBAPI is not supported right now.

  2. Log in to comment