* Returns a promise that will resolve to true if the table exists in the database, false otherwise. * * @param {TableName} tableName - The name of the table * @param {QueryOptions} options - Query options * @returns {Promise }
(tableName, options)
| 237 | * @returns {Promise<boolean>} |
| 238 | */ |
| 239 | async tableExists(tableName, options) { |
| 240 | const sql = this.queryGenerator.tableExistsQuery(tableName); |
| 241 | |
| 242 | const out = await this.sequelize.query(sql, { |
| 243 | ...options, |
| 244 | type: QueryTypes.SHOWTABLES |
| 245 | }); |
| 246 | |
| 247 | return out.length === 1; |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * Drop a table from database |
no test coverage detected