1 import { QueryTypes, Sequelize, Transaction } from 'sequelize'
5 * Abstact builder to run video SQL queries
9 export class AbstractVideosQueryBuilder {
10 protected sequelize: Sequelize
12 protected query: string
13 protected replacements: any = {}
15 protected runQuery (options: { transaction?: Transaction, logging?: boolean } = {}) {
16 const queryOptions = {
17 transaction: options.transaction,
18 logging: options.logging,
19 replacements: this.replacements,
20 type: QueryTypes.SELECT as QueryTypes.SELECT,
24 return this.sequelize.query<any>(this.query, queryOptions)