Skip to content
SQL made Easy in Perl 6 (abandoned and broken.)
Perl6 Perl Shell
Failed to load latest commit information.
README A few fixes, and a non-working version of Esquel::DBI and JD. Oct 29, 2011


Esquel -- An Object-Oriented SQL Library for Perl 6

NOTE: This is a work in progress, not everything is completed or tested yet.
      The Esquel::DBI module hasn't even been started.
      When it's done, I'll be moving onto Oharem (see doc/oharem.txt)
      Oh, and until Rakudo "nom" is fixed, and MiniDBI is ported to it,
      the Esquel::DBI library will only work on the "ng" branch of Rakudo.

A simple way to generate SQL statements using native Perl 6 calls.
Inspired by SQL::Abstract from Perl 5.

For example (using the MiniDBI interface):

  my $sql =;
  my ($stmt, @bind) = $sql.bind.from($table).where(:$id).select('name', 'job');
  ## SELECT name, job FROM $table WHERE id = $id;
  my $sth = $dbh.prepare($stmt);
  my $result = $sth.fetchrow_hashref;
  say "{$result<name>} is a {$result<job>}";

For an even simpler interface (but assuming a DBI-compatible library)
you can use the Esquel::DBI wrapper, which turns the above into:

  ## Pass it the DBH object returned from a connect() call.
  my $db =$dbh);
  my $result = $db.where(:$id).select('name', 'job').row;
  say "{$result<name>} is a {$result<job>}";

Author: Timothy Totten
License: Artistic License 2.0

Something went wrong with that request. Please try again.