I am using SQLAlchemy to connect to different databases in Python, but not with the ORM support as this cannot be implemented due to several reasons.
Mainly I do build a
You should not try to implement your own escaping, but should instead use SQLAlchemy's builtin method:
sql = 'select * from foo where fieldname = :name' result = connection.execute(sql, name = myvar)