From 6f3eb5ebe6371022c36c8edd91bcf507e0fd656d Mon Sep 17 00:00:00 2001 From: Gary Rennie Date: Tue, 24 Oct 2023 17:05:33 +0100 Subject: [PATCH] Document that an in-memory database can be destroyed if a process dies More details are available at: https://github.com/elixir-sqlite/ecto_sqlite3/issues/134 --- lib/ecto/adapters/sqlite3.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ecto/adapters/sqlite3.ex b/lib/ecto/adapters/sqlite3.ex index 69c065a..da6fb19 100644 --- a/lib/ecto/adapters/sqlite3.ex +++ b/lib/ecto/adapters/sqlite3.ex @@ -99,6 +99,14 @@ defmodule Ecto.Adapters.SQLite3 do is encouraged to also view the guidance on [when to use SQLite][4] provided by the SQLite documentation, as well. + ### In memory robustness + + When using the Ecto SQLite3 adapter with the database set to `:memory` it + is possible that a crash in a process performing a query in the Repo will + cause the database to be destroyed. This makes the `:memory` function + unsuitable when it is expected to survive potential process crashes (for + example a crash in a Phoenix request) + ### Async Sandbox testing The Ecto SQLite3 adapter does not support async tests when used with