Skip to content

Commit

Permalink
memory won't work here anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Jul 21, 2023
1 parent f1a1d76 commit e9e2d95
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/exqlite/rw_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@ defmodule Exqlite.RWConnection do
@impl true
def init(options) do
database = Keyword.fetch!(options, :database)
one_db? = options[:mode] == :readonly or database in [:memory, ":memory:"]

if database in [:memory, ":memory:"] do
raise "#{database} is not supported in #{__MODULE__}"
end

open_result =
if one_db? do
if options[:mode] == :readonly do
with {:ok, db} <- open_and_configure(database, options), do: {:ok, db, db}
else
read_options = Keyword.put(options, :mode, :readonly)
Expand Down

0 comments on commit e9e2d95

Please sign in to comment.