Save chr slots to PG

This commit is contained in:
P0nk
2024-09-27 17:55:42 +02:00
parent 2044166967
commit 082e0c0486
6 changed files with 59 additions and 20 deletions

View File

@@ -81,4 +81,17 @@ public class AccountRepository {
.execute() > 0;
}
}
public boolean setChrSlots(int accountId, int chrSlots) {
String sql = """
UPDATE account
SET chr_slots = :chrSlots
WHERE id = :id""";
try (Handle handle = connection.getHandle()) {
return handle.createUpdate(sql)
.bind("id", accountId)
.bind("chrSlots", chrSlots)
.execute() > 0;
}
}
}