I am using peewee to access SQLite DB.
I did model.pyas:
from peewee import *
db = SqliteDatabase('people.db')
class Person(Model):
name = CharField()
birthday = DateField()
is_relative = BooleanField()
class Meta:
database = db
In another Python file (c import model), I then manipulate the database using calls like Person.create()or Person.select(name=='Joe').delete_instance().
Quickstart says at the end to call db.close()to close the connection. Does this apply to my case? Should I call something like model.db.close()?
source
share