in reply to SQL::Abstract-ing subqueries
Hi,
You might consider using a view stored inside the database in favour of application-side querying. Then just realize that view as a normal table relation in the ORM model, but observe not to accidentally touch the data, as view data is immutable i.e. dynamic. In DBIx::Class for instance there is also a DBIx::Class::ResultSource::View class, but I cannot see any use in it beyond deployment from ORM.
I recently made a ORM model for a SQLite3 database with a considerable number of views. Works like a charm and, thanks to database triggers as well, the application code is quite free of data-related logic and querying stuff.
|
|---|