Questions tagged [dbix-class]

DBIx::Class is a Perl object-relational mapping (ORM) module. It aims to make representing queries in your code as perl-ish as possible while still providing access to as many of the capabilities of the database as possible, including retrieving related records from multiple tables in a single query, JOIN, LEFT JOIN, COUNT, DISTINCT, GROUP BY, ORDER BY and HAVING support.

from the description on CPAN:

This is an SQL to OO mapper with an object API inspired by Class::DBI (with a compatibility layer as a springboard for porting) and a resultset API that allows abstract encapsulation of database operations. It aims to make representing queries in your code as perl-ish as possible while still providing access to as many of the capabilities of the database as possible, including retrieving related records from multiple tables in a single query, JOIN, LEFT JOIN, COUNT, DISTINCT, GROUP BY, ORDER BY and HAVING support.

DBIx::Class can handle multi-column primary and foreign keys, complex queries and database-level paging, and does its best to only query the database in order to return something you've directly asked for. If a resultset is used as an iterator it only fetches rows off the statement handle as requested in order to minimise memory usage. It has auto-increment support for SQLite, MySQL, PostgreSQL, Oracle, SQL Server and DB2 and is known to be used in production on at least the first four, and is fork- and thread-safe out of the box (although your DBD may not be).

377 questions
-2
votes
2 answers

How to run plain/arbitrary SQL with DBIx::Class?

I need to run plain SQL with DBIx::Class: select proc_name(); Is there a way to do this with DBIx::Class? UPD I know I can do different connection with DBI and then: $dbh->do( 'select proc_name();' ) But I need to run it within same…
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
-2
votes
1 answer

equivalent DBIx::Class syntax?

i have this mysql query from this question. SELECT a.* FROM products a INNER JOIN product_tags b ON a.product_id = b.product_id WHERE b.tag_id IN (1,23,54) GROUP BY a.product_id HAVING COUNT(1) = 3 i am trying to figure how to get this converted to…
rajeev
  • 1,275
  • 7
  • 27
  • 45
1 2 3
25
26