summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
Diffstat (limited to 'README')
-rw-r--r--README26
1 files changed, 19 insertions, 7 deletions
diff --git a/README b/README
index 71623ed..9a5278f 100644
--- a/README
+++ b/README
@@ -33,13 +33,21 @@ SYNOPSIS
# retrieve objects
# using various search options
- my @objs = Users->search(email => 'foo@bar.com',{ order_by => 'id', limit => '2'});
- my @objs = Users->search_like(email => '%@bar.com',{ order_by => 'id', limit => '2'});
- my @objs = Users->search_ilike(email => '%@bar.com',{ order_by => 'id', limit => '2'});
- my @objs = Users->search_or(email => 'john.doe@bar.com', name => 'john');
- my @objs = Users->search_or_like(email => 'john.doe@%', name => '%john%');
- my @objs = Users->search_or_ilike(email => 'john.doe@%', name => '%john%');
- my @objs = Users->search_where('name in (select name from other_user_table)');
+ my @objs = ();
+ @objs = Users->search(email => 'foo@bar.com',{ order_by => 'id', limit => '2'});
+ @objs = Users->search_like(email => '%@bar.com',{ order_by => 'id', limit => '2'});
+ @objs = Users->search_ilike(email => '%@bar.com',{ order_by => 'id', limit => '2'});
+ @objs = Users->search_or(email => 'john.doe@bar.com', name => 'john');
+ @objs = Users->search_or_like(email => 'john.doe@%', name => '%john%');
+ @objs = Users->search_or_ilike(email => 'john.doe@%', name => '%john%');
+ @objs = Users->search_where('name in (select name from other_user_table)');
+ my $possibilities = [ 'foo', 'bar' ];
+ @objs = Users->search( name => $possibilities);
+ @objs = Users->search_like( name => $possibilities);
+ @objs = Users->search_ilike( name => $possibilities);
+ @objs = Users->search_or( name => $possibilities);
+ @objs = Users->search_or_like( name => $possibilities);
+ @objs = Users->search_or_ilike( name => $possibilities);
# all
my @objs = Users->retrieve_all();
# by primary column value (primary key)
@@ -172,12 +180,16 @@ METHODS
my @objs = __PACKAGE__->search(column1 => $value1, column2 => $value2);
+ Value may be a scalar or an array reference.
+
search_like
Searches the table and returns a list of matching objects using column
like $value rather than column = $value.
my @objs = __PACKAGE__->search_like(column1 => "%$value1%", column2 => "%$value2%");
+ Value may be a scalar or an array reference.
+
search_ilike
same as search_like but insensitive