Skip to main content

Databases plugin for aioworkers

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioworkers-databases-0.1.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

aioworkers_databases-0.1.1-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page