$schema->resultset('User')->search({GroupId => 712})->delete; On 28 August 2014 13:01, Sheeju Alex <sheeju...@gmail.com> wrote: > Hi All, > > Is there any way in DBIx to delete all rows from resultset in a single > query, it looks like delete and delete_all will delete the resultset row by > row. > > my $rs = $schema->resultset('User')->search({GroupId => 712}); > $rs->delete_all; > > If there are 100 Users in User table then the above statement will delete in > 100 query instead is there a way to delete in single query. > > DELETE FROM User WHERE GroupId = 712; > > > Best Regards, > Sheeju Alex > > _______________________________________________ > List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class > IRC: irc.perl.org#dbix-class > SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ > Searchable Archive: > http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk