Hi,
Background knowledge:
SQLite breaks from SQL traditions by not ignoring trailing whitespace
when comparing strings.
ie. SELECT 'FOO ' = 'FOO'; # returns false
However you can specify that it trim the whitespace and DWIW like this:
SELECT 'FOO ' = 'FOO' COLLATE RTRIM; # returns true
So, now I want to apply that to queries in DBIx::Class.
Currently I can do:
my $rs = $schema->resultset('Foo');
$rs->search({ name => 'bar' })->count;
# returns 0
$rs->search({ name => 'bar ' })->count;
# returns some
One option I have is this:
$rs->search({ name => \" = 'bar' COLLATE RTRIM" })->count;
But that is far, far from making me happy.
I wondered if others have encountered this issue, and if so, have you
found a neater solution?
Thanks,
Toby (wintrmute)
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk