/typeorm

Typeorm package for galatajs Framework

Primary LanguageTypeScriptMIT LicenseMIT


@galatajs/typeorm

Typeorm package of galatajs framework.

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