0.1.1 • Published 3 years ago

@galatajs/typeorm v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Installation

npm install @galatajs/typeorm mysql

Usage

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)
  ]
})