Skip to main content

logo

Wrapper around SQLAlchemy AsyncSession with built-in query execution profiling and connection context management.


Installation

pip install gadsqlalchemy

Usage

from gadsqlalchemy import Sqlalchemy, Base, CRUD

alchemy = Sqlalchemy("postgresql+asyncpg://postgres:postgres@localhost:5432/db")


class Table(Base):
    ...


class Crud(CRUD):
    table = Table


class Service:

    @classmethod
    async def get(cls):
        async with alchemy.connect() as session:
            ...

    @classmethod
    async def create(cls,):
        async with alchemy.connect(transaction=True) as session:
           ...

# testing
import faker

from gadsqlalchemy.testing import Table

fake = faker.Faker()

class Dummy(Table):
    class Meta:
        model = Table

    name = fake.name()

pytest_plugins = [
    "gadsqlalchemy.testing.fixtures",
]

Metadata

Release files for gadsqlalchemy 0.0.3

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

Source distribution (sdist)

Source distribution for gadsqlalchemy 0.0.3
File Size Uploaded
gadsqlalchemy-0.0.3.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gadsqlalchemy 0.0.3
File Interpreter ABI Platform
gadsqlalchemy-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / gadsqlalchemy-0.0.3.tar.gz

Download URL gadsqlalchemy-0.0.3.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
89137c035448a34ac1b068db15bbd5851e456dcf151412cc5edd127168467a67
BLAKE2b-256 checksum
How to use checksums
634e4c8ba6570a368437e5e01322b5376c723afbf07a9bf015ae4645450b3181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / gadsqlalchemy-0.0.3-py3-none-any.whl

Download URL gadsqlalchemy-0.0.3-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f80f26ea4a8e115caef1ee498f1dc19b699f4e860fa88179cc175fe89e6e3a32
BLAKE2b-256 checksum
How to use checksums
9904a46cc829be5bdc61c9d46917707721da86ae70ced30cfc0b12b8d4330d7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

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