Skip to content

aioworkers/aioworkers-databases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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