mirror of
https://github.com/pocoproject/poco.git
synced 2026-01-02 19:02:11 +01:00
merge pg binary extraction support
This commit is contained in:
@@ -99,7 +99,7 @@ void SessionImpl::open(const std::string& aConnectionString)
|
||||
}
|
||||
}
|
||||
|
||||
poco_assert_dbg (! connectionString().empty());
|
||||
poco_assert_dbg (!connectionString().empty());
|
||||
|
||||
unsigned int timeout = static_cast<unsigned int>(getLoginTimeout());
|
||||
|
||||
@@ -140,6 +140,10 @@ void SessionImpl::open(const std::string& aConnectionString)
|
||||
addFeature("asynchronousCommit",
|
||||
&SessionImpl::setAutoCommit,
|
||||
&SessionImpl::isAutoCommit);
|
||||
|
||||
addFeature("binaryExtraction",
|
||||
&SessionImpl::setBinaryExtraction,
|
||||
&SessionImpl::isBinaryExtraction);
|
||||
}
|
||||
|
||||
|
||||
@@ -244,4 +248,13 @@ bool SessionImpl::hasTransactionIsolation(Poco::UInt32 aTI) const
|
||||
}
|
||||
|
||||
|
||||
void SessionImpl::setBinaryExtraction(const std::string& feature, bool enabled)
|
||||
{
|
||||
if (enabled && _sessionHandle.parameterStatus("integer_datetimes") != "on")
|
||||
throw PostgreSQLException("binary extraction is not supported with this server (ingeger_datetimes must be enabled on the server)");
|
||||
|
||||
_binaryExtraction = enabled;
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::PostgreSQL
|
||||
|
||||
Reference in New Issue
Block a user