@furystack/typeorm-store
TypeScript icon, indicating that this package has built-in type declarations

3.0.40 • Public • Published

typeorm-store

TypeORM Physical Store implementation for FuryStack. You can use TypeORM stores as IPhysicalStores for FuryStack

An usage example:

import { join } from 'path'
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
import { Injector } from '@furystack/inject'
import '@furystack/typeorm-store'
import { IPhysicalStore, StoreManager } from '@furystack/core'

@Entity()
class MyModel {
  @PrimaryGeneratedColumn()
  public id!: number

  @Column()
  public value!: string
}

const myInjector = new Injector()
myInjector
  .useLogging()
  .useTypeOrm({
    name: 'ExampleDb',
    type: 'sqlite', // you have to install the sqlite package as well
    database: join(process.cwd(), 'data', 'users.sqlite'),
    entities: [MyModel],
    synchronize: true,
  })
  .setupStores(stores => stores.useTypeOrmStore(MyModel))

const myStore: IPhysicalStore<MyModel> = myInjector.getInstance(StoreManager).getStoreFor(MyModel)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.40
    2
    • latest

Version History

Package Sidebar

Install

npm i @furystack/typeorm-store

Weekly Downloads

31

Version

3.0.40

License

GPL-2.0

Unpacked Size

56.8 kB

Total Files

33

Last publish

Collaborators

  • gallayl