Skip to content

Commit 834c05a

Browse files
committed
add :readonly_nomutex opt to open_opt type.
1 parent cebca00 commit 834c05a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/exqlite/sqlite3.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defmodule Exqlite.Sqlite3 do
1919
@type statement() :: reference()
2020
@type reason() :: atom() | String.t()
2121
@type row() :: list()
22-
@type open_opt :: {:mode, :readwrite | :readonly}
22+
@type open_opt :: {:mode, :readwrite | :readonly | :readonly_nomutex}
2323

2424
@doc """
2525
Opens a new sqlite database at the Path provided.

test/exqlite/sqlite3_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ defmodule Exqlite.Sqlite3Test do
5353
Sqlite3.execute(ro_conn, insert_value_query)
5454
end
5555

56-
test "opens a database in sqlite_open_nomutex mode" do
56+
test "opens a database in readonly_nomutex mode" do
5757
# Create database with readwrite connection
5858
{:ok, path} = Temp.path()
5959
{:ok, rw_conn} = Sqlite3.open(path)
@@ -64,7 +64,7 @@ defmodule Exqlite.Sqlite3Test do
6464
insert_value_query = "insert into test (stuff) values ('This is a test')"
6565
:ok = Sqlite3.execute(rw_conn, insert_value_query)
6666

67-
# Read from database with a readonly connection
67+
# Read from database with a readonly_nomutex connection
6868
{:ok, ro_conn} = Sqlite3.open(path, mode: :readonly_nomutex)
6969

7070
select_query = "select id, stuff from test order by id asc"
@@ -73,7 +73,7 @@ defmodule Exqlite.Sqlite3Test do
7373

7474
assert [1, "This is a test"] == columns
7575

76-
# Readonly nomutex connection cannot insert
76+
# Readonly nomutex connection cannot insert
7777
assert {:error, "attempt to write a readonly database"} ==
7878
Sqlite3.execute(ro_conn, insert_value_query)
7979
end

0 commit comments

Comments
 (0)