Skip to main content

aioworkers-pg

GitHub Workflow Status PyPI - Python Version PyPI

Asyncpg plugin for aioworkers.

Usage

Connection

Add this to aioworkers config.yaml:

db:
  cls: aioworkers_pg.base.Connector
  dsn: postgresql:///test

You can get access to postgres anywhere via context:

await context.db.execute('CREATE TABLE users(id serial PRIMARY KEY, name text)')
await context.db.execute(users.insert().values(name='Bob'))

Connection additional

db:
  cls: aioworkers_pg.base.Connector
  dsn: postgresql:///test
  pool:
    min_size: 1
    max_size: 100

Storage

storage:
  cls: aioworkers_pg.storage.RoStorage
  dsn: postgresql:///test
  table: mytable  # optional instead custom sql
  key: id
  get: SELECT * FROM mytable WHERE id = :id  # optional custom sql
  format: dict  # or row

Development

Install dev requirements:

poetry install

Run postgres:

docker run --rm -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=test -d postgres

Run tests:

pytest

Metadata

Release files for aioworkers-pg 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioworkers-pg 0.3.0
File Size Uploaded Provenance Actions
aioworkers-pg-0.3.0.tar.gz 8.8 kB Without provenance Details for aioworkers-pg-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aioworkers-pg 0.3.0
File Interpreter ABI Platform Actions
aioworkers_pg-0.3.0-py3-none-any.whl Python 3 none any Details for aioworkers_pg-0.3.0-py3-none-any.whl

Total release size: 18.6 kB

Release files / aioworkers-pg-0.3.0.tar.gz

Download URL aioworkers-pg-0.3.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b58624743fb271049a065debeeadc4c5aee27a3bcd0d6f05a3b82232cd86842f
BLAKE2b-256 checksum
How to use checksums
ebf43efc5e6c97dab12542b08dd7cabb1a78b4a474c2957bcc32108876cc1990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.12 Linux/5.4.0-1069-azure

Release files / aioworkers_pg-0.3.0-py3-none-any.whl

Download URL aioworkers_pg-0.3.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c5b46b3573062ff3c4b9b20b9ab7768cb84e5549c10d42a72f96e2dc8013848
BLAKE2b-256 checksum
How to use checksums
6584ba25f144e8ccaa63f3fe8b2ab71a1a3ab185bdb15a5e798fbc4a8d48f37c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.12 Linux/5.4.0-1069-azure

Security for aioworkers-pg 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page