1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

BLOB and CLOB support.

This commit is contained in:
Sandu Liviu Catalin 2021-04-03 16:30:08 +03:00
parent 950d684f9a
commit d9a35ec5d8
2 changed files with 20 additions and 4 deletions

View File

@ -53,6 +53,14 @@ struct SqString
mS.resize(ClampL< SQInteger, size_t >(n), v); mS.resize(ClampL< SQInteger, size_t >(n), v);
} }
/* --------------------------------------------------------------------------------------------
* Construct with forwarded native arguments.
*/
template < class... Args > SqString(SqInPlace SQ_UNUSED_ARG(x), Args&&... args)
: mS(std::forward< Args >(args)...)
{
}
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Copy constructor from reference. * Copy constructor from reference.
*/ */

View File

@ -1,8 +1,8 @@
#pragma once #pragma once
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
#include "Core/Buffer.hpp" #include "Library/IO/Buffer.hpp"
#include "Core/Utility.hpp" #include "Library/Utils/String.hpp"
#include "Library/Utils/Vector.hpp" #include "Library/Utils/Vector.hpp"
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -10,6 +10,7 @@
#include <Poco/Data/Statement.h> #include <Poco/Data/Statement.h>
#include <Poco/Data/RecordSet.h> #include <Poco/Data/RecordSet.h>
#include <Poco/Data/SessionPool.h> #include <Poco/Data/SessionPool.h>
#include <Poco/Data/LOB.h>
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
namespace std { // NOLINT(cert-dcl58-cpp) namespace std { // NOLINT(cert-dcl58-cpp)
@ -1686,8 +1687,15 @@ protected:
case Poco::Data::MetaColumn::FDT_STRING: case Poco::Data::MetaColumn::FDT_STRING:
case Poco::Data::MetaColumn::FDT_WSTRING: case Poco::Data::MetaColumn::FDT_WSTRING:
return LightObj(SqInPlace{}, SqVM(), v.convert< std::string >()); return LightObj(SqInPlace{}, SqVM(), v.convert< std::string >());
case Poco::Data::MetaColumn::FDT_BLOB: case Poco::Data::MetaColumn::FDT_BLOB: {
case Poco::Data::MetaColumn::FDT_CLOB: auto & b = v.extract< Poco::Data::BLOB >();
return LightObj(SqTypeIdentity< SqBuffer >{}, SqVM(),
reinterpret_cast< Buffer::ConstPtr >(b.rawContent()), static_cast< SQInteger >(b.size()));
}
case Poco::Data::MetaColumn::FDT_CLOB: {
auto & b = v.extract< Poco::Data::CLOB >();
return LightObj(SqTypeIdentity< SqString >{}, SqVM(), SqInPlace{}, b.rawContent(), b.size());
}
case Poco::Data::MetaColumn::FDT_DATE: case Poco::Data::MetaColumn::FDT_DATE:
case Poco::Data::MetaColumn::FDT_TIME: case Poco::Data::MetaColumn::FDT_TIME:
case Poco::Data::MetaColumn::FDT_TIMESTAMP: case Poco::Data::MetaColumn::FDT_TIMESTAMP: