selectquery.hpp

来自「LiteSQL is a C++ library that integrates」· HPP 代码 · 共 47 行

HPP
47
字号
/* 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 + =
减小字号Ctrl + -
显示快捷键?