Help with :memory: SQLite3 databases through DBI

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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
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

However, this doesn't work, and I crash on that connect statement with
the following error message

Can't locate auto/DBI/ in @INC (@INC contains: /Volumes/
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/ 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

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,


Re: Help with :memory: SQLite3 databases through DBI

Quoted text here. Click to load it

Case matters.  DBI->connect is not the same as DBI->Connect.

Quoted text here. Click to load it

No, it doesn't.

Paranoid Club meeting this Friday.  Now ... just try to find out where!

Re: Help with :memory: SQLite3 databases through DBI

Quoted text here. Click to load it

Maybe it's because "connect" and "Connect" aren't the same
thing? :memory: works fine.

Site Timeline