mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-29 14:50:13 -05:00
Migrate Prettier/Eslint/Stylelint setup to Biome (#1772)
* Initial * CSS lint * Test CI * Add 1v1, 2v2, and 3v3 Tags (#1771) * Initial * CSS lint * Test CI * Rename step --------- Co-authored-by: xi <104683822+ximk@users.noreply.github.com>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import Database from "better-sqlite3";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { Kysely, ParseJSONResultsPlugin, SqliteDialect } from "kysely";
|
||||
import invariant from "~/utils/invariant";
|
||||
import type { DB } from "./tables";
|
||||
|
||||
const migratedEmptyDb = new Database("db-test.sqlite3").serialize();
|
||||
|
||||
invariant(process.env["DB_PATH"], "DB_PATH env variable must be set");
|
||||
const isInMemoryDB = process.env["DB_PATH"] === ":memory:";
|
||||
invariant(process.env.DB_PATH, "DB_PATH env variable must be set");
|
||||
const isInMemoryDB = process.env.DB_PATH === ":memory:";
|
||||
|
||||
export const sql = new Database(
|
||||
isInMemoryDB ? migratedEmptyDb : process.env["DB_PATH"],
|
||||
isInMemoryDB ? migratedEmptyDb : process.env.DB_PATH,
|
||||
);
|
||||
|
||||
sql.pragma("journal_mode = WAL");
|
||||
@@ -17,16 +17,16 @@ sql.pragma("foreign_keys = ON");
|
||||
sql.pragma("busy_timeout = 5000");
|
||||
|
||||
export const db = new Kysely<DB>({
|
||||
dialect: new SqliteDialect({
|
||||
database: sql,
|
||||
}),
|
||||
// uncomment if you want examine the queries
|
||||
// log: process.env.NODE_ENV === "development" ? ["query"] : undefined,
|
||||
// log(event): void {
|
||||
// if (event.level === "query") {
|
||||
// console.log(event.query.sql);
|
||||
// console.log(event.query.parameters);
|
||||
// }
|
||||
// },
|
||||
plugins: [new ParseJSONResultsPlugin()],
|
||||
dialect: new SqliteDialect({
|
||||
database: sql,
|
||||
}),
|
||||
// uncomment if you want examine the queries
|
||||
// log: process.env.NODE_ENV === "development" ? ["query"] : undefined,
|
||||
// log(event): void {
|
||||
// if (event.level === "query") {
|
||||
// console.log(event.query.sql);
|
||||
// console.log(event.query.parameters);
|
||||
// }
|
||||
// },
|
||||
plugins: [new ParseJSONResultsPlugin()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user