Typeorm package of galatajs
framework.
npm install @galatajs/typeorm mysql
Main file
import { createApp, App } from "@galatajs/app";
import { createTypeorm } from "@galatajs/typeorm";
import { mainModule } from "./src/main.module"
const app : App = createApp(mainModule)
app.register(createTypeorm({
/* ... typeorm options */
}))
app.start();
In module
import { createModule, Module } from "@galatajs/app";
import { registerEntity } from "@galatajs/typeorm";
import { Product } from "./product.entity";
const productModule : Module = createModule("product", {
imports: [
registerEntity(Product)
]
})