Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 1.25 KB

README.md

File metadata and controls

58 lines (44 loc) · 1.25 KB

aioworkers-databases

GitHub Workflow Status PyPI - Python Version PyPI

aioworkers plugin for databases.

Usage

Add your database config to aioworkers config.yaml:

db:
  cls: aioworkers_databases.database.Database
  dsn: sqlite:///db.sqlite
logging:
  version: 1
  disable_existing_loggers: false
  root:
    level: ERROR
    handlers: [console]
  handlers:
    console:
      level: DEBUG
      class: logging.StreamHandler
  loggers:
    aioworkers_databases:
      level: ERROR
      handlers: [console]
      propagate: true

Run aioworkers:

aioworkers -c config.yaml -i        

Create Context for this config and use your db via context:

await context.db.execute('CREATE TABLE some_table (id INT);')

Development

Install requirements:

poetry install

Run tests:

pytest