add connector name shortcut to Session
This commit is contained in:
Родитель
248d52164d
Коммит
a6cc973fe3
|
@ -273,6 +273,9 @@ public:
|
||||||
/// Returns true iff the transaction isolation level corresponds
|
/// Returns true iff the transaction isolation level corresponds
|
||||||
/// to the supplied bitmask.
|
/// to the supplied bitmask.
|
||||||
|
|
||||||
|
std::string connector();
|
||||||
|
/// Returns the connector name for this session.
|
||||||
|
|
||||||
std::string uri();
|
std::string uri();
|
||||||
/// Returns the URI for this session.
|
/// Returns the URI for this session.
|
||||||
|
|
||||||
|
@ -439,6 +442,12 @@ inline bool Session::isTransactionIsolation(Poco::UInt32 ti)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline std::string Session::connector()
|
||||||
|
{
|
||||||
|
return _pImpl->connectorName();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline std::string Session::uri(const std::string& connector,
|
inline std::string Session::uri(const std::string& connector,
|
||||||
const std::string& connectionString)
|
const std::string& connectionString)
|
||||||
{
|
{
|
||||||
|
|
|
@ -111,6 +111,7 @@ void DataTest::testSession()
|
||||||
{
|
{
|
||||||
Session sess(SessionFactory::instance().create("test", "cs"));
|
Session sess(SessionFactory::instance().create("test", "cs"));
|
||||||
assert ("test" == sess.impl()->connectorName());
|
assert ("test" == sess.impl()->connectorName());
|
||||||
|
assert (sess.connector() == sess.impl()->connectorName());
|
||||||
assert ("cs" == sess.impl()->connectionString());
|
assert ("cs" == sess.impl()->connectionString());
|
||||||
assert ("test:///cs" == sess.uri());
|
assert ("test:///cs" == sess.uri());
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче