#include <QtSql>
-#include "logger.h"
+#include "logmessage.h"
#include "network.h"
#include "quassel.h"
}
QVariantList params;
+ // PostgreSQL handles QDateTime()'s serialized format by default, and QDateTime() serializes
+ // to a 64-bit time compatible format by default.
params << msg.timestamp()
<< msg.bufferInfo().bufferId().toInt()
<< msg.type()
for (int i = 0; i < msgs.count(); i++) {
Message &msg = msgs[i];
QVariantList params;
+ // PostgreSQL handles QDateTime()'s serialized format by default, and QDateTime() serializes
+ // to a 64-bit time compatible format by default.
params << msg.timestamp()
<< msg.bufferInfo().bufferId().toInt()
<< msg.type()
QDateTime timestamp;
while (query.next()) {
+ // PostgreSQL returns date/time in ISO 8601 format, no 64-bit handling needed
+ // See https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT
timestamp = query.value(1).toDateTime();
timestamp.setTimeSpec(Qt::UTC);
Message msg(timestamp,
bufferInfo,
- (Message::Type)query.value(2).toUInt(),
+ (Message::Type)query.value(2).toInt(),
query.value(8).toString(),
query.value(4).toString(),
query.value(5).toString(),
query.value(6).toString(),
query.value(7).toString(),
- (Message::Flags)query.value(3).toUInt());
+ (Message::Flags)query.value(3).toInt());
msg.setMsgId(query.value(0).toLongLong());
messagelist << msg;
}
QDateTime timestamp;
while (query.next()) {
+ // PostgreSQL returns date/time in ISO 8601 format, no 64-bit handling needed
+ // See https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT
timestamp = query.value(1).toDateTime();
timestamp.setTimeSpec(Qt::UTC);
Message msg(timestamp,
bufferInfo,
- (Message::Type)query.value(2).toUInt(),
+ (Message::Type)query.value(2).toInt(),
query.value(8).toString(),
query.value(4).toString(),
query.value(5).toString(),
QDateTime timestamp;
for (int i = 0; i < limit && query.next(); i++) {
+ // PostgreSQL returns date/time in ISO 8601 format, no 64-bit handling needed
+ // See https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT
timestamp = query.value(2).toDateTime();
timestamp.setTimeSpec(Qt::UTC);
Message msg(timestamp,
bufferInfoHash[query.value(1).toInt()],
- (Message::Type)query.value(3).toUInt(),
+ (Message::Type)query.value(3).toInt(),
query.value(9).toString(),
query.value(5).toString(),
query.value(6).toString(),
query.value(7).toString(),
query.value(8).toString(),
- (Message::Flags)query.value(4).toUInt());
+ (Message::Flags)query.value(4).toInt());
msg.setMsgId(query.value(0).toLongLong());
messagelist << msg;
}
QDateTime timestamp;
for (int i = 0; i < limit && query.next(); i++) {
+ // PostgreSQL returns date/time in ISO 8601 format, no 64-bit handling needed
+ // See https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT
timestamp = query.value(2).toDateTime();
timestamp.setTimeSpec(Qt::UTC);
Message msg(timestamp,
bufferInfoHash[query.value(1).toInt()],
- (Message::Type)query.value(3).toUInt(),
+ (Message::Type)query.value(3).toInt(),
query.value(9).toString(),
query.value(5).toString(),
query.value(6).toString(),