Created
June 22, 2016 03:41
-
-
Save zoffixznet/62cc1e21a74b2d7a46a8fa429d6ffce9 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
unit class Ticket::Trakr::Tickets; | |
use DBIish; | |
use Config::From; | |
use RT::Client::REST:from<Perl5>; | |
has Str $.db-file; | |
has Str $.rt-user; | |
has Str $.rt-pass; | |
has DBDish::Driver $!dbh = do { | |
my $dbh = DBIish.connect: "SQLite", :database($!db-file); | |
unless $!db-file.IO.s { | |
$dbh.do: q:to/END_SQL/; | |
CREATE TABLE tickets ( | |
id INT UNSIGNED PRIMARY KEY, | |
date DATE, | |
status TEXT | |
); | |
END_SQL | |
} | |
$dbh; | |
}; | |
method all { | |
# given $!dbh.prepare: 'SELECT * FROM tickets ORDER BY date DESC' { | |
# .execute; | |
# return .allrows: :hash; | |
# } | |
} | |
method update { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment