(operation: string, effect: Effect.Effect<void, SqlError>)
| 753 | // Runs a transaction control in a span of its own, so a failure ends |
| 754 | // that span with the control's own exit. |
| 755 | const control = (operation: string, effect: Effect.Effect<void, SqlError>) => |
| 756 | Effect.useSpan( |
| 757 | target === undefined ? operation : `${operation} ${target}`, |
| 758 | { kind: "client", parent: span }, |
| 759 | (controlSpan) => { |
| 760 | for (const [key, value] of options.spanAttributes) { |
| 761 | controlSpan.attribute(key, value) |
| 762 | } |
| 763 | controlSpan.attribute(ATTR_DB_OPERATION_NAME, operation) |
| 764 | return effect |
| 765 | } |
| 766 | ) |
| 767 | const connOption = Context.getOption(services, options.transactionService) |
| 768 | const conn: Effect.Effect<readonly [Scope.Closeable | undefined, S], SqlError> = connOption._tag === "Some" |
| 769 | // Checked under the savepoint permit: the parent can end while we wait. |
no test coverage detected