12 lines
314 B
TypeScript
12 lines
314 B
TypeScript
|
import mysql from "mysql2/promise";
|
||
|
|
||
|
export const database = await mysql.createConnection({
|
||
|
host: process.env.DB_HOST,
|
||
|
port: Number(process.env.DB_PORT),
|
||
|
user: process.env.DB_USER,
|
||
|
password: process.env.DB_PASSWORD,
|
||
|
database: process.env.DB_SCHEMA,
|
||
|
});
|
||
|
|
||
|
export type data<T> = [T[], mysql.FieldPacket[]];
|