Effect CommunityEC
Effect Community3y ago
23 replies
wayne

Error executing sql BEGIN in postgres

I would like to manage my own transaction, with the commit/rollback managed via scope and a finalizer. However, when I execute
yield* _(sql`BEGIN`);

I get the following error:
UNSAFE_TRANSACTION: Only use sql.begin, sql.reserved or max: 1

Is this something to do with postgres prepared statements? How can I get around this?
Was this page helpful?