Unsupported SQLAlchemy of mssql instance

Issue #3962 wontfix
created an issue


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 = Session()
print ed_user.name
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@\SQLInstance/DB') that SQLInstance this is my instance and DB is database name

Comments (2)

  1. Michael 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