<commit_before>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.bind(1, 123);
$stm.bind(2, "Thingy");
$stm.executeUpdate();

my $stm2 = $conn.createStatement();
my $rs = $stm2.executeQuery("SELECT baz, bar FROM foo");
while ($rs.next()) {
    say $rs.getCol(1);
    say $rs.getCol("baz");
}<commit_msg>Andy makes some test fairy notes<commit_after># Andy the time-strapped test fairy says:
# If this were Perl 5, I'd put in tests roughly like the following:
use DBDI;
my $conn = DBDI::DriverManager.getConnection("dbdi:SQLite3:test.db", "", "");
### isa_ok($conn, 'DBDI::DriverManager');
my $stm = $conn.createStatement();
### isa_ok($stm, 'DBDI::Statement');
my $rs = $stm.executeUpdate("CREATE TABLE foo (bar, baz)");
### ok( $rs->success, 'Created foo OK');
### I'd also add a test that a SELECT works and returns 0 rows

my $stm = $conn.prepareStatement("INSERT INTO foo (bar, baz) VALUES (?, ?)");
### isa_ok( $stm, 'DBDI::PreparedStatement');
$stm.bind(1, 123);
$stm.bind(2, "Thingy");
$stm.executeUpdate();
### is( $stm->rowsAffected, 1, 'Inserted one row' );

my $stm2 = $conn.createStatement();
my $rs = $stm2.executeQuery("SELECT baz, bar FROM foo");
while ($rs.next()) {
    say $rs.getCol(1);
    say $rs.getCol("baz");
}
### Check that we got back exactly one row.
{'fraction_non_alphanumeric': 0.20468227424749164, 'fraction_numerical': 0.014046822742474917, 'mean_word_length': 5.3931623931623935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3698935', 'n_tokens_mistral': 570, 'n_tokens_neox': 559, 'n_words': 152}