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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="staymetal" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  staymetal
                    <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>Nexus 5 - armv7</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="67195" data-batch-url="/posts/batch_likers">
                        3
                      </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/how-to-configure-phoenix-for-sqlite/11862/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-67195" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="67195"
                     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="346468" data-post-id="346468">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="sergio" data-post="3" data-topic="11862">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sergio/48/26966_2.png" class="avatar"> sergio:</div>
<blockquote>
<p>check out this link: <a href="http://twentyeighttwelve.com/creating-a-phoenix-framework-application-with-sqlite/" class="inline-onebox" rel="noopener nofollow ugc">Twenty Eight Twelve - Creating a Phoenix Framework Application with SQLite</a></p>
</blockquote>
</aside>
<p>That solution has bit rot; the packages it recommends are no longer maintained and pin some shared dependencies with Phoenix which have since undergone breaking updates, so you’ll get an error like this:</p>
<blockquote>
<p>Because <code>phoenix_live_dashboard &gt;= 0.5.0</code> depends on <code>ecto ~&gt; 3.6.2 or ~&gt; 3.7</code> and <code>sqlite_ecto &gt;= 1.0.0 and &lt; 1.1.0</code> depends on <code>ecto ~&gt; 1.0</code>, <code>phoenix_live_dashboard &gt;= 0.5.0</code> is incompatible with <code>sqlite_ecto &gt;= 1.0.0 and &lt; 1.1.0</code>.<br>
And because your app depends on <code>phoenix_live_dashboard ~&gt; 0.8.3</code>, <code>sqlite_ecto &gt;= 1.0.0 and &lt; 1.1.0</code> is forbidden.<br>
So, because your app depends on <code>sqlite_ecto ~&gt; 1.0.0</code>, version solving failed.</p>
</blockquote>
<hr>
<p>Here’s the solution for OP’s request in 2024, for posterity / because this thread is still floating to the top of Google:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># in mix.exs
defp deps do
    [
      …
      {:ecto_sqlite3, "~&gt; 0.17.4"},
      …
    ]
  end
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># in config/dev.exs
config :myApp, MyApp.Repo,
  adapter: Ecto.Adapters.SQLite3,
  database: "./dev.db",
  stacktrace: true,
  show_sensitive_data_on_connection_error: true
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># in config/test.exs
config :myApp, MyApp.Repo,
  adapter: Ecto.Adapters.SQLite3,
  database: "./test#{System.get_env("MIX_TEST_PARTITION")}.db",
  pool: Ecto.Adapters.SQL.Sandbox,
  pool_size: System.schedulers_online() * 2
</code></pre>
<pre data-code-wrap="elixir"><code class="lang-elixir"># in lib/myApp/repo.ex
defmodule MyApp.Repo do
  use Ecto.Repo,
    otp_app: :myApp,
    adapter: Ecto.Adapters.SQLite3
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="346468" data-batch-url="/posts/batch_likers">
                        3
                      </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/how-to-configure-phoenix-for-sqlite/11862/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-346468" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="346468"
                     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="346470" data-post-id="346470">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Phoenix can generate that with <code>mix phx.new --database sqlite3</code>. No need to manually do that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="346470" 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/how-to-configure-phoenix-for-sqlite/11862/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-346470" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="346470"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="346592" data-post-id="346592">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I facing some difficult in production mode when using sqlite3, heres my step in vps production, still need help does it all righ the url database sqlite3 or not</p>
<ol>
<li>export SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</li>
<li>export DATABASE_URL=ecto://var/www/myweb.com/myweb/myapp_prod.db</li>
<li>mix deps.get --only prod</li>
<li>MIX_ENV=prod mix compile</li>
<li>MIX_ENV=prod mix assets.deploy</li>
<li>PORT=4000 MIX_ENV=prod mix phx.server</li>
</ol>
<p>At the end when hit enter after typing the number 6 command, my production code showing error like this :</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">23:49:12.502 [notice] Application mywebapp exited: Myweb.Application.start(:normal, []) returned an error: shutdown: failed to start child: Myweb.Repo
    ** (EXIT) an exception was raised:
        ** (Ecto.InvalidURLError) invalid URL ecto://var/www/myweb.com/mywebapp/mywebdb_prod.db, path should be a database name. The parsed URL is: %URI{scheme: "ecto", authority: "var", userinfo: nil, host: "var", port: nil, path: "/www/myweb.com/mywebapp/mywebdb_prod.db", query: nil, fragment: nil}
            (ecto 3.12.4) lib/ecto/repo/supervisor.ex:111: Ecto.Repo.Supervisor.parse_url/1
            (ecto 3.12.4) lib/ecto/repo/supervisor.ex:29: Ecto.Repo.Supervisor.init_config/4
            (ecto 3.12.4) lib/ecto/repo/supervisor.ex:190: Ecto.Repo.Supervisor.init/1
            (stdlib 6.1.2) supervisor.erl:869: :supervisor.init/1
            (stdlib 6.1.2) gen_server.erl:2229: :gen_server.init_it/2
            (stdlib 6.1.2) gen_server.erl:2184: :gen_server.init_it/6
            (stdlib 6.1.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
** (exit) :terminating
    (kernel 10.1.1) application_controller.erl:511: :application_controller.call/2
    (kernel 10.1.1) application.erl:367: :application."-ensure_all_started/3-lc$^0/1-0-"/1
    (kernel 10.1.1) application.erl:367: :application.ensure_all_started/3
    (mix 1.17.3) lib/mix/tasks/app.start.ex:72: Mix.Tasks.App.Start.start/3
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.3) lib/mix/tasks/run.ex:129: Mix.Tasks.Run.run/5
    (mix 1.17.3) lib/mix/tasks/run.ex:85: Mix.Tasks.Run.run/1
    (mix 1.17.3) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
</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="346592" 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/how-to-configure-phoenix-for-sqlite/11862/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-346592" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="346592"
                     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="346600" data-post-id="346600">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>An easy way to check the config would be to create a side project with --database sqlite3.</p>
<p>You would see DATABASE_URL is not used, but DATABASE_PATH</p>
<p>You would find this code…</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  database_path =
    System.get_env("DATABASE_PATH") ||
      raise """
      environment variable DATABASE_PATH is missing.
      For example: /etc/kokolite/kokolite.db
      """
</code></pre>
<p>Which means You need to adapt your config/runtime.exs to sqlite3</p>
<aside class="quote no-group" data-username="ariandanim" data-post="15" data-topic="11862">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ariandanim/48/27715_2.png" class="avatar"> ariandanim:</div>
<blockquote>
<p>PORT=4000 MIX_ENV=prod mix phx.server</p>
</blockquote>
</aside>
<p>No, it is really not the way to start a release… You need to set all the required env variables and use the release script.</p>
<p>Once You know how to start the release, You’ll need to write a service script for systemd, if You are on Linux.</p>
<p>It’s hard to deploy a release, but only the first time…</p>
<p>Then, You’ll learn that deploying nodes in a cluster is even much harder <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="346600" data-batch-url="/posts/batch_likers">
                        2
                      </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/how-to-configure-phoenix-for-sqlite/11862/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-346600" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="346600"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>