object-curly-spacing

This commit is contained in:
Michael C
2021-09-22 18:52:35 -04:00
parent 5dcc90b31a
commit a028eaa41a
85 changed files with 406 additions and 405 deletions

View File

@@ -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";

View File

@@ -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": {

View File

@@ -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()));

View File

@@ -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;