diff options
Diffstat (limited to 'server/models/shared/abstract-run-query.ts')
-rw-r--r-- | server/models/shared/abstract-run-query.ts | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/server/models/shared/abstract-run-query.ts b/server/models/shared/abstract-run-query.ts deleted file mode 100644 index 7f27a0c4b..000000000 --- a/server/models/shared/abstract-run-query.ts +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | import { QueryTypes, Sequelize, Transaction } from 'sequelize' | ||
2 | |||
3 | /** | ||
4 | * | ||
5 | * Abstract builder to run video SQL queries | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | export class AbstractRunQuery { | ||
10 | protected query: string | ||
11 | protected replacements: any = {} | ||
12 | |||
13 | constructor (protected readonly sequelize: Sequelize) { | ||
14 | |||
15 | } | ||
16 | |||
17 | protected runQuery (options: { nest?: boolean, transaction?: Transaction, logging?: boolean } = {}) { | ||
18 | const queryOptions = { | ||
19 | transaction: options.transaction, | ||
20 | logging: options.logging, | ||
21 | replacements: this.replacements, | ||
22 | type: QueryTypes.SELECT as QueryTypes.SELECT, | ||
23 | nest: options.nest ?? false | ||
24 | } | ||
25 | |||
26 | return this.sequelize.query<any>(this.query, queryOptions) | ||
27 | } | ||
28 | |||
29 | protected buildSelect (entities: string[]) { | ||
30 | return `SELECT ${entities.join(', ')} ` | ||
31 | } | ||
32 | } | ||