perl6/DBIish/lib/DBIish

DBIish src

SYNOPSIS

 # the list is from Perl 5 DBI, uncommented is working here
 use DBIish;
 # TODO: @driver_names = DBI.available_drivers;
 # TODO: %drivers      = DBI.installed_drivers;
 # TODO: @data_sources = DBI.data_sources($driver_name, \%attr);

 $dbh = DBIish.connect($driver, :$username, :$password, |%options);

 $rv  = $dbh.do($statement);
 # TODO: $rv  = $dbh.do($statement, \%attr);
 # TODO: $rv  = $dbh.do($statement, \%attr, @bind_values);

 # TODO: $ary_ref  = $dbh.selectall_arrayref($statement);
 # TODO: $hash_ref = $dbh.selectall_hashref($statement, $key_field);

 # TODO: $ary_ref  = $dbh.selectcol_arrayref($statement);
 # TODO: $ary_ref  = $dbh.selectcol_arrayref($statement, \%attr);

 # TODO: @row_ary  = $dbh.selectrow_array($statement);
 # TODO: $ary_ref  = $dbh.selectrow_arrayref($statement);
 # TODO: $hash_ref = $dbh.selectrow_hashref($statement);

 $sth = $dbh.prepare($statement);
 # TODO: $sth = $dbh.prepare_cached($statement);

 # TODO: $rc = $sth.bind_param($p_num, $bind_value);
 # TODO: $rc = $sth.bind_param($p_num, $bind_value, $bind_type);
 # TODO: $rc = $sth.bind_param($p_num, $bind_value, \%attr);

 $rv = $sth.execute;
 $rv = $sth.execute(@bind_values);
 # TODO: $rv = $sth.execute_array(\%attr, ...);

 # TODO: $rc = $sth.bind_col($col_num, \$col_variable);
 # TODO: $rc = $sth.bind_columns(@list_of_refs_to_vars_to_bind);

 @row_ary  = $sth.fetchrow_array;
 $ary_ref  = $sth.fetchrow_arrayref;
 $hash_ref = $sth.fetchrow_hashref;

 # TODO: $ary_ref  = $sth.fetchall_arrayref;
 # TODO: $ary_ref  = $sth.fetchall_arrayref( $slice, $max_rows );

 # TODO: $hash_ref = $sth.fetchall_hashref( $key_field );

 $rv  = $sth.rows;

 # TODO: $rc  = $dbh.begin_work;
 # TODO: $rc  = $dbh.commit;
 # TODO: $rc  = $dbh.rollback;

 # TODO: $quoted_string = $dbh.quote($string);

 # TODO: $rc  = $h.err;
 $str = $h.errstr;
 # TODO: $rv  = $h.state;

 $rc  = $dbh.disconnect;

 
The (Perl 5) synopsis above only lists the major methods and parameters.

DESCRIPTION

The name DBIish has two meanings. In lowercase it indicates the github project being used for development. In mixed case it is the module name and class name that database client applications should use.

DBIish CLASSES and ROLES

(head2) DBIish
The DBIish class exists mainly to provide the F<connect> method, which acts as a constructor for database connections.
(head2) DBDish
The DBDish role should only be used with 'does' to provide standard members for DBDish classes.

SEE ALSO

L<http://dbi.perl.org>

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: