mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-06 14:09:25 +08:00
* test: with collection_manager_schema env * fix: remove collection * fix: collection test * fix: collection exist in db with custom schema * fix: inherited with custom collection schema * fix: build error * fix: sync unique index & database logger
19 lines
584 B
TypeScript
19 lines
584 B
TypeScript
import QueryInterface from './query-interface';
|
|
import { Collection } from '../collection';
|
|
|
|
export default class SqliteQueryInterface extends QueryInterface {
|
|
constructor(db) {
|
|
super(db);
|
|
}
|
|
|
|
async collectionTableExists(collection: Collection, options?) {
|
|
const transaction = options?.transaction;
|
|
|
|
const tableName = collection.model.tableName;
|
|
|
|
const sql = `SELECT name FROM sqlite_master WHERE type='table' AND name='${tableName}';`;
|
|
const results = await this.db.sequelize.query(sql, { type: 'SELECT', transaction });
|
|
return results.length > 0;
|
|
}
|
|
}
|