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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/outlog" rel="nofollow">@outlog</a> <a class="mention" href="/u/lambrospetrou" rel="nofollow">@lambrospetrou</a> Thanks for the mention. I have a <a href="https://github.com/scouten/sqlite_ecto2#help-wanted" rel="noopener nofollow ugc">“help wanted” section in the README</a> in which I describe what work I think remains to bring sqlite_ecto2 from its current prerelease state to something we could legitimately call a 2.0.0 release.</p>
<p>PRs welcome!</p>
<p><a class="mention" href="/u/sotojuan" rel="nofollow">@sotojuan</a> I agree (which is why I started this project <img src="https://forum.elixirforum.com/images/emoji/apple/smile.png?v=15" title=":smile:" class="emoji" alt=":smile:" loading="lazy" width="20" height="20">). One caveat that isn’t (yet) in the README: You really should avoid using SQLite in any context where you are deploying as a cluster (unless there is a single database node in the cluster). Since SQLite works with its database stored as a local file rather than communicating over-the-wire with an independent database server, each machine in the cluster would wind up operating on independent versions of the data. Certain doom awaits.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="29994" 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/so-what-is-the-problem-with-sqlite/1602/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-29994" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="29994"
                     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 #21"></div>
  </section>
</div>
    <div class="postbit" id="123508" data-post-id="123508">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>SQLite is a good choice for  the IOT (such as the raspberry pi) devices that don’t need a full blown database.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123508" 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/so-what-is-the-problem-with-sqlite/1602/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-123508" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123508"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="123593" data-post-id="123593">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="axelson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/120/26351_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  axelson
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Scenic Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Very true! Indeed <a class="mention" href="/u/connorrigby" rel="nofollow">@ConnorRigby</a> who is the current maintainer of <a href="https://github.com/elixir-sqlite/sqlite_ecto2" class="inline-onebox" rel="nofollow">GitHub - elixir-sqlite/sqlite_ecto2: Sqlite3 adapter for Ecto 2.2.x · GitHub</a> often uses it on Nerves based systems running on devices like the Raspberry PI <a href="https://nerves-project.org/" rel="nofollow">https://nerves-project.org/</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123593" 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/so-what-is-the-problem-with-sqlite/1602/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-123593" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123593"
                     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 #23"></div>
  </section>
</div>
    <div class="postbit" id="123601" data-post-id="123601">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConnorRigby" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ConnorRigby/120/5964_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConnorRigby
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Nerves Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>SQLite is an A+ option for Nerves in my opinion. Unfortunately the adapter needs a bit of love for Ecto2 as well as work for Ecto3. That said i use it in production today and it’s a great library once you understand what it’s use cases are.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="123601" 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/so-what-is-the-problem-with-sqlite/1602/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-123601" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="123601"
                     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 #24"></div>
  </section>
</div>
    <div class="postbit" id="222046" data-post-id="222046">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>ecto_sqlite3 didn’t end up causing a dependency conflict on the day that is today, 2021-08-06.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="222046" 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/so-what-is-the-problem-with-sqlite/1602/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-222046" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="222046"
                     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 #25"></div>
  </section>
</div>
    <div class="postbit" id="365103" data-post-id="365103">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="synaptic" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  synaptic
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>SQLite really makes it easier to get started in development, whether it’s a hobby project or a serious one.  9/10 times I don’t need PostgreSQL in place until I’m actually ready to go live anyway, and it’s extra work to set up a PG database (including users, permissions, etc) in development as well test compared to a SQLite database.  For a team project, every member would have to set up two PG databases each (dev and test), compared to <em>zero</em> setup for SQLite.  <code>mix ecto.migrate</code> just works without any additional configuration.  Ideally PostgreSQL would be the default for production, since, as <a class="mention" href="/u/chrismccord" rel="nofollow">@chrismccord</a> points out, PG is superior for production, and SQLite would be used for dev and test (something you can do in Rails).</p>
<p>Unfortunately, Elixir appears to use a single database adapter for all environments (see generated repo.ex in application).  So that would would be a feature request, to allow different repo’s (and/or different DB adapters) for different environments.  It’s a minor thing, but it would reduce a lot of friction for people evaluating Phoenix and also for setting up dev and test environments.</p>
<p>As an aside, you could also do in-memory SQLite databases for testing, which gives you a brand new test DB every time (no migrations needed).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365103" 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/so-what-is-the-problem-with-sqlite/1602/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-365103" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365103"
                     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 #27"></div>
  </section>
</div>
    <div class="postbit" id="365104" data-post-id="365104">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This is not considered a good practice in general, you want every environment to be equal to production. It’s simple engineering 101. Although if it’s your own little project don’t let this stop you.</p>
<p>And lots of projects out there rely on database specific features.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365104" data-batch-url="/posts/batch_likers">
                        7
                      </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/so-what-is-the-problem-with-sqlite/1602/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-365104" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365104"
                     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 #28"></div>
  </section>
</div>
    <div class="postbit" id="365105" data-post-id="365105">
  <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 think I’ve ever NOT run into db specific feature conflicts—at least fulltext search always seems to be a requirement and I’m not installing a dedicated db for that.  I also ran into some other surprising differences when I converted a client’s db from pg to sqlite.  I think Rails allows (allowed?) different dbs in different envs because historically they pushed the idea of doing <em>everything</em> in the application—they were even against things like fkeys back in the day.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365105" 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/so-what-is-the-problem-with-sqlite/1602/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-365105" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365105"
                     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 #29"></div>
  </section>
</div>
    <div class="postbit" id="365110" data-post-id="365110">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garrison" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garrison
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Even worse, the problem could be extremely subtle. SQLite is SERIALIZABLE by default (literally serialized, in fact), while Postgres is READ COMMITTED which is <em>much</em> weaker. You could write code which presents with all sorts of awful anomalies on Postgres and yet is perfectly safe in SQLite, and you would be none the wiser when you test it locally.</p>
<p>Even if you ran Potsgres in SERIALIZABLE you would have aborts due to how Postgres’s SSI handles conflicts, whereas SQLite is <em>literally</em> serialized so there will be no aborts.</p>
<p>It’s just dangerous tbh.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365110" 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/so-what-is-the-problem-with-sqlite/1602/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-365110" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365110"
                     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 #30"></div>
  </section>
</div>
    <div class="postbit" id="365112" data-post-id="365112">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="synaptic" data-post="28" data-topic="1602">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/s/8edcca/48.png" class="avatar"> synaptic:</div>
<blockquote>
<p>and it’s extra work to set up a PG database (including users, permissions, etc) in development as well test compared to a SQLite database.</p>
</blockquote>
</aside>
<p>For development environment there should be no difficulties in setting a postgres database. You shouldn’t need any special users or permissions and using the default postgres/postgres as username and password is universal across most phoenix applications. To make the setup even easier to manage, you can create a <code>docker-compose</code> file and use the dockerized version of postgres. That one is even easier to manage as you can automate all the setup process and reuse it across different projects.</p>
<aside class="quote no-group" data-username="synaptic" data-post="28" data-topic="1602">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/s/8edcca/48.png" class="avatar"> synaptic:</div>
<blockquote>
<p>Unfortunately, Elixir appears to use a single database adapter for all environments (see generated repo.ex in application). So that would would be a feature request, to allow different repo’s (and/or different DB adapters) for different environments. It’s a minor thing, but it would reduce a lot of friction for people evaluating Phoenix and also for setting up dev and test environments.</p>
</blockquote>
</aside>
<p>I already dug into this topic some time ago when I wanted to use the same repo for both sqlite and postgres (mind you, my aim was to allow the user to deploy a liveview application with either sqlite or postgres). You can read about what I found after my investigation here: <a href="https://forum.elixirforum.com/t/what-is-the-reasoning-behind-baking-in-the-adatper-at-compile-time/60626" class="inline-onebox" rel="nofollow">What is the reasoning behind baking in the adatper at compile-time</a></p>
<aside class="quote no-group" data-username="synaptic" data-post="28" data-topic="1602">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/s/8edcca/48.png" class="avatar"> synaptic:</div>
<blockquote>
<p>As an aside, you could also do in-memory SQLite databases for testing, which gives you a brand new test DB every time (no migrations needed).</p>
</blockquote>
</aside>
<p>The transaction cancellation that is used by postgres currently is faster (and allows concurrency) than using a in-memory database. The basic idea behind testing with a real database is that you want to isolate and rollback any data insertions and transactions rollback are the perfect feature for that. SQLite not only doesn’t allow multiple writes at the same time (which means no async tests <img src="https://forum.elixirforum.com/images/emoji/apple/frowning.png?v=15" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"> ), but you will have to run migrations everytime you create a new in-memory database, which is slower compared to postgres running migrations only once when tests start.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="365112" data-batch-url="/posts/batch_likers">
                        1
                      </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/so-what-is-the-problem-with-sqlite/1602/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-365112" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="365112"
                     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 #31"></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/1602/load_more?page=4">Load more posts (2 remaining)</a>
</div></template></turbo-stream>