Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 18639
Status: resolved
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Add Regex Support?
Date: Mon, 10 Apr 2006 10:22:59 -0700
To: bug-dbd-sqlite [...] rt.cpan.org
From: David Wheeler <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 725b
It'd be cool if DBD::SQLite could automatically add a regexp() function with Perl regular expression support. I do it in my code like this: $dbh->func('regexp', 2, sub { my ($regex, $string) = @_; return $string =~ /$regex/; }, 'create_function'); Why do I do this? Because then the SQLite REGEXP function will just use it in queries: my $sel = $dbh->prepare('SELECT a FROM try WHERE a REGEXP ?'); But it'd be really cool if DBD::SQLite defined the regexp() function in C/XS, so that we all get this benefit all the time. I blogged about this functionality here: http://www.justatheory.com/computers/databases/sqlite/ add_regexen.html So, file this under Wishlist. :-) Best, David
Sorry, I don't take wishlist items that should be part of sqlite core. Please ask them instead :-)
Subject: Re: [rt.cpan.org #18639] Add Regex Support?
Date: Thu, 7 Sep 2006 20:41:57 -0700
To: bug-DBD-SQLite [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 837b
On Sep 7, 2006, at 20:34, via RT wrote: Show quoted text
> Sorry, I don't take wishlist items that should be part of sqlite > core. Please ask them instead :-)
well, How would SQLite know what regex engine you want to use? I suppose it could support POSIX or PCRE if it found the library, but it seems to me (as a non-XS/C person who bows to the master) that it wouldn't be too hard to support this in Perl/XS in DBD::SQLite. Am I wrong? I think that DRH doesn't want to get into the business of adding features that depend on external libraries (unicode not withstanding, perhaps). He told me at OSCON that he made it simple, but tried to provide the hooks for developers (vous et moi) to easily add what they need. REGEX support falls into that category, methinks. But maybe we should Cc him on this ticket, then? Cheers, David
Download (untitled) / with headers
text/plain 347b
My problem is, I want to be a thin DBI layer to the driver. You've already shown that you can add perl regexp support, so there's no bug. You just want me to do it for everyone. And I disagree with that. (marking closed, please only reply if you have a great reason why everyone should get this feature that only one person has asked for :-) )


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.