update cuz presentation
This commit is contained in:
parent
7a9e451739
commit
4e67cc4e19
29 changed files with 1065 additions and 88 deletions
|
@ -1,11 +1,17 @@
|
|||
import mysql from "mysql2/promise";
|
||||
import mysql, { Connection } from "mysql2/promise";
|
||||
|
||||
export const database = await mysql.createConnection({
|
||||
const connectionOptions: mysql.ConnectionOptions = {
|
||||
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,
|
||||
});
|
||||
decimalNumbers: true,
|
||||
supportBigNumbers: true,
|
||||
};
|
||||
|
||||
export const database =
|
||||
await mysql.createConnection(connectionOptions) as Connection & { new: () => Promise<Connection> };
|
||||
database.new = () => { return mysql.createConnection(connectionOptions); };
|
||||
|
||||
export type data<T> = [T[], mysql.FieldPacket[]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue