MCPcopy
hub / github.com/sequelize/sequelize / withSqliteForeignKeysOff

Function withSqliteForeignKeysOff

src/dialects/sqlite/sqlite-utils.ts:4–12  ·  view source on GitHub ↗
(sequelize: Sequelize, options: QueryOptions, cb: () => Promise<T>)

Source from the content-addressed store, hash-verified

2import type { QueryOptions } from '../abstract/query-interface.js';
3
4export async function withSqliteForeignKeysOff<T>(sequelize: Sequelize, options: QueryOptions, cb: () => Promise<T>): Promise<T> {
5 try {
6 await sequelize.query('PRAGMA foreign_keys = OFF', options);
7
8 return await cb();
9 } finally {
10 await sequelize.query('PRAGMA foreign_keys = ON', options);
11 }
12}

Callers 3

truncateMethod · 0.85
dropMethod · 0.85

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected