mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
object-curly-spacing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Logger} from "../utils/logger";
|
||||
import {IDatabase, QueryType} from "./IDatabase";
|
||||
import { Logger } from "../utils/logger";
|
||||
import { IDatabase, QueryType } from "./IDatabase";
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import MysqlInterface from "sync-mysql";
|
||||
|
||||
@@ -56,7 +56,7 @@ export class Postgres implements IDatabase {
|
||||
Logger.debug(`prepare (postgres): type: ${type}, query: ${query}, params: ${params}`);
|
||||
|
||||
try {
|
||||
const queryResult = await this.pool.query({text: query, values: params});
|
||||
const queryResult = await this.pool.query({ text: query, values: params });
|
||||
|
||||
switch (type) {
|
||||
case "get": {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {IDatabase, QueryType} from "./IDatabase";
|
||||
import Sqlite3, {Database, Database as SQLiteDatabase} from "better-sqlite3";
|
||||
import { IDatabase, QueryType } from "./IDatabase";
|
||||
import Sqlite3, { Database, Database as SQLiteDatabase } from "better-sqlite3";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import {getHash} from "../utils/getHash";
|
||||
import {Logger} from "../utils/logger";
|
||||
import { getHash } from "../utils/getHash";
|
||||
import { Logger } from "../utils/logger";
|
||||
|
||||
export class Sqlite implements IDatabase {
|
||||
private db: SQLiteDatabase;
|
||||
@@ -36,7 +36,7 @@ export class Sqlite implements IDatabase {
|
||||
fs.mkdirSync(path.join(this.config.dbPath, "../"));
|
||||
}
|
||||
|
||||
this.db = new Sqlite3(this.config.dbPath, {readonly: this.config.readOnly, fileMustExist: !this.config.createDbIfNotExists});
|
||||
this.db = new Sqlite3(this.config.dbPath, { readonly: this.config.readOnly, fileMustExist: !this.config.createDbIfNotExists });
|
||||
|
||||
if (this.config.createDbIfNotExists && !this.config.readOnly && fs.existsSync(this.config.dbSchemaFileName)) {
|
||||
this.db.exec(Sqlite.processUpgradeQuery(fs.readFileSync(this.config.dbSchemaFileName).toString()));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {config} from "../config";
|
||||
import {Sqlite} from "./Sqlite";
|
||||
import {Mysql} from "./Mysql";
|
||||
import {Postgres} from "./Postgres";
|
||||
import {IDatabase} from "./IDatabase";
|
||||
import { config } from "../config";
|
||||
import { Sqlite } from "./Sqlite";
|
||||
import { Mysql } from "./Mysql";
|
||||
import { Postgres } from "./Postgres";
|
||||
import { IDatabase } from "./IDatabase";
|
||||
|
||||
|
||||
let db: IDatabase;
|
||||
|
||||
Reference in New Issue
Block a user