Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/62cc1e21a74b2d7a46a8fa429d6ffce9 to your computer and use it in GitHub Desktop.
Save zoffixznet/62cc1e21a74b2d7a46a8fa429d6ffce9 to your computer and use it in GitHub Desktop.
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