update postgresql branch

This commit is contained in:
Ben
2026-05-07 23:45:07 -04:00
parent cc0ca3979e
commit 327be48ade
23 changed files with 8817 additions and 8406 deletions
+16 -2
View File
@@ -140,6 +140,17 @@ export class ClientService {
public async updateBestDifficulty(id: string, bestDifficulty: number) {
return await this.clientRepository.update({ id }, { bestDifficulty });
}
public async updateBestDifficultyIfHigher(id: string, bestDifficulty: number) {
return await this.clientRepository
.createQueryBuilder()
.update(ClientEntity)
.set({ bestDifficulty })
.where('id = :id', { id })
.andWhere('"bestDifficulty" < :bestDifficulty', { bestDifficulty })
.execute();
}
public async connectedClientCount(): Promise<number> {
return await this.clientRepository.count();
}
@@ -173,7 +184,10 @@ export class ClientService {
}
public async deleteAll() {
return await this.clientRepository.softDelete({})
return await this.clientRepository
.createQueryBuilder()
.softDelete()
.execute();
}
// public async getUserAgents() {
@@ -188,4 +202,4 @@ export class ClientService {
// return result;
// }
}
}