help using SQLite3 in-memory databases (through DBI)

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

Threaded View

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

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
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/
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 using SQLite3 in-memory databases (through DBI)

Quoted text here. Click to load it

My own followup: I upgraded all my CPAN modules. DBI is now at version
1.607, and DBD::SQLite is now at 1.14.

I get exactly the same behaviour.

Also, this page on SQLite web site suggests exactly what I am doing:

So I'm still lost.

If anybody out there had an idea...

Thanks again.


Re: help using SQLite3 in-memory databases (through DBI)

Quoted text here. Click to load it

Silly me. "Connect" should have been "connect". (lower case 'c').

I apologize for the waste of bandwidth and of your attention.


Site Timeline