@knestjs/objection
TypeScript icon, indicating that this package has built-in type declarations

0.2.0-alpha • Public • Published

@knestjs/objection

This is the implementation of @knestjs using objection models as the object to do the queries.

Usage

On the app module, you need to initialize KnestjsModule, you can use the static forRoot in knestObjection.

@Module({
    imports: [
        KnestObjectionModule.forRoot({
            db: {
                client: 'sqlite3',
                connection: {
                    filename: ':memory:'
                },
                useNullAsDefault: true,
            },
            migrations: {
                folder: migrationsFolder,
                snapshotName,
            }
        })
    ]
})
export class AppModule {}

Then on the feature module, you need to register the models.

@Module({
    imports: [KnestObjectionModule.forFeature([UserModel, GroupModel])]
})
export class UserModule {}

Readme

Keywords

Package Sidebar

Install

npm i @knestjs/objection

Weekly Downloads

2

Version

0.2.0-alpha

License

GPL-3.0-or-later

Unpacked Size

129 kB

Total Files

21

Last publish

Collaborators

  • dracks