[sqlite] DBI-connect doesn't fail if no DB

2012-02-02 Thread Bill McCormick

In the following statement ...

my $dbh = DBI-connect(dbi:SQLite:dbname=$dbfile,,) or croak 
$DBI::errstr;


if $dbfile does not exist, it is created. I would like to croak if this 
happens.


Is there some option for this?

Thanks!!


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DBI-connect doesn't fail if no DB

2012-02-02 Thread Puneet Kishor

On Feb 2, 2012, at 2:18 PM, Bill McCormick wrote:

 In the following statement ...
 
my $dbh = DBI-connect(dbi:SQLite:dbname=$dbfile,,) or croak 
 $DBI::errstr;
 
 if $dbfile does not exist, it is created. I would like to croak if this 
 happens.
 
 Is there some option for this?
 

I don't think so. You could simply check for the existence of the file before 
you connect

croak I am dying unless -e $dbfile;
my $dbh etc. etc.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users