-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
Peewee recomends to conect()
just before request and close()
after executing user code.
i.e. from documentation:
http://docs.peewee-orm.com/en/latest/peewee/database.html#creating-a-database-connection-and-tables
database = SqliteDatabase('my_app.db')
def before_request_handler():
database.connect()
def after_request_handler():
database.close()
On async app handlers are coroitines and requests can be processed while another one waiting bigger data.
Is there way to get another connection from pool and do requsts on it instead of using shared database connection?
Context manager maybe?
related #53
Metadata
Metadata
Assignees
Labels
No labels