AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
sqlQuery.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <https://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "anch-sql-export.hpp"
23
24#include <string>
25
26#include "sql/parameters.hpp"
27
28
29namespace anch::sql {
30
44 class ANCH_SQL_EXPORT SQLQuery {
45
46 // Attributes +
47 private:
49 std::string _query;
50
52 anch::sql::Parameters _parameters;
53 // Attributes -
54
55
56 // Constructors +
57 public:
61 SQLQuery() = delete;
62
66 SQLQuery(const SQLQuery& other);
67
74 SQLQuery(const std::string& query, const anch::sql::Parameters& parameters);
75 // Constructors -
76
77 // Operators +
78 public:
86 SQLQuery& operator=(const SQLQuery& other) = default;
87 // Operators -
88
89
90 // Accessors +
91 public:
97 inline const std::string& getQuery() const;
98
104 inline const anch::sql::Parameters& getParameters() const;
105 // Accessors -
106
107 };
108
109 const std::string&
111 return _query;
112 }
113
116 return _parameters;
117 }
118
119} // anch::sql
Named parameters of a query ( :name ), bound by Connection.
Definition parameters.hpp:377
SQLQuery(const SQLQuery &other)
SQLQuery & operator=(const SQLQuery &other)=default
SQLQuery(const std::string &query, const anch::sql::Parameters &parameters)
const anch::sql::Parameters & getParameters() const
Definition sqlQuery.hpp:115
const std::string & getQuery() const
Definition sqlQuery.hpp:110
SQL namespace.
Definition clauses.hpp:28