views:

172

answers:

2

A quick search gave me this announcement of Parrot DBDI from January 2004 and a dbdi-dev mailing list which appears to be long dead. Is Parrot DBDI still being developed? Is anyone working on a different database API or interface for Parrot?

+1  A: 

From the DBI::Roadmap 1.607 manual, dated Nov 2004:

The bulk of the work will be translating the DBI C and Perl base class code into Parrot PIR, or a suitable language that generates PIR. The project stalled, due to Parrot not having key functionality at the time. That has been resolved but the project has not yet restarted.

This post from Darren Duncan in May 2005:

I believe it will start up again very soon now. See, a number of the main missing prerequisites are now coming online, and so with those in place we can start work.

I can't find anything more recent than that. Parrot itself is kind of glacial in its progress, so perhaps to remain compatible with the Parrot platform, DBDI is too. :-)

Bill Karwin
+1  A: 

DBDI was an effort to create a database driver interface like the current DBI and DBD modules. It died, so developers are now using an existing interface instead - the Java JDBI. Two such developers are Tim Bunce (who worked on DBI 1, but hasn't had much time to work on its sequel) and Simon Cozens:

http://perlbuzz.com/2008/12/database-access-in-perl-6-is-coming-along-nicely.html

use DBDI;
my $conn = DBDI::DriverManager.getConnection(
    "dbdi:SQLite3:test.db", "", "");
my $stm = $conn.createStatement();
my $rs = $stm.executeUpdate("CREATE TABLE foo (bar, baz)");
my $stm = $conn.prepareStatement(
    "    INSERT INTO foo (bar, baz) VALUES (?, ?)");
$stm.setColumn(1, 123);
$stm.setColumn(2, "Thingy");
$stm.executeUpdate();

This module should be available to all Parrot languages, not just Perl 6.


Actually for Perl 6 we'll probably see an SQL quote operator so you can do stuff like this:

$conn.prepareStatement( Q:sql<INSERT INTO foo (bar, baz) VALUES($bar, $baz)> );

And of course in Perl 6 quote modifiers like Q:sql can be abbreviated, e.g. to qs<> or sql<>

rjh