-
Notifications
You must be signed in to change notification settings - Fork 311
Description
Context
The Electric write-path contract requires calling pg_current_xact_id()::text within the same transaction as the write, then returning the txid to the client for optimistic state reconciliation.
Different ORM frameworks have varying levels of support for accessing raw transaction context. The electric-drizzle skill covers Drizzle, but developers use many other ORMs with Electric.
Research needed
Survey how to implement the txid handshake in common ORM/API frameworks:
- Drizzle (already documented)
- Prisma — can you call raw SQL within a
$transaction? - Knex — transaction raw query support
- TypeORM — transaction manager + raw query
- Sequelize — transaction + raw query
- MikroORM — EntityManager raw query in transaction
- Plain pg/postgres.js — direct transaction
For each, document:
- How to run
pg_current_xact_id()::textin the same transaction as a write - Any gotchas or limitations
- Code snippet
Output
A reference file (e.g. electric-txid-orm-reference) that the electric-tanstack-integration and electric-drizzle skills can point to. Could also become a standalone skill if the content is substantial enough.
Source
Identified during domain discovery skill test run (skill-domain-discovery v2.1).