AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
sqlFunctions.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 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 <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include "sql/builder/selectBuilder.hpp"
23#include "sql/builder/clausesBuilder.hpp"
24
25
26namespace anch {
27 namespace sql {
28
29 // Functions +
35 anch::sql::SelectBuilder select();
36
42 anch::sql::ClausesBuilder clauses();
43
49 template<typename T>
50 anch::sql::ClausesBuilder clauses(anch::sql::ClauseMaker clause, T& value, anch::sql::ValueChecker<T> checker = anch::sql::isValidValue<T>);
51
57 template<typename T>
58 anch::sql::ClausesBuilder clauses(const std::string& column, anch::sql::ClauseMaker clause, T& value, anch::sql::ValueChecker<T> checker = anch::sql::isValidValue<T>);
59 // Functions -
60
61 // Implementations +
62 template<typename T>
64 return std::move(clauses().AND(clause, value, checker));
65 }
66
67 template<typename T>
69 clauses(const std::string& column, anch::sql::ClauseMaker clause, T& value, anch::sql::ValueChecker<T> checker) {
70 return std::move(clauses().AND(column, clause, value, checker));
71 }
72 // Implementations -
73
74 } // sql
75} // anch
SQL clauses builder.
Definition clausesBuilder.hpp:73
SQL namespace.
Definition clauses.hpp:26
std::optional< std::string > isValidValue(T &value)
std::function< std::optional< std::string >(const T &)> ValueChecker
Definition clausesBuilder.hpp:49
ClausesBuilder clauses()
std::function< std::string(const std::string &)> ClauseMaker
Definition clausesBuilder.hpp:45
SelectBuilder select()
AnCH framework base namespace.
Definition app.hpp:28