NAME
SQLx::Lite::ResultSet - Methods for searching and altering tables
primary_key
Sets the primary key for the current ResultSet
$rs->primary_key('id');
search
Access to the SQL SELECT query. Returns an array with the selected rows, which contains a hashref of values. First parameter is an array of what you want returned ie: SELECT this, that If you enter an empty array ([]), then it will return everything ie: SELECT * The second parameter is a hash of keys and values of what to search for.
my $res = $resultset->search([qw/name id status/], { status => 'active' });
my $res = $resultset->search([], { status => 'disabled' });
my $res = $resultset->search([], { -or => [ name => 'Test', name => 'Foo' ], status => 'active' });
insert
Inserts a new record into the current resultset.
my $insert = $resultset->insert({name => 'Foo', user => 'foo_bar', pass => 'baz'});
if ($insert) { print "Added user!\n"; }
else { print "Could not add user\n"; }