(this: IndexedDbQueryBuilder<any>, options: {
readonly tables: NonEmptyReadonlyArray<any>
readonly mode: globalThis.IDBTransactionMode
readonly durability?: IDBTransactionDurability
})
| 1995 | }, |
| 1996 | ...CommonProto, |
| 1997 | withTransaction(this: IndexedDbQueryBuilder<any>, options: { |
| 1998 | readonly tables: NonEmptyReadonlyArray<any> |
| 1999 | readonly mode: globalThis.IDBTransactionMode |
| 2000 | readonly durability?: IDBTransactionDurability |
| 2001 | }) { |
| 2002 | return (effect) => |
| 2003 | Effect.suspend(() => { |
| 2004 | const transaction = this.database.current.transaction(options.tables, options.mode, options) |
| 2005 | return Effect.provideService(effect, IndexedDbTransaction, transaction).pipe( |
| 2006 | Effect.onExit((exit) => |
| 2007 | exit._tag === "Success" ? awaitTransaction(transaction) : abortTransaction(transaction) |
| 2008 | ) |
| 2009 | ) |
| 2010 | }).pipe( |
| 2011 | // To prevent async gaps between transaction queries |
| 2012 | Effect.provideService(References.PreventSchedulerYield, true) |
| 2013 | ) |
| 2014 | } |
| 2015 | } |
| 2016 | |
| 2017 | const abortTransaction = (transaction: globalThis.IDBTransaction) => |
nothing calls this directly
no test coverage detected