kysely
Version:
Type safe SQL query builder
27 lines (26 loc) • 699 B
JavaScript
/// <reference types="./connection-mutex.d.ts" />
/**
* This mutex is used to ensure that only one operation at a time can
* acquire a connection from the driver. This is necessary when the
* driver only has a single connection, like SQLite and PGlite.
*
* @internal
*/
export class ConnectionMutex {
async obtainLock() {
while (this.
await this.
}
this.
this.
});
}
releaseLock() {
const resolve = this.
this.
this.
resolve?.();
}
}