Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 30, 2018 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/d3c872c980a10075dc0ab45410e40c9c to your computer and use it in GitHub Desktop.
Save amandeepmittal/d3c872c980a10075dc0ab45410e40c9c to your computer and use it in GitHub Desktop.
import 'reflect-metadata';
import { createConnection } from 'typeorm';
import { Photo } from './entity/Photo';
createConnection({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: 'admin',
database: 'test',
entities: [Photo],
synchronize: true,
logging: false
})
.then(connection => {
// here you can start to work with your entities
})
.catch(error => console.log(error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment