added new query criteria class set
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
#include "matador/sql/column.hpp"
|
||||
|
||||
#include "matador/sql/table.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include "matador/sql/column.hpp"
|
||||
#include "matador/sql/table.hpp"
|
||||
|
||||
namespace matador::sql {
|
||||
|
||||
column operator ""_col(const char *name, size_t len)
|
||||
{
|
||||
return column{{name, len}};
|
||||
column operator ""_col(const char *name, size_t len) {
|
||||
const std::string str(name, len);
|
||||
const auto pos = str.find('.');
|
||||
if (pos == std::string::npos) {
|
||||
return column{str};
|
||||
}
|
||||
|
||||
if (str.find('.', pos + 1) != std::string::npos) {
|
||||
throw std::invalid_argument("Invalid column name: multiple dots found");
|
||||
}
|
||||
|
||||
return column{str.substr(0, pos), str.substr(pos + 1)};
|
||||
}
|
||||
|
||||
column::column(const char *name, const std::string& as)
|
||||
|
||||
Reference in New Issue
Block a user