Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SQL made Easy in Perl 6 (abandoned and broken.)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 .gitignore
Octocat-spinner-32 META.info
Octocat-spinner-32 README
Octocat-spinner-32 update-todo.sh
README
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 = Esquel.new;
  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);
  $sth.execute(|@bind);
  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 = Esquel::DBI.new($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.