SHARE
TWEET

Does Parrot have a database interface or API

a guest Feb 28th, 2012 15 Never
  1. use DBDI;
  2. my $conn = DBDI::DriverManager.getConnection(
  3.     "dbdi:SQLite3:test.db", "", "");
  4. my $stm = $conn.createStatement();
  5. my $rs = $stm.executeUpdate("CREATE TABLE foo (bar, baz)");
  6. my $stm = $conn.prepareStatement(
  7.     "    INSERT INTO foo (bar, baz) VALUES (?, ?)");
  8. $stm.setColumn(1, 123);
  9. $stm.setColumn(2, "Thingy");
  10. $stm.executeUpdate();
  11.        
  12. $conn.prepareStatement( Q:sql<INSERT INTO foo (bar, baz) VALUES($bar, $baz)> );
RAW Paste Data
Top