Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
sebald committed Oct 25, 2023
1 parent 1bd4704 commit d45a405
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
17 changes: 8 additions & 9 deletions lib/db/db.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Kysely, MysqlDialect } from 'kysely';
import { type ColumnType, type Generated } from 'kysely';
import { createPool } from 'mysql2';

import type { GameRecord, XWSFaction, XWSSquad } from '@/lib/types';
import { createPool } from 'mysql2';

// Types
// ---------------
Expand Down Expand Up @@ -45,15 +45,14 @@ export interface Database {
// ---------------
export const db = new Kysely<Database>({
dialect: new MysqlDialect({
pool: async () =>
createPool({
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: 'main',
}),
pool: createPool({
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USERNAME,
password: process.env.DATABASE_PASSWORD,
database: 'main',
}),
}),
// log: ['query'],
// log: ['query', 'error'],
});

export const initDatabase = async () =>
Expand Down
1 change: 0 additions & 1 deletion scripts/setup-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,4 @@ void (async () => {
} catch (err: any) {
console.log(chalk.red.bold(err?.body?.message || err.message || err));
}
process.exit(0); // Weird 🤷‍♂️
})();

0 comments on commit d45a405

Please sign in to comment.