mirror of
https://github.com/DreamExposure/DisCal-Discord-Bot.git
synced 2026-05-08 02:10:05 -05:00
Fix getting of announcement and calendar count from database
The data type of the number returned by `COUNT(*)` is apparently a bigint and r2dbc does not support mapping bigint to integer. So it is mapped as a long and then converted to an integer.
This commit is contained in:
@@ -600,9 +600,9 @@ public class DatabaseManager {
|
||||
|
||||
return Mono.from(c.createStatement(query).execute());
|
||||
}).flatMapMany(res -> res.map((row, rowMetadata) -> {
|
||||
Integer calendars = row.get(0, Integer.class);
|
||||
Long calendars = row.get(0, Long.class);
|
||||
|
||||
return calendars == null ? 0 : calendars;
|
||||
return calendars == null ? 0 : calendars.intValue();
|
||||
}))
|
||||
.next()
|
||||
.onErrorResume(e -> {
|
||||
@@ -939,8 +939,8 @@ public class DatabaseManager {
|
||||
|
||||
return Mono.from(c.createStatement(query).execute());
|
||||
}).flatMapMany(res -> res.map((row, rowMetadata) -> {
|
||||
Integer announcements = row.get(0, Integer.class);
|
||||
return announcements == null ? 0 : announcements;
|
||||
Long announcements = row.get(0, Long.class);
|
||||
return announcements == null ? 0 : announcements.intValue();
|
||||
}))
|
||||
.next()
|
||||
.onErrorResume(e -> {
|
||||
|
||||
Reference in New Issue
Block a user