<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="304177" data-post-id="304177">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="warmwaffles" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/warmwaffles/120/22057_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  warmwaffles
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="D4no0" data-post="11" data-topic="58915">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/d4no0/48/33624_2.png" class="avatar"> D4no0:</div>
<blockquote>
<p>I think running migrations once again is a rather sane option, as even if there are hundreds of tables, it should be very fast.</p>
</blockquote>
</aside>
<p>Perhaps. In the current code base I am working on day to day, we have 890 migrations and rising. The quickest and best solution is to use <code>mix ecto.dump</code> and <code>mix ecto.load</code>. We aren’t using sqlite, but there <em>is</em> a limit to running migrations front to back every time a connection is checked out. You’ll definitely want to load the schema.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304177" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-304177" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304177"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="304182" data-post-id="304182">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lindem" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lindem/120/13199_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lindem
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Alright, please people, <strong>be blunt</strong>: Is there no way to use sqlite3 with phoenix liveview and ecto that is stable and solid, and does not generate tests which automatically fail <strong>today</strong>?</p>
<p>I am asking this because <a class="mention" href="/u/d4no0" rel="nofollow">@D4no0</a> explained above that there are still “a lot” of bugs.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304182" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-304182" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304182"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="304183" data-post-id="304183">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="fceruti" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/fceruti/120/28850_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  fceruti
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ve got this test case where a new random directory is created for each test, I also use it for sqlite3, but the scenario is somewhat different.</p>
<p>To cover your use case, I would:</p>
<ol>
<li>Create a database file and migrate it before running any tests. Store somewhere.</li>
<li>Modify the snippet below to copy the fresh database before every test.</li>
</ol>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyApp.SandboxCase do
  use ExUnit.CaseTemplate
  @symbols ~c"023456789abcdefghijklmnopqrst"
  @n_symbols Enum.count(@symbols)

  setup do
    rand_dir = for _ &lt;- 1..20, into: "", do: &lt;&lt;Enum.at(@symbols, :rand.uniform(@n_symbols))&gt;&gt;

    sandbox_dir = "/tmp/sandbox/#{rand_dir}/"

    pid = self()
    ref = make_ref()

    spawn_link(fn -&gt; monitor_for_cleanup(pid, ref, sandbox_dir) end)

    receive do
      {^ref, :ready} -&gt; :ok
    end

    on_exit(fn -&gt;
      File.rm_rf(sandbox_dir)
    end)

    %{sandbox_dir: sandbox_dir}
  end

  defp monitor_for_cleanup(pid, ref, path) do
    Process.flag(:trap_exit, true)
    send(pid, {ref, :ready})

    receive do
      {:DOWN, ^pid, _reason} -&gt;
        File.rm_rf(path)
    end
  end
end
**
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304183" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-304183" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304183"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="304185" data-post-id="304185">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="warmwaffles" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/warmwaffles/120/22057_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  warmwaffles
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="lindem" data-post="13" data-topic="58915">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lindem/48/13199_2.png" class="avatar"> lindem:</div>
<blockquote>
<p>Alright, please people, <strong>be blunt</strong>: Is there no way to use sqlite3 with phoenix liveview and ecto that is stable and solid, and does not generate tests which automatically fail <strong>today</strong>?</p>
</blockquote>
</aside>
<p>Test generation is not in the purview of <code>ecto_sqlite3</code> or <code>exqlite</code> that is something in <code>phoenix</code> proper. You will need to submit a PR or open an issue there about it. The <code>ecto_sqlite3</code> dependency does not provide generators.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304185" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-304185" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304185"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="304186" data-post-id="304186">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t use generators but I’m interested as I’m developing a (small) app slated for production using sqlite.</p>
<p>Are there any missing steps to reproduce?  I generated a new project and generated two contexts using <code>phx.gen.live</code>.  I copied in the routes and ran tests maybe 20 times in a row and never got a failure.  Maybe OS matters?  I’m on latest macos.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304186" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-304186" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304186"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="304187" data-post-id="304187">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="warmwaffles" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/warmwaffles/120/22057_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  warmwaffles
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="sodapopcan" data-post="16" data-topic="58915">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/48/34668_2.png" class="avatar"> sodapopcan:</div>
<blockquote>
<p>never got a failure. Maybe OS matters? I’m on latest macos.</p>
</blockquote>
</aside>
<p>This has also been my experience with it, and I’m on linux.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304187" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-304187" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304187"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="304190" data-post-id="304190">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lindem" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lindem/120/13199_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lindem
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am on linux as well. I have created the project with</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.15.4 (compiled with Erlang/OTP 25)
</code></pre>
<p>versions I used:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># Type `mix help deps` for examples and options.
  defp deps do
    [
      {:bcrypt_elixir, "~&gt; 3.0"},
      {:phoenix, "~&gt; 1.7.7"},
      {:phoenix_ecto, "~&gt; 4.4"},
      {:ecto_sql, "~&gt; 3.10"},
      {:ecto_sqlite3, "&gt;= 0.0.0"},
      {:phoenix_html, "~&gt; 3.3"},
      {:phoenix_live_reload, "~&gt; 1.2", only: :dev},
      {:phoenix_live_view, "~&gt; 0.19.0"},
      {:floki, "&gt;= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~&gt; 0.8.0"},
      {:esbuild, "~&gt; 0.7", runtime: Mix.env() == :dev},
      {:tailwind, "~&gt; 0.2.0", runtime: Mix.env() == :dev},
      {:swoosh, "~&gt; 1.3"},
      {:finch, "~&gt; 0.13"},
      {:telemetry_metrics, "~&gt; 0.6"},
      {:telemetry_poller, "~&gt; 1.0"},
      {:gettext, "~&gt; 0.20"},
      {:jason, "~&gt; 1.2"},
      {:plug_cowboy, "~&gt; 2.5"},
      {:credo, "~&gt; 1.7", only: [:dev, :test], runtime: false}
    ]
  end
</code></pre>
<p>Hmm, I can try on another machine if it happens there as well. Surprising.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304190" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-304190" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304190"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="304193" data-post-id="304193">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="warmwaffles" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/warmwaffles/120/22057_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  warmwaffles
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Can you share this project with us?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304193" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-304193" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304193"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="304199" data-post-id="304199">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lindem" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lindem/120/13199_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lindem
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have generated a fresh one, still exhibiting the problem, and put it at <a href="https://github.com/lindem/sqlite3_testsetup" class="inline-onebox" rel="noopener nofollow ugc">GitHub - lindem/sqlite3_testsetup: SQLite3 failure example application · GitHub</a></p>
<p>Thanks very much for looking into this!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304199" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-304199" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304199"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="304202" data-post-id="304202">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah ha, it’s because you didn’t pluralize your table name.  It’s throwing off the generator.</p>
<p>I was able to reproduce with:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">$ mix phx.gen.live Things Thing thing thingvalue:integer thingdescription:string
</code></pre>
<p>as in your example.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">$ mix phx.gen.live Things Thing things thingvalue:integer thingdescription:string
</code></pre>
<p>works just fine.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="304202" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/sqlite3-generators-need-plural-table-names-was-workaround-for-the-testing-sandbox/58915/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-304202" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="304202"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/58915/load_more?page=3">Load more posts (29 remaining)</a>
</div></template></turbo-stream>