Skip to content

Commit 955edd8

Browse files
committed
use :prefix to query attached databases
https://www.sqlite.org/lang_attach.html the prefixed table name is intentionally not quoted because statements expect a bare qualifier without quotes like `INSERT INTO schema-name.table-name` blah
1 parent 2f9a6ff commit 955edd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ecto/adapters/sqlite3/connection.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,8 +1945,8 @@ defmodule Ecto.Adapters.SQLite3.Connection do
19451945

19461946
defp quote_table(nil, name), do: quote_entity(name)
19471947

1948-
defp quote_table(prefix, _name) when is_atom(prefix) or is_binary(prefix) do
1949-
raise ArgumentError, "SQLite3 does not support table prefixes"
1948+
defp quote_table(prefix, name) when is_atom(prefix) or is_binary(prefix) do
1949+
"#{prefix}.#{name}"
19501950
end
19511951

19521952
defp quote_table(_, name), do: quote_entity(name)

0 commit comments

Comments
 (0)