Core/DBLayer: Support retrieving DATE/DATETIME/TIMESTAMP column values directly without casting in sql

This commit is contained in:
Shauren
2024-04-10 13:59:19 +02:00
parent 16853af7c8
commit 404bb5b3c2
10 changed files with 310 additions and 41 deletions

View File

@@ -18,7 +18,6 @@
#include "Field.h"
#include "Errors.h"
#include "FieldValueConverter.h"
#include "Log.h"
#include <cstring>
Field::Field() : _value(nullptr), _length(0), _meta(nullptr)
@@ -107,6 +106,14 @@ double Field::GetDouble() const
return _meta->Converter->GetDouble(_value, _length, _meta);
}
SystemTimePoint Field::GetDate() const
{
if (!_value)
return SystemTimePoint::min();
return _meta->Converter->GetDate(_value, _length, _meta);
}
char const* Field::GetCString() const
{
if (!_value)