0.2.0-alpha • Published 1 year ago

@knestjs/objection v0.2.0-alpha

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year ago

@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 {}
0.2.0-alpha

1 year ago

0.1.0-alpha

1 year ago