On Jun 23, 2007, at 2:51 PM, Simon Roadkill wrote:

>
> Hello,
>     My application needs to run against Oracle and SQLite. I'd like to
> have a query that uses a regexp in a select statement. For Oracle this
> is fine, as it supports regular expressions natively. For raw SQLite I
> can do:
>
> 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?

connection.connection

http://www.sqlalchemy.org/docs/ 
sqlalchemy_engine.html#docstrings_sqlalchemy.engine_Connection



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to