diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index f9e211f..d377032 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -1011,18 +1011,26 @@ as well for finer control: my $dbh = DBI->connect("dbi:SQLite:uri=file:$path_to_dbfile?mode=rwc"); -Note that this is not for remote SQLite database connection. You only can -connect to a local database. +Note that this is not for remote SQLite database connection. You can +only connect to a local database. -You can also set sqlite_open_flags (only) when you connect to a database: +=head2 Read-Only Database - use DBD::SQLite; +You can set sqlite_open_flags (only) when you connect to a database: + + use DBD::SQLite::Constants qw/:file_open/; my $dbh = DBI->connect("dbi:SQLite:$dbfile", undef, undef, { - sqlite_open_flags => DBD::SQLite::OPEN_READONLY, + sqlite_open_flags => SQLITE_OPEN_READONLY, }); See L for details. +As of 1.49_05, you can also make a database read-only by setting +C attribute to true (only) when you connect to a database. +Actually you can set it after you connect, but in that case, it +can't make the database read-only, and you'll see a warning (which +you can hide by turning C off). + =head2 DBD::SQLite And File::Temp When you use L to create a temporary file/directory for