Skip to content

Add DB pool support #41

@Dimaz55

Description

@Dimaz55

Is your feature request related to a problem?

First of all "postgresql+asyncpg" scheme doesn't supported, second - I'm getting error when trying to run scheduler:
"sorry, too many clients already"

  File "/usr/local/lib/python3.13/site-packages/taskiq_pg/asyncpg/schedule_source.py", line 65, in get_schedules
    async with self._database_pool.acquire() as conn:
               ^^^^^^^^^^^^^^^^^^^
AttributeError: 'AsyncpgScheduleSource' object has no attribute '_database_pool'

Describe the solution you'd like

Support db pool

Describe alternatives you've considered

No response

Which component would this affect?

Scheduler Source

Use case

from sqlalchemy.ext.asyncio import create_async_engine

engine = create_async_engine(
    url="postgresql+asyncpg://postgres:postgres@localhost:5432/postgres",
    pool_size=50,
    max_overflow=10,
)

Additional context

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions