On Mar 22, 7:20 am, "pYuri.fy" <[email protected]> wrote:
> Credit:http://robots.thoughtbot.com/post/159807745/the-ideal-of-agnosticismhttp://stephen-veit.blogspot.com/2009/03/implementing-regexp-in-sqlit...
>
> I found a way to add regexp support to SQLite3 databases in Sequel.
> SQLite3 supports the
> REGEXP operator but leaves it up to the end-user to implement it. You
> can use the
> SQLite3::Database#create_function from the sqlite3-ruby gem to define
> the implementation.
>
> To get it working, you'll need to add the regexp implementation to the
> database instance and change how Sequel reacts when a regular
> expression is used with SQLite3 databases.I couldn't found how to
> access the SQLite3::Database instance through Sequel, so I just
> patched the sqlite3-ruby gem instead.

What are other people's thoughts on these changes?  Since you can add
regexp support to SQLite yourself, maybe Sequel shouldn't raise an
error when you attempt to use a regexp.  I think there are two
different issues here:

1) Change Sequel to allow regexps for SQLite (the database will raise
an error if they aren't supported).

2) Add a regexp callback to the native SQLite adapter, to use a ruby
regular expression.

I'm pretty OK with 1, but not too keen on 2.  However, I'd like some
input from the community before I make a decision.

Jeremy

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

Reply via email to