diff options
Diffstat (limited to 'server/models/video/sql/abstract-videos-query-builder.ts')
-rw-r--r-- | server/models/video/sql/abstract-videos-query-builder.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/models/video/sql/abstract-videos-query-builder.ts b/server/models/video/sql/abstract-videos-query-builder.ts new file mode 100644 index 000000000..597a02af7 --- /dev/null +++ b/server/models/video/sql/abstract-videos-query-builder.ts | |||
@@ -0,0 +1,15 @@ | |||
1 | import { logger } from '@server/helpers/logger' | ||
2 | import { Sequelize, QueryTypes } from 'sequelize' | ||
3 | |||
4 | export class AbstractVideosQueryBuilder { | ||
5 | protected sequelize: Sequelize | ||
6 | |||
7 | protected query: string | ||
8 | protected replacements: any = {} | ||
9 | |||
10 | protected runQuery (nest?: boolean) { | ||
11 | logger.info('Running video query.', { query: this.query, replacements: this.replacements }) | ||
12 | |||
13 | return this.sequelize.query<any>(this.query, { replacements: this.replacements, type: QueryTypes.SELECT, nest }) | ||
14 | } | ||
15 | } | ||