J
Jean-Denis Muys
Hello,
I initially posted this in comp.lang.perl.modules, and then I realized
it may not have been the right place. I apologize for the cross
posting.
I am quite a newbie, and maybe this is easy, but I tried to google for
it for quite a long time to no avail. This may be at least partially
because it's not easy to have Google accept colons in search strings.
Anyhow, here goes:
I want to use SQLite3 from my Perl code. I use DBI, just because it's
seems the no-brainer choice.
My code uses a temporary database and works fine with a regular DBI
connect statement:
my $dbh = DBI->connect("dbi:SQLite:dbname=DBItest.db","", "",
{ RaiseError => 1, AutoCommit => 1 });
Now I want to test it with in-memory databases, that SQLite3 creates
when it is given as the database name the special string ":memory:"
my $dbh = DBI->Connect('dbi:SQLite:dbname=:memory:'); #
in-memory database
However, this doesn't work, and I crash on that connect statement
with
the following error message
Can't locate auto/DBI/Connect.al in @INC (@INC contains: /Volumes/
BLeopard/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Perl.tmbundle/Support /System/Library/Perl/5.8.8/darwin-thread-
multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-
thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/
Library/
Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /
Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-
multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /
Library/Perl/5.8.1 .) at /Volumes/Prune/DBItest.pl line 26
Again, to me the error message is rather puzzling as the exact same
code works in the case of a filename with no colons.
My hypotheses is that maybe the colons are screwing the connect
statement, since the connect statement itself uses colons as a
separator.
Either way, everything I tried failed, including silly things like
varying additional connect parameters or string delimitors.
Does DBI support in-memory SQLite3 databases? If so, how? Otherwise,
are there any alternative?
My configuration: MacOS X 10.5.6, Perl 5.8.8, DBI 1.5.2.
Many many thanks,
Jean-Denis
I initially posted this in comp.lang.perl.modules, and then I realized
it may not have been the right place. I apologize for the cross
posting.
I am quite a newbie, and maybe this is easy, but I tried to google for
it for quite a long time to no avail. This may be at least partially
because it's not easy to have Google accept colons in search strings.
Anyhow, here goes:
I want to use SQLite3 from my Perl code. I use DBI, just because it's
seems the no-brainer choice.
My code uses a temporary database and works fine with a regular DBI
connect statement:
my $dbh = DBI->connect("dbi:SQLite:dbname=DBItest.db","", "",
{ RaiseError => 1, AutoCommit => 1 });
Now I want to test it with in-memory databases, that SQLite3 creates
when it is given as the database name the special string ":memory:"
my $dbh = DBI->Connect('dbi:SQLite:dbname=:memory:'); #
in-memory database
However, this doesn't work, and I crash on that connect statement
with
the following error message
Can't locate auto/DBI/Connect.al in @INC (@INC contains: /Volumes/
BLeopard/Applications/TextMate.app/Contents/SharedSupport/Bundles/
Perl.tmbundle/Support /System/Library/Perl/5.8.8/darwin-thread-
multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-
thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/
Library/
Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /
Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-
multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /
Library/Perl/5.8.1 .) at /Volumes/Prune/DBItest.pl line 26
Again, to me the error message is rather puzzling as the exact same
code works in the case of a filename with no colons.
My hypotheses is that maybe the colons are screwing the connect
statement, since the connect statement itself uses colons as a
separator.
Either way, everything I tried failed, including silly things like
varying additional connect parameters or string delimitors.
Does DBI support in-memory SQLite3 databases? If so, how? Otherwise,
are there any alternative?
My configuration: MacOS X 10.5.6, Perl 5.8.8, DBI 1.5.2.
Many many thanks,
Jean-Denis