Matt S Trout wrote:

>A. Pagaltzis wrote:
>  
>
>>>__PACKAGE__->set_sql("delete_all", <<"");
>>>DELETE FROM __TABLE__ WHERE 1=1
>>>      
>>>
>>Note that you can omit that `WHERE` clause completely. It’s legal
>>syntax to say `DELETE FROM $table`.
>>    
>>
>
>Which is exactly what DBIx::Class will do given the code snippet in my last 
>message :)
>
>  
>
Hmm -- I'm not sure if I had a good reason for the WHERE 1=1, although I
think I tried it without first.

Maybe it was needed to stop CDBI putting a where clause in, or maybe it
was superstition, or I just thought it looked big and clever? Thanks for
your input -- it's all helpful to me!

Elsewhere, Matt S T wrote:

> Right. DBIC makes this easier for main usage by allowing schema objects 
(multiple connections per class tree :D).

Yup, I like that, and also the slightly more obvious class/instance
seperation in DBIxC vs CDBI. (As much as I find any Perl "obvious", anyway.)

Also like that I can swap between DBs (SQLite -> MSSQL) just by changing
the DSN, in CDBI I was using a different base class to get the autoinc
columns working.

However, it's a bit slow joining all the DBIxC bits together in my head
-- is there a class diagram somewhere? [not sure if I'm joking or not :-/ ]

Steven


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to