I am using peewee to access a SQLite DB.
I have made a model.py
like:
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 (with import model
) I then manipulate the DB with calls like Person.create()
or Person.select(name=='Joe').delete_instance()
.
The Quickstart says at the end to call db.close()
to close the connection. Does this apply to my case as well? Am I supposed to call something like model.db.close()
?