You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
494 B

import { createConnection } from "typeorm";
import entities from "./entities";
export default async function connectToDatabase(host: string, port: number, username: string,
password: string, database: string)
{
return createConnection({
type: "mysql",
host,
port,
username,
password,
database,
synchronize: true,
entities,
migrations: ["src/migrations/*.ts"]
});
}