blob: 7e67fa34fab6b966750cedefc698ff9e7dd2a1a5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import { QueryTypes, Sequelize, Transaction } from 'sequelize'
import { logger } from '@server/helpers/logger'
/**
*
* Abstact builder to run video SQL queries
*
*/
export class AbstractVideosQueryBuilder {
protected sequelize: Sequelize
protected query: string
protected replacements: any = {}
protected runQuery (transaction?: Transaction) {
logger.debug('Running videos query.', { query: this.query, replacements: this.replacements })
const options = {
transaction,
replacements: this.replacements,
type: QueryTypes.SELECT as QueryTypes.SELECT,
next: false
}
return this.sequelize.query<any>(this.query, options)
}
}
|