📄 selectquery.hpp
字号:
/* LiteSQL * * By Tero Laitinen * * See LICENSE for copyright information. */#ifndef _litesql_selectquery_hpp#define _litesql_selectquery_hpp#include "litesql/utils.hpp"#include "litesql/expr.hpp"/** \file selectquery.hpp contains SelectQuery-class. See \ref usage_selecting_persistents */namespace litesql {/** a class that helps creating SELECT-SQL statements. methods are self-explanatory. */class SelectQuery { bool _distinct; int _limit, _offset; Split _results; Split _sources; std::string _where; Split _groupBy; std::string _having; Split _orderBy;public: SelectQuery() : _distinct(false), _limit(0), _offset(0), _where("True") {} SelectQuery & distinct(bool d) ; SelectQuery & limit(int value); SelectQuery & offset(int value); SelectQuery & result(std::string r); SelectQuery & clearResults(); SelectQuery & source(std::string s, std::string alias=""); SelectQuery & where(const Expr & w); SelectQuery & where(std::string w); SelectQuery & groupBy(std::string gb); SelectQuery & having(const Expr & h); SelectQuery & having(std::string h); SelectQuery & orderBy(std::string ob, bool ascending=true); operator std::string() const; std::string asString() const { return this->operator std::string(); }};}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -