Best PracticesΒΆ
Use
script()for schema setup and migrations made of multiple statementsUse
fetch_all()/fetch_one()when you need full SQL controlUse
select()/insert()/update()/delete()for common CRUD flowsUse
table()when you repeatedly work with the same tableUse
transaction()for grouped writes and nested savepoint logicUse
upsert()when your schema has a clear conflict targetPrefer parameterized SQL for values; never string-format raw values into SQL
Only interpolate identifiers through sqlite7 helper methods, which validate them