@@ -82,6 +82,9 @@ defmodule Exqlite.Connection do
8282
8383 * `:database` - The path to the database. In memory is allowed. You can use
8484 `:memory` or `":memory:"` to designate that.
85+ * `:mode` - use `:readwrite` to open the database for reading and writing
86+ or `:readonly` to open it in read-only mode. `:readwrite` will also create
87+ the database if it doesn't already exist. Defaults to `:readwrite`.
8588 * `:journal_mode` - Sets the journal mode for the sqlite connection. Can be
8689 one of the following `:delete`, `:truncate`, `:persist`, `:memory`,
8790 `:wal`, or `:off`. Defaults to `:delete`. It is recommended that you use
@@ -450,7 +453,7 @@ defmodule Exqlite.Connection do
450453
451454 defp do_connect ( path , options ) do
452455 with :ok <- mkdir_p ( path ) ,
453- { :ok , db } <- Sqlite3 . open ( path ) ,
456+ { :ok , db } <- Sqlite3 . open ( path , options ) ,
454457 :ok <- set_key ( db , options ) ,
455458 :ok <- set_journal_mode ( db , options ) ,
456459 :ok <- set_temp_store ( db , options ) ,
0 commit comments