[Catalyst] getting database handles and run arbitrary SQL

Johannes Plunien plu at pqpq.de
Wed Sep 24 08:37:12 BST 2008


On 24.09.2008, at 09:15, theshz wrote:

> Is it possible to get the database handle and run SQL directly as in  
> DBI?

yes, try:

my $dbh = $c->model('DBIC::User')->result_source->storage->dbh;

(assuming your model based on Catalyst::Model::DBIC::Schema is named  
DBIC and you got a schema called User)

Kind regards,

Johannes Plunien | mailto:plu at pqpq.de | http://www.pqpq.de/contact/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2436 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080924/9105dead/smime.bin

More information about the Catalyst mailing list