Am 07.05.2009 um 10:16 schrieb Alex Kapranoff:
Good day to all!
(this is either a DBIx::Class, SQL::Abstarct or PgSQL fulltext search
+ Perl question)
Can someone please help "+selecting" a function with several
parameters?
This is the code we came up with. The problem is, $search_text doesn't
get quoted when sent to DB server.
'+select' => [
\[q{ts_headline('ru', html, plainto_tsquery('ru', ?), 'StartSel =
<b>, StopSel = </b>')},
[dummy => $search_text],
]],
'+as' => ['html_hilited'],
Use dbh for quoting:
$search_text = $rs->result_source->schema->storage->dbh-
>quote($search_text);
cheers,
moritz
_______________________________________________
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/[email protected]