Registry / database / asyncpg-trek

asyncpg-trek

JSON →
library0.4.0pypypi✓ verified 84d ago

A simple migrations system for asyncpg and aiosqlite. Current version 0.4.0, supports Python 3.8+. Release cadence is irregular, with few releases since inception.

pip install asyncpg-trek
INSTALL
IMPORT
SIG · ASYNCPG-TREK
A
asyncpg-trek
databasepythonv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

asyncpg_trek
import asyncpg_trek
No common wrong import known.

Run migrations using an asyncpg connection and a local 'migrations' directory.

import asyncio import asyncpg_trek import os async def main(): conn = await asyncpg.connect( user='postgres', password=os.environ.get('PGPASSWORD', ''), database='test' ) await asyncpg_trek.migrate(conn, migrations_path='./migrations') await conn.close() asyncio.run(main())
Debug
Known issues
breakingIn 0.4.0, the aiosqlite backend was added, potentially changing import paths or the SupportsBackend interface.
fix
Check if you use custom backends; update imports if needed.
affects: 0.3.x -> 0.4.0
breakingIn 0.3.0, SupportsBackend was split into SupportsBackend and SupportsBackendExecutor, breaking custom backends.
fix
If you implemented a custom backend, split your class according to the new interfaces.
affects: 0.2.x -> 0.3.0
deprecatedThe default backend may be deprecated in the future as aiosqlite support matures.
fix
No immediate action needed.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aiosqlite'
Using aiosqlite backend without installing aiosqlite.
fix
pip install aiosqlite
asyncpg.exceptions.PostgresError: relation 'asyncpg_trek_migrations' does not exist
The migrations tracking table was not created; migration script not run or connection without schema.
fix
Ensure you call asyncpg_trek.migrate() before running migrations, and verify the database schema is accessible.
Upgrade
Version history
0.4.0latest on PyPI · released Jul 19, 2024
Audit
Dependencies
asyncpgrequiredRequired for asyncpg backend (default).
aiosqliteoptionalRequired for aiosqlite backend, added in 0.4.0.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
asyncpg-trek — pip install asyncpg-trek · libregistry