Docker compose con variabili d'ambiente

This commit is contained in:
Lorenzo Sanesi
2026-08-10 13:52:13 +02:00
parent f4afaf0792
commit 04ba3d541f
6 changed files with 147 additions and 50 deletions
@@ -32,6 +32,27 @@ class UsersRepository {
}
}
async count() {
try {
return await this.User.count();
} catch (error) {
throw new DatabaseError('Failed to count users', error);
}
}
async countWithScoreAbove(score, excludeId) {
try {
return await this.User.count({
where: {
score: { [Op.gt]: score },
id: { [Op.ne]: excludeId },
},
});
} catch (error) {
throw new DatabaseError('Failed to count users above score', error);
}
}
async findById(id, options = {}) {
try {
const user = await this.User.findByPk(id, options);