MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / setLockMode

Method setLockMode

packages/sql/src/query/QueryBuilder.ts:2022–2033  ·  view source on GitHub ↗
(mode?: LockMode, tables?: string[])

Source from the content-addressed store, hash-verified

2020 }
2021
2022 setLockMode(mode?: LockMode, tables?: string[]): this {
2023 this.ensureNotFinalized();
2024
2025 if (mode != null && ![LockMode.OPTIMISTIC, LockMode.NONE].includes(mode) && !this.context) {
2026 throw ValidationError.transactionRequired();
2027 }
2028
2029 this.#state.lockMode = mode;
2030 this.#state.lockTables = tables;
2031
2032 return this;
2033 }
2034
2035 setFlushMode(flushMode?: FlushMode): this {
2036 this.ensureNotFinalized();

Calls 2

ensureNotFinalizedMethod · 0.95
transactionRequiredMethod · 0.80

Tested by

no test coverage detected