forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContext.cpp
More file actions
45 lines (31 loc) · 874 Bytes
/
Context.cpp
File metadata and controls
45 lines (31 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Context.cpp
//
// Library: ActiveRecord
// Package: ActiveRecord
// Module: Context
//
// Copyright (c) 2020, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/ActiveRecord/Context.h"
using namespace std::string_literals;
namespace Poco::ActiveRecord {
Context::Context(const Poco::Data::Session& session):
_session(session)
{
}
Context::Context(const std::string& connector, const std::string& connectionString):
_session(connector, connectionString)
{
}
StatementPlaceholderProvider::Ptr Context::statementPlaceholderProvider() const
{
if (Poco::icompare(_session.connector(), "postgresql"s) == 0)
return std::make_unique<PostgresStatementPlaceholderProvider>();
else
return std::make_unique<DefaultStatementPlaceholderProvider>();
}
} // namespace Poco::ActiveRecord