2
3 Comments

I wrote a checklist for using SQLite on your project

https://marcospereira.me/2023/02/14/checklist-for-sqlite/
submitted this linkon February 18, 2023
  1. 3

    Excellent article! Flask and SQLite are my default server and database stack unless the situation calls for something more robust. SQLite is an ideal fit for MVPs due to its low overhead and deserves way more love among Indie Hackers as a result.

    You're right - it's got a lot of quirks, especially with booleans and general typing funkiness if migrating to something like MySQL/Postgres. But that's an easy enough bridge to cross if you come to it. Much easier and lower risk to monkey with a copy of a flat file than a dev database server.

    I'm curious as to why you recommend not managing connections within the request/response cycle. Most ORMs like Flask-SQLAlchemy will do this for you by default. IIRC if Flask is in multithreaded mode, it will spawn a new thread for every request anyways, so your connection and your queries will always live in the same thread.

    1. 1

      I'm curious as to why you recommend not managing connections within the request/response cycle

      Because creating a new connection has overhead, which even if small, doesn't feel right to do.