tag:blogger.com,1999:blog-3095960273340541911.post6341313635209702245..comments2023-07-08T09:00:52.417-07:00Comments on Software Engineer of Danger: How much milage do you get with SQL::Abstract?Anonymoushttp://www.blogger.com/profile/08250667223130135379noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-3095960273340541911.post-75463966437163350092012-03-01T09:35:47.685-08:002012-03-01T09:35:47.685-08:00It's not very useful. The functionality is so...It's not very useful. The functionality is so limited: no joins! Instead, I use Rose::DB::Object::QueryBuilder, which does not require anything else from Rose::DB::Object to work. It generates nicely formatted SQL from complicated sets of conditions, and handles join, group by, etc.Perrin Harkinsnoreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-52965069558521839302012-02-27T14:15:05.517-08:002012-02-27T14:15:05.517-08:00In Dancer::Plugin::SQLSearch, search queries are b...In Dancer::Plugin::SQLSearch, search queries are broken into words which are assembled into a data structure suitable for SQL::Abstract. SQLA allows the plugin to be general, as it does not have to know much about the database to build the data structure.<br />More over, producing SQL::Abstract makes the plugin ORM agnostic. I normally feed this data structure to DBIx::DataModel, but you can do the same with DBIx::Class or straight into SQL::Abstract and issue the query yourself.Julio Frairehttps://www.blogger.com/profile/00625290022239194892noreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-91996922650811195192012-02-26T19:33:03.532-08:002012-02-26T19:33:03.532-08:00For me it is a godsend for conditionally building ...For me it is a godsend for conditionally building sql. For example you've got something like:<br /><br /># assuming Data::FormValidator<br />if ( $dfv->{date} ) {<br /> $sql .= ' AND date = ?';<br /> push @sqlparams, $c->param->{date}<br />}<br /><br />A lot of times I can just give my dfv results right to sqla, sometimes giving a benefit of hundreds of lines of code. For me fewer lines of code == fewer bugs.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-13071117265212645142012-02-25T09:07:58.903-08:002012-02-25T09:07:58.903-08:00All my applications rely heavily on DBIx::DataMode...All my applications rely heavily on DBIx::DataModel, which is another ORM that also depends on SQLA, like DBIx::Class. <br /><br />The great thing about SQLA is not about avoiding to type SQL; it is about building queries dynamically, depending on some input that may come from config files, user forms, or whatever. Think of a generalized search form within your app : the user fills some search criteria, checks some boxes to decide which columns to retrieve, and the whole datastructure received from the HTML form can be given (almost) as is to SQLA in order to generate a database querydamihttps://www.blogger.com/profile/05175840149225722194noreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-31244139298853756922012-02-24T08:51:40.596-08:002012-02-24T08:51:40.596-08:00You can use it to store complex query logic that y...You can use it to store complex query logic that you don't want to have to figure out again.<br /><br />https://gist.github.com/1901932<br /><br />Because of the 'sellable' method, I don't have to figure out what defines a sellable ticket every time. If someone comes along and decides to add more criteria to what is a sellable ticket, you only have to update the 'sellable' method instead of updating queries.Mikehttps://github.com/HolyCownoreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-73340666580285745862012-02-24T06:51:10.996-08:002012-02-24T06:51:10.996-08:00I use SQLA (through DBIC) to do the boring bits of...I use SQLA (through DBIC) to do the boring bits of SQL that I would have to do for every single table, leaving me with the interesting bits that require thought or special DB-specific queries. I don't like copy/pasting 12 different tables' worth of "SELECT"/get(), "INSERT"/new(), "UPDATE"/set(), "DELETE"/delete(), and I won't write my own abstraction when one already exists.preactionhttp://blogs.perl.org/users/preactionnoreply@blogger.comtag:blogger.com,1999:blog-3095960273340541911.post-19237438390320969212012-02-23T21:39:21.958-08:002012-02-23T21:39:21.958-08:00I only use it via DBIx::Class which has a few othe...I only use it via DBIx::Class which has a few other things such as reconnect on lost connection and cheap random pooling for replication.Anonymoushttps://www.blogger.com/profile/08185254298048097278noreply@blogger.com