MagicStack / MagicStack/asyncpg
Support for disabling transactions
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 8.1k
- Forks
- 469
- Ø Merge
- 18 Min.
- Gemergte PRs (30 T.)
- 4
Beschreibung
- asyncpg version: 0.28.0
- PostgreSQL version: CrateDB 5.4.2 https://github.com/crate/crate
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: Using CrateDB locally - Python version: 3.11.4
- Platform: Linux arm64
- Do you use pgbouncer?: No
- Did you install asyncpg with pip?: Yes
- If you built asyncpg locally, which version of Cython did you use?: 0.29.36
- Can the issue be reproduced under both asyncio and
uvloop?: Yes
It would be really useful to be able to disable transaction support for Postgres-like database systems that don't support transactions.
CrateDB is an OLAP database with Postgres Wire Protocol support, however it does not have support for transactions. (BEGIN is a no-op, but ROLLBACK is an undefined term and causes issues)
Currently using asyncpg like this:
asyncpg_pool = await asyncpg.create_pool(**CRATE_DB_CONFIG, loop=loop, max_size=10)
async with asyncpg_pool.acquire() as connection:
await connection.execute("""insert into some_table (event_time, field1, field2) values ($1, $2, $3);""", datetime.now(), user_id, session_id)
I'm deliberately avoiding any connection.transaction() calls yet asyncpg still appears to wrap everything in a transaction block.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die im Issue gezeigte Verwendung von create_pool und pool.acquire nachzuverfolgen, und vergleiche sie anschließend mit dem Verhalten von connection.transaction. Reproduziere die Workload gegen eine lokale CrateDB-Instanz und ermittle, wo implizite Transaktionsbefehle ausgegeben werden. Die Aufgabe ist abgeschlossen, wenn eine unterstützte Möglichkeit vorhanden ist, dieses Verhalten zu deaktivieren, sodass der gezeigte Insert auf CrateDB nicht fehlschlägt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- postgresql, python
- Bereich
- databases
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100