Turns out you're not supposed to add
'sqlite:///'
in front of the path, and instead, the full path. This is because 'sqlite:///' is used for SQLAlchemy connections
Here is what I changed in my code at the top:
import sqlite
import os
def connect_db():
db_path = os.path.join(current_app.instance_path, 'app.db')
print(f"path: {db_path}")
conn = sqlite3.connect(db_path)
conn.row_factory = sqlite3.Row
return conn