connection.create_function("regexp", 2, regexp)
where regexp is defined as:
def regexp(expr, item):
r = re.compile(expr)
return r.match(item) is not None
If I create an SQLAlchemy engine, and then create a connection object
I can no longer use the create_function to build the regexp:
db = create_engine(database)
connection = db.connect()
connection.create_function("regexp", 2, self.regexp)
results in "'Connection' object has no attribute 'create_function'"
Is it possible to access the underlying SQLite connection, and use
that to create my regexp function?
Cheers
Simon
connection.connection
http://www.sqlalchemy.org/docs/
sqlalchemy_engine.html#docstrings_sqlalchemy.engine_Connection