refactor: database types (#19624)

This commit is contained in:
Jason Rasmussen
2025-06-30 13:19:16 -04:00
committed by GitHub
parent 09cbc5d3f4
commit e60bc3c304
99 changed files with 518 additions and 889 deletions
+4 -3
View File
@@ -1,15 +1,16 @@
import { Injectable } from '@nestjs/common';
import { Insertable, Kysely, sql, Updateable } from 'kysely';
import { InjectKysely } from 'nestjs-kysely';
import { DB, MoveHistory } from 'src/db';
import { DummyValue, GenerateSql } from 'src/decorators';
import { AssetPathType, PathType } from 'src/enum';
import { DB } from 'src/schema';
import { MoveTable } from 'src/schema/tables/move.table';
@Injectable()
export class MoveRepository {
constructor(@InjectKysely() private db: Kysely<DB>) {}
create(entity: Insertable<MoveHistory>) {
create(entity: Insertable<MoveTable>) {
return this.db.insertInto('move_history').values(entity).returningAll().executeTakeFirstOrThrow();
}
@@ -23,7 +24,7 @@ export class MoveRepository {
.executeTakeFirst();
}
update(id: string, entity: Updateable<MoveHistory>) {
update(id: string, entity: Updateable<MoveTable>) {
return this.db
.updateTable('move_history')
.set(entity)