Quickstart
Step 1: Configure typeorm component
const app = await createApp({
id: 'test.app',
name: 'tester',
components: {
typeorm: {
class: TypeOrmComponent,
options: {
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'user',
password: 'passwd',
database: 'database',
synchronize: true,
entities: [
`${path.resolve(__dirname, './entities/*')}`
]
} as MysqlConnectionOptions
}
}
})
Step 2: Get typeorm component
const typeorm: TypeOrmComponent = app.Components.get<TypeOrmComponent>('typeorm')
Step 3: Use it
typeorm.getRepository(...)
typeorm.getMongoRepository(...)
typeorm.transaction(...)
typeorm.query(...)
...
@lakutata/core required.
Documentations
See Typeorm official documents
How to Contribute
Please let us know how can we help. Do check out issues for bug reports or suggestions first.