sqlite_open_flags => "DBD::SQLite::OPEN_READONLY",You're passing a string to sqlite_open_flags, while the documented way is an exported constant:
Experiment shows that it's currently 1, but we shouldn't be relying on that value. Following the documented way, I see DBD::SQLite trying to open the file read-only:use DBD::SQLite::Constants qw/:file_open/; my $dbh = DBI->connect("dbi:SQLite:$dbfile", undef, undef, { sqlite_open_flags => SQLITE_OPEN_READONLY, });
$ strace -e trace=%file perl -MDBI -MDBD::SQLite::Constants=:file_open + -E' DBI->connect("dbi:SQLite:foo.sqlite", undef, undef, { sqlite_open_flags => SQLITE_OPEN_READONLY }); ' <...> openat(AT_FDCWD, "REDACTED/foo.sqlite", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) + <...>
In reply to Re: Making DBI with SQLite3 truly read-only
by Anonymous Monk
in thread Making DBI with SQLite3 truly read-only
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |