Created
November 18, 2019 21:43
-
-
Save cjac/97177ebedfbbf3d6672b882f5f806aec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
use v6; | |
use DBIish; | |
my $password="password"; | |
my $dbh = DBIish.connect('mysql', :database<grammar>, :user<grammaradm>, :$password); | |
say "connect completed"; | |
my $sth = $dbh.prepare(q:to/STATEMENT/); | |
SELECT id, word, cat_id | |
FROM lexeme | |
ORDER by word | |
STATEMENT | |
say "prepare completed"; | |
$sth.execute(); | |
my @rows = $sth.allrows(); | |
say "fetched all rows"; | |
say "row count: " ~ @rows.elems; | |
$sth.finish; | |
$dbh.dispose; | |
---- | |
connect completed | |
prepare completed | |
fetched all rows | |
row count: 72 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment