Skip to content

Instantly share code, notes, and snippets.

@drKreso
Created March 2, 2013 14:49
Show Gist options
  • Select an option

  • Save drKreso/5071340 to your computer and use it in GitHub Desktop.

Select an option

Save drKreso/5071340 to your computer and use it in GitHub Desktop.
use DBIish;
my $mdriver = 'Pg';
my $host = 'localhost';
my $port = 5432;
my $database = 'inframe_dev';
my $test_user = 'postgres';
my $test_password = 'blabla';
my $drh = DBIish.install_driver($mdriver);
my $drh_version = $drh.Version;
say $drh_version;
my $dbh = DBIish.connect($mdriver, :user($test_user), :password($test_password),
:$host, :$port, :$database,
RaiseError => 0, PrintError => 1, AutoCommit => 0
);
$dbh.PrintError = True;
$dbh.RaiseError = False;
$dbh.do("SELECT * from korisnici");
$dbh.disconnect();
----------
==> No such method 'execute' for invocant of type 'Nil'
in method do at lib/DBDish/Pg.pm6:379
in block at baza.pl:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment