Skip to content

concurent queries #67

@alex-eri

Description

@alex-eri

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions