Save pic to PG

This commit is contained in:
P0nk
2024-09-27 07:39:24 +02:00
parent f33d4fbc1c
commit 2044166967
6 changed files with 79 additions and 31 deletions

View File

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