diff options
Diffstat (limited to 'lib/PublicInbox/Over.pm')
-rw-r--r-- | lib/PublicInbox/Over.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index 07e54b64..30f2603f 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -15,7 +15,11 @@ use Compress::Zlib qw(uncompress); sub dbh_new { my ($self) = @_; my $ro = ref($self) eq 'PublicInbox::Over'; - my $dbh = DBI->connect("dbi:SQLite:dbname=$self->{filename}",'','', { + my $f = $self->{filename}; + if (!$ro && !-f $f) { # SQLite defaults mode to 0644, we want 0666 + open my $fh, '+>>', $f or die "failed to open $f: $!"; + } + my $dbh = DBI->connect("dbi:SQLite:dbname=$f",'','', { AutoCommit => 1, RaiseError => 1, PrintError => 0, |