NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::sql_builder类 参考

SQL语句构建器 更多...

#include <sql_builder.hpp>

struct  select_data
 SELECT语句的数据结构 更多...
struct  insert_data
 INSERT语句的数据结构 更多...
struct  update_data
 UPDATE语句的数据结构 更多...
struct  column_definition
 列定义 更多...
struct  create_table_data
 CREATE TABLE语句的数据结构 更多...
struct  create_view_data
 CREATE VIEW语句的数据结构 更多...
struct  alter_table_data
 ALTER TABLE语句的数据结构 更多...
struct  create_index_data
 CREATE INDEX语句的数据结构 更多...
struct  set_op_entry
 集合操作条目 更多...
struct  cte_entry
 CTE条目 更多...

Public 成员函数

 sql_builder ()=default
 默认构造函数
 ~sql_builder ()=default
 析构函数
 sql_builder (const sql_builder &other)
 拷贝构造函数
sql_builderoperator= (const sql_builder &other)
 拷贝赋值运算符
 sql_builder (sql_builder &&other) noexcept=default
 移动构造函数
sql_builderoperator= (sql_builder &&other) noexcept=default
 移动赋值运算符
sql_builderselect (vector< string > fields)
 列表设置SELECT字段
sql_builderselect (std::initializer_list< string > fields)
 初始化列表设置SELECT字段
sql_builderselect (string field)
 添加SELECT字段
sql_builderselect_all () noexcept
 选择所有字段(SELECT *)
sql_builderdistinct ()
 添加DISTINCT关键字
sql_builderfrom (string table) noexcept
 设置主表
sql_builderfrom (string table, string alias) noexcept
 设置主表并指定别名
sql_builderjoin (sql_join type, string table, string on_condition)
 添加JOIN子句
sql_builderjoin (string table, string on_condition)
 添加INNER JOIN子句
sql_builderleft_join (string table, string on_condition)
 添加LEFT JOIN子句
sql_builderright_join (string table, string on_condition)
 添加RIGHT JOIN子句
sql_builderinner_join (string table, string on_condition)
 添加INNER JOIN子句
sql_builderfull_join (string table, string on_condition)
 添加FULL JOIN子句
sql_builderwhere (string condition)
 添加WHERE条件
sql_builderwhere_eq (string field, string value)
 添加相等条件
sql_builderwhere_ne (string field, string value)
 添加不等条件
sql_builderwhere_gt (string field, string value)
 添加大于条件
sql_builderwhere_ge (string field, string value)
 添加大于等于条件
sql_builderwhere_lt (string field, string value)
 添加小于条件
sql_builderwhere_le (string field, string value)
 添加小于等于条件
sql_builderwhere_like (string field, string pattern)
 添加LIKE条件
sql_builderwhere_not_like (string field, string pattern)
 添加NOT LIKE条件
sql_builderwhere_in (string field, vector< string > values)
 添加IN条件
sql_builderwhere_not_in (string field, vector< string > values)
 添加NOT IN条件
sql_builderwhere_between (string field, string start, string end)
 添加BETWEEN条件
sql_builderwhere_not_between (string field, string start, string end)
 添加NOT BETWEEN条件
sql_builderwhere_is_null (string field)
 添加IS NULL条件
sql_builderwhere_is_not_null (string field)
 添加IS NOT NULL条件
sql_builderwhere_exists (string subquery)
 添加EXISTS条件
sql_builderwhere_not_exists (string subquery)
 添加NOT EXISTS条件
sql_builderor_where (string condition)
 添加OR条件(与上一个条件组合)
sql_buildergroup_by (string field)
 添加GROUP BY字段
sql_buildergroup_by (const vector< string > &fields)
 添加GROUP BY字段列表
sql_buildergroup_by_rollup (vector< string > fields)
 添加GROUP BY ROLLUP子句
sql_buildergroup_by_cube (vector< string > fields)
 添加GROUP BY CUBE子句
sql_builderhaving (string condition)
 添加HAVING条件
sql_builderorder_by (string field, sql_order order=sql_order::ASC)
 添加ORDER BY子句
sql_builderorder_by_asc (string field)
 添加升序排序
sql_builderorder_by_desc (string field)
 添加降序排序
sql_builderlimit (int count)
 添加LIMIT限制
sql_builderoffset (int count)
 添加OFFSET偏移
sql_builderfetch_first (int row_count)
 添加FETCH FIRST分页
sql_builderpage (int page_num, int page_size)
 添加分页
sql_builderinsert_into (string table, vector< string > fields)
 设置INSERT INTO表名和字段
sql_builderinsert_into (string table)
 设置INSERT INTO表名
sql_buildervalues (vector< string > values)
 设置VALUES占位符
sql_buildervalues (std::initializer_list< string > values)
 设置VALUES占位符
sql_buildervalues (vector< vector< string > > value_rows)
 设置多行VALUES(批量插入)
sql_builderadd_values (vector< string > values)
 追加一行VALUES(用于多行INSERT)
sql_buildercolumns (vector< string > fields)
 设置INSERT字段列表
sql_builderupdate (string table)
 设置UPDATE表名
sql_builderset (string assignment)
 添加SET赋值
sql_builderset (string field, string value)
 添加SET赋值(字段=值形式)
sql_builderset_increment (string field, int value=1)
 添加自增赋值
sql_builderset_decrement (string field, int value=1)
 添加自减赋值
sql_builderremove ()
 设置DELETE操作
sql_builderdelete_from (string table)
 设置DELETE FROM表名
sql_builderdrop_table (string table)
 删除表
sql_builderdrop_table_if_exists (string table)
 删除表(IF EXISTS)
sql_builderunion_ (string query)
 添加UNION集合操作
sql_builderunion_all (string query)
 添加UNION ALL集合操作
sql_builderintersect (string query)
 添加INTERSECT集合操作
sql_builderintersect_all (string query)
 添加INTERSECT ALL集合操作
sql_builderexcept_ (string query)
 添加EXCEPT集合操作
sql_builderexcept_all (string query)
 添加EXCEPT ALL集合操作
sql_builderwith_ (string name, string query)
 添加CTE(WITH子句)
sql_builderwith_recursive (string name, string query)
 添加递归CTE(WITH RECURSIVE子句)
sql_buildercross_join (string table)
 添加CROSS JOIN子句
sql_builderselect_row_number (string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加ROW_NUMBER窗口函数
sql_builderselect_rank (string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加RANK窗口函数
sql_builderselect_dense_rank (string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加DENSE_RANK窗口函数
sql_builderselect_ntile (int buckets, string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加NTILE窗口函数
sql_builderselect_lead (string field, string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加LEAD窗口函数
sql_builderselect_lag (string field, string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加LAG窗口函数
sql_builderselect_first_value (string field, string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加FIRST_VALUE窗口函数
sql_builderselect_last_value (string field, string alias, const vector< string > &partition_by={}, const vector< string > &order_by={})
 添加LAST_VALUE窗口函数
sql_buildercreate_table (string table)
 创建表
sql_buildercreate_table_if_not_exists (string table)
 创建表(IF NOT EXISTS)
sql_buildercreate_temp_table (string table)
 创建临时表(TEMP TABLE)
sql_buildercreate_temp_table_if_not_exists (string table)
 创建临时表(TEMP TABLE IF NOT EXISTS)
sql_buildercolumn (string name, string type)
 添加基础列定义
sql_buildercolumn_not_null (string name, string type)
 添加带NOT NULL约束的列定义
sql_buildercolumn_primary_key (string name, string type)
 添加PRIMARY KEY列定义
sql_buildercolumn_unique (string name, string type)
 添加带UNIQUE约束的列定义
sql_buildercolumn_default (string name, string type, string default_val)
 添加带DEFAULT值的列定义
sql_buildercolumn_check (string name, string type, string check_expr)
 添加带CHECK约束的列定义
sql_buildercolumn_auto_increment (string name, string type)
 添加自增主键列定义(事实标准:AUTO_INCREMENT)
sql_buildertable_primary_key (vector< string > columns)
 添加表级PRIMARY KEY约束
sql_buildertable_foreign_key (string column, string ref_table, string ref_column)
 添加表级FOREIGN KEY约束
sql_buildertable_unique (vector< string > columns)
 添加表级UNIQUE约束
sql_buildertable_check (string expr)
 添加表级CHECK约束
sql_builderalter_table (string table)
 修改表
sql_builderadd_column (string name, string type)
 添加列(ALTER TABLE ADD COLUMN)
sql_builderdrop_column (string name)
 删除列(ALTER TABLE DROP COLUMN)
sql_builderalter_column_set_type (string name, string new_type)
 修改列数据类型(ALTER TABLE ALTER COLUMN SET DATA TYPE)
sql_builderalter_column_set_default (string name, string default_val)
 设置列默认值(ALTER TABLE ALTER COLUMN SET DEFAULT)
sql_builderalter_column_drop_default (string name)
 删除列默认值(ALTER TABLE ALTER COLUMN DROP DEFAULT)
sql_builderalter_column_set_not_null (string name)
 设置列非空约束(ALTER TABLE ALTER COLUMN SET NOT NULL)
sql_builderalter_column_drop_not_null (string name)
 删除列非空约束(ALTER TABLE ALTER COLUMN DROP NOT NULL)
sql_builderrename_column (string old_name, string new_name)
 重命名列(ALTER TABLE RENAME COLUMN)
sql_builderadd_primary_key (vector< string > columns)
 添加主键约束(ALTER TABLE ADD PRIMARY KEY)
sql_builderdrop_constraint (string constraint_name)
 删除约束(ALTER TABLE DROP CONSTRAINT)
sql_buildercreate_view (string view_name, string select_query)
 创建视图
sql_buildercreate_or_replace_view (string view_name, string select_query)
 创建视图(OR REPLACE)
sql_builderdrop_view (string view_name)
 删除视图
sql_builderdrop_view_if_exists (string view_name)
 删除视图(IF EXISTS)
sql_buildercreate_index (string index_name, string table, vector< string > columns)
 创建索引(CREATE INDEX)
sql_buildercreate_unique_index (string index_name, string table, vector< string > columns)
 创建唯一索引(CREATE UNIQUE INDEX)
sql_builderdrop_index (string index_name)
 删除索引(DROP INDEX)
sql_builderdrop_index_if_exists (string index_name)
 删除索引(DROP INDEX IF EXISTS)
sql_buildertruncate (string table)
 截断表(TRUNCATE TABLE)
sql_builderselect_count (string field, string alias)
 添加COUNT聚合函数(带别名)
sql_builderselect_count (string field)
 添加COUNT聚合函数(无别名)
sql_builderselect_count ()
 添加COUNT(*)聚合函数
sql_builderselect_sum (string field, string alias)
 添加SUM聚合函数(带别名)
sql_builderselect_sum (string field)
 添加SUM聚合函数(无别名)
sql_builderselect_avg (string field, string alias)
 添加AVG聚合函数(带别名)
sql_builderselect_avg (string field)
 添加AVG聚合函数(无别名)
sql_builderselect_max (string field, string alias)
 添加MAX聚合函数(带别名)
sql_builderselect_max (string field)
 添加MAX聚合函数(无别名)
sql_builderselect_min (string field, string alias)
 添加MIN聚合函数(带别名)
sql_builderselect_min (string field)
 添加MIN聚合函数(无别名)
sql_builderselect_distinct (string field)
 添加DISTINCT字段
sql_builderselect_subquery (string subquery, string alias)
 添加子查询作为SELECT字段
sql_builderselect_subquery (string subquery)
 添加子查询作为SELECT字段(无别名)
sql_builderfrom_subquery (string subquery, string alias)
 使用子查询作为FROM表
sql_builderreset () noexcept
 重置构建器状态
sql_operate type () const noexcept
 获取当前SQL操作类型
string_view table () const noexcept
 获取当前表名
bool is_empty () const noexcept
 检查构建器是否为空
sql_builderset_dialect (const sql_dialect dialect) noexcept
 设置数据库方言
sql_dialect dialect () const noexcept
 获取当前数据库方言
size_t param_count () const noexcept
 获取当前语句的参数占位符数量
string placeholder (const size_t index) const
 生成方言感知的参数占位符
string next_placeholder ()
 获取下一个参数占位符
sql_builderset_param (string field)
 添加 SET 赋值
string build () const
 构建最终的SQL语句

静态 Public 成员函数

static string make_case_simple (string field, vector< pair< string, string > > when_then, string else_val="")
 构建简单CASE表达式(CASE field WHEN ... THEN ... ELSE ... END)
static string make_case_searched (vector< pair< string, string > > when_then, string else_val="")
 构建搜索CASE表达式(CASE WHEN condition THEN ... ELSE ... END)
static string make_cast (string expression, string target_type)
 构建CAST类型转换表达式

详细描述

SQL语句构建器

提供流式API构建SQL语句:

  • 支持SELECT、INSERT、UPDATE、DELETE操作
  • 支持JOIN、WHERE、GROUP BY、ORDER BY、LIMIT等子句
  • 支持聚合函数(COUNT、SUM、AVG、MAX、MIN)
  • 支持子查询
  • 自动处理SQL语法

在文件 sql_builder.hpp176 行定义.

构造及析构函数说明

◆ sql_builder() [1/2]

neforce::sql_builder::sql_builder ( const sql_builder & other)

拷贝构造函数

参数
other源对象

引用了 sql_builder().

◆ sql_builder() [2/2]

neforce::sql_builder::sql_builder ( sql_builder && other)
defaultnoexcept

移动构造函数

参数
other源对象

引用了 sql_builder().

成员函数说明

◆ add_column()

sql_builder & neforce::sql_builder::add_column ( string name,
string type )

添加列(ALTER TABLE ADD COLUMN)

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

◆ add_primary_key()

sql_builder & neforce::sql_builder::add_primary_key ( vector< string > columns)

添加主键约束(ALTER TABLE ADD PRIMARY KEY)

参数
columns主键列列表
返回
自身引用

引用了 columns() , 以及 sql_builder().

◆ add_values()

sql_builder & neforce::sql_builder::add_values ( vector< string > values)

追加一行VALUES(用于多行INSERT)

参数
values值占位符列表
返回
自身引用

引用了 add_values(), sql_builder() , 以及 values().

被这些函数引用 add_values().

◆ alter_column_drop_default()

sql_builder & neforce::sql_builder::alter_column_drop_default ( string name)

删除列默认值(ALTER TABLE ALTER COLUMN DROP DEFAULT)

参数
name列名
返回
自身引用

引用了 sql_builder().

◆ alter_column_drop_not_null()

sql_builder & neforce::sql_builder::alter_column_drop_not_null ( string name)

删除列非空约束(ALTER TABLE ALTER COLUMN DROP NOT NULL)

参数
name列名
返回
自身引用

引用了 sql_builder().

◆ alter_column_set_default()

sql_builder & neforce::sql_builder::alter_column_set_default ( string name,
string default_val )

设置列默认值(ALTER TABLE ALTER COLUMN SET DEFAULT)

参数
name列名
default_val默认值(需自行包含引号等)
返回
自身引用

引用了 sql_builder().

◆ alter_column_set_not_null()

sql_builder & neforce::sql_builder::alter_column_set_not_null ( string name)

设置列非空约束(ALTER TABLE ALTER COLUMN SET NOT NULL)

参数
name列名
返回
自身引用

引用了 sql_builder().

◆ alter_column_set_type()

sql_builder & neforce::sql_builder::alter_column_set_type ( string name,
string new_type )

修改列数据类型(ALTER TABLE ALTER COLUMN SET DATA TYPE)

参数
name列名
new_type新数据类型
返回
自身引用

引用了 sql_builder().

◆ alter_table()

sql_builder & neforce::sql_builder::alter_table ( string table)

修改表

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

◆ build()

◆ column()

sql_builder & neforce::sql_builder::column ( string name,
string type )

添加基础列定义

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql() , 以及 table_foreign_key().

◆ column_auto_increment()

sql_builder & neforce::sql_builder::column_auto_increment ( string name,
string type )

添加自增主键列定义(事实标准:AUTO_INCREMENT)

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql().

◆ column_check()

sql_builder & neforce::sql_builder::column_check ( string name,
string type,
string check_expr )

添加带CHECK约束的列定义

参数
name列名
type数据类型
check_exprCHECK表达式
返回
自身引用

引用了 sql_builder() , 以及 type().

◆ column_default()

sql_builder & neforce::sql_builder::column_default ( string name,
string type,
string default_val )

添加带DEFAULT值的列定义

参数
name列名
type数据类型
default_val默认值(需自行包含引号等)
返回
自身引用

引用了 sql_builder() , 以及 type().

◆ column_not_null()

sql_builder & neforce::sql_builder::column_not_null ( string name,
string type )

添加带NOT NULL约束的列定义

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql().

◆ column_primary_key()

sql_builder & neforce::sql_builder::column_primary_key ( string name,
string type )

添加PRIMARY KEY列定义

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql().

◆ column_unique()

sql_builder & neforce::sql_builder::column_unique ( string name,
string type )

添加带UNIQUE约束的列定义

参数
name列名
type数据类型
返回
自身引用

引用了 sql_builder() , 以及 type().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql().

◆ columns()

sql_builder & neforce::sql_builder::columns ( vector< string > fields)

设置INSERT字段列表

参数
fields字段列表
返回
自身引用

引用了 columns() , 以及 sql_builder().

被这些函数引用 add_primary_key(), columns(), create_index(), create_unique_index(), table_primary_key() , 以及 table_unique().

◆ create_index()

sql_builder & neforce::sql_builder::create_index ( string index_name,
string table,
vector< string > columns )

创建索引(CREATE INDEX)

参数
index_name索引名
table表名
columns索引列列表
返回
自身引用

引用了 columns(), sql_builder() , 以及 table().

◆ create_or_replace_view()

sql_builder & neforce::sql_builder::create_or_replace_view ( string view_name,
string select_query )

创建视图(OR REPLACE)

参数
view_name视图名
select_query视图查询SQL
返回
自身引用

引用了 sql_builder().

◆ create_table()

sql_builder & neforce::sql_builder::create_table ( string table)

创建表

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

◆ create_table_if_not_exists()

sql_builder & neforce::sql_builder::create_table_if_not_exists ( string table)

创建表(IF NOT EXISTS)

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

被这些函数引用 neforce::sql_mapper< T >::create_table_sql().

◆ create_temp_table()

sql_builder & neforce::sql_builder::create_temp_table ( string table)

创建临时表(TEMP TABLE)

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

◆ create_temp_table_if_not_exists()

sql_builder & neforce::sql_builder::create_temp_table_if_not_exists ( string table)

创建临时表(TEMP TABLE IF NOT EXISTS)

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

◆ create_unique_index()

sql_builder & neforce::sql_builder::create_unique_index ( string index_name,
string table,
vector< string > columns )

创建唯一索引(CREATE UNIQUE INDEX)

参数
index_name索引名
table表名
columns索引列列表
返回
自身引用

引用了 columns(), sql_builder() , 以及 table().

◆ create_view()

sql_builder & neforce::sql_builder::create_view ( string view_name,
string select_query )

创建视图

参数
view_name视图名
select_query视图查询SQL
返回
自身引用

引用了 sql_builder().

◆ cross_join()

sql_builder & neforce::sql_builder::cross_join ( string table)

添加CROSS JOIN子句

参数
table表名
返回
自身引用

引用了 cross_join(), sql_builder() , 以及 table().

被这些函数引用 cross_join().

◆ delete_from()

sql_builder & neforce::sql_builder::delete_from ( string table)

设置DELETE FROM表名

参数
table表名
返回
自身引用

引用了 delete_from(), sql_builder() , 以及 table().

被这些函数引用 delete_from() , 以及 neforce::sql_mapper< T >::delete_sql().

◆ dialect()

sql_dialect neforce::sql_builder::dialect ( ) const
inlinenodiscardnoexcept

获取当前数据库方言

返回
方言枚举值

在文件 sql_builder.hpp1399 行定义.

被这些函数引用 set_dialect().

◆ distinct()

sql_builder & neforce::sql_builder::distinct ( )

添加DISTINCT关键字

返回
自身引用

引用了 distinct() , 以及 sql_builder().

被这些函数引用 distinct().

◆ drop_column()

sql_builder & neforce::sql_builder::drop_column ( string name)

删除列(ALTER TABLE DROP COLUMN)

参数
name列名
返回
自身引用

引用了 sql_builder().

◆ drop_constraint()

sql_builder & neforce::sql_builder::drop_constraint ( string constraint_name)

删除约束(ALTER TABLE DROP CONSTRAINT)

参数
constraint_name约束名称
返回
自身引用

引用了 sql_builder().

◆ drop_index()

sql_builder & neforce::sql_builder::drop_index ( string index_name)

删除索引(DROP INDEX)

参数
index_name索引名
返回
自身引用

引用了 sql_builder().

◆ drop_index_if_exists()

sql_builder & neforce::sql_builder::drop_index_if_exists ( string index_name)

删除索引(DROP INDEX IF EXISTS)

参数
index_name索引名
返回
自身引用

引用了 sql_builder().

◆ drop_table()

sql_builder & neforce::sql_builder::drop_table ( string table)

删除表

参数
table表名
返回
自身引用

引用了 drop_table(), sql_builder() , 以及 table().

被这些函数引用 drop_table().

◆ drop_table_if_exists()

sql_builder & neforce::sql_builder::drop_table_if_exists ( string table)

删除表(IF EXISTS)

参数
table表名
返回
自身引用

引用了 drop_table_if_exists(), sql_builder() , 以及 table().

被这些函数引用 drop_table_if_exists() , 以及 neforce::sql_mapper< T >::drop_table_sql().

◆ drop_view()

sql_builder & neforce::sql_builder::drop_view ( string view_name)

删除视图

参数
view_name视图名
返回
自身引用

引用了 sql_builder().

◆ drop_view_if_exists()

sql_builder & neforce::sql_builder::drop_view_if_exists ( string view_name)

删除视图(IF EXISTS)

参数
view_name视图名
返回
自身引用

引用了 sql_builder().

◆ except_()

sql_builder & neforce::sql_builder::except_ ( string query)

添加EXCEPT集合操作

参数
query要排除的查询SQL
返回
自身引用

引用了 except_() , 以及 sql_builder().

被这些函数引用 except_().

◆ except_all()

sql_builder & neforce::sql_builder::except_all ( string query)

添加EXCEPT ALL集合操作

参数
query要排除的查询SQL
返回
自身引用

引用了 except_all() , 以及 sql_builder().

被这些函数引用 except_all().

◆ fetch_first()

sql_builder & neforce::sql_builder::fetch_first ( int row_count)

添加FETCH FIRST分页

参数
row_count返回行数
返回
自身引用

生成 FETCH FIRST n ROWS ONLY 语法,是 ANSI SQL:2008 标准分页方式。 调用此方法后,LIMIT 子句将被忽略(以 FETCH FIRST 为准)。 可与 offset() 组合生成 OFFSET m ROWS FETCH FIRST n ROWS ONLY。

引用了 fetch_first() , 以及 sql_builder().

被这些函数引用 fetch_first().

◆ from() [1/2]

◆ from() [2/2]

sql_builder & neforce::sql_builder::from ( string table,
string alias )
noexcept

设置主表并指定别名

参数
table表名
alias表别名
返回
自身引用

引用了 from(), sql_builder() , 以及 table().

◆ from_subquery()

sql_builder & neforce::sql_builder::from_subquery ( string subquery,
string alias )

使用子查询作为FROM表

参数
subquery子查询SQL
alias别名
返回
自身引用

引用了 sql_builder().

◆ full_join()

sql_builder & neforce::sql_builder::full_join ( string table,
string on_condition )

添加FULL JOIN子句

参数
table连接表名
on_conditionON条件
返回
自身引用

引用了 full_join(), sql_builder() , 以及 table().

被这些函数引用 full_join().

◆ group_by() [1/2]

sql_builder & neforce::sql_builder::group_by ( const vector< string > & fields)

添加GROUP BY字段列表

参数
fields字段列表
返回
自身引用

引用了 group_by() , 以及 sql_builder().

◆ group_by() [2/2]

sql_builder & neforce::sql_builder::group_by ( string field)

添加GROUP BY字段

参数
field字段名
返回
自身引用

引用了 group_by() , 以及 sql_builder().

被这些函数引用 group_by() , 以及 group_by().

◆ group_by_cube()

sql_builder & neforce::sql_builder::group_by_cube ( vector< string > fields)

添加GROUP BY CUBE子句

参数
fieldsCUBE字段列表
返回
自身引用

生成 GROUP BY CUBE(field1, field2, ...) 语法, 产生所有维度组合的小计行。

引用了 group_by_cube() , 以及 sql_builder().

被这些函数引用 group_by_cube().

◆ group_by_rollup()

sql_builder & neforce::sql_builder::group_by_rollup ( vector< string > fields)

添加GROUP BY ROLLUP子句

参数
fieldsROLLUP字段列表
返回
自身引用

生成 GROUP BY ROLLUP(field1, field2, ...) 语法, 在每一层级产生小计行。

引用了 group_by_rollup() , 以及 sql_builder().

被这些函数引用 group_by_rollup().

◆ having()

sql_builder & neforce::sql_builder::having ( string condition)

添加HAVING条件

参数
condition条件表达式
返回
自身引用

引用了 having() , 以及 sql_builder().

被这些函数引用 having().

◆ inner_join()

sql_builder & neforce::sql_builder::inner_join ( string table,
string on_condition )

添加INNER JOIN子句

参数
table连接表名
on_conditionON条件
返回
自身引用

引用了 inner_join(), sql_builder() , 以及 table().

被这些函数引用 inner_join().

◆ insert_into() [1/2]

sql_builder & neforce::sql_builder::insert_into ( string table)

设置INSERT INTO表名

参数
table表名
返回
自身引用

引用了 insert_into(), sql_builder() , 以及 table().

◆ insert_into() [2/2]

sql_builder & neforce::sql_builder::insert_into ( string table,
vector< string > fields )

设置INSERT INTO表名和字段

参数
table表名
fields字段列表
返回
自身引用

引用了 insert_into(), sql_builder() , 以及 table().

被这些函数引用 insert_into(), insert_into() , 以及 neforce::sql_mapper< T >::insert_sql().

◆ intersect()

sql_builder & neforce::sql_builder::intersect ( string query)

添加INTERSECT集合操作

参数
query要合并的查询SQL
返回
自身引用

引用了 intersect() , 以及 sql_builder().

被这些函数引用 intersect().

◆ intersect_all()

sql_builder & neforce::sql_builder::intersect_all ( string query)

添加INTERSECT ALL集合操作

参数
query要合并的查询SQL
返回
自身引用

引用了 intersect_all() , 以及 sql_builder().

被这些函数引用 intersect_all().

◆ is_empty()

bool neforce::sql_builder::is_empty ( ) const
inlinenodiscardnoexcept

检查构建器是否为空

返回
未设置表名返回true

在文件 sql_builder.hpp1381 行定义.

◆ join() [1/2]

sql_builder & neforce::sql_builder::join ( sql_join type,
string table,
string on_condition )

添加JOIN子句

参数
typeJOIN类型
table连接表名
on_conditionON条件
返回
自身引用

引用了 join(), sql_builder(), table() , 以及 type().

被这些函数引用 join() , 以及 join().

◆ join() [2/2]

sql_builder & neforce::sql_builder::join ( string table,
string on_condition )

添加INNER JOIN子句

参数
table连接表名
on_conditionON条件
返回
自身引用

引用了 join(), sql_builder() , 以及 table().

◆ left_join()

sql_builder & neforce::sql_builder::left_join ( string table,
string on_condition )

添加LEFT JOIN子句

参数
table连接表名
on_conditionON条件
返回
自身引用

引用了 left_join(), sql_builder() , 以及 table().

被这些函数引用 left_join().

◆ limit()

sql_builder & neforce::sql_builder::limit ( int count)

添加LIMIT限制

参数
count返回行数
返回
自身引用

引用了 neforce::count(), limit() , 以及 sql_builder().

被这些函数引用 limit().

◆ make_case_searched()

string neforce::sql_builder::make_case_searched ( vector< pair< string, string > > when_then,
string else_val = "" )
static

构建搜索CASE表达式(CASE WHEN condition THEN ... ELSE ... END)

参数
when_thenWHEN-THEN对列表,每对包含条件和结果
else_valELSE默认值(可选,为空则省略ELSE子句)
返回
完整的CASE表达式字符串

◆ make_case_simple()

string neforce::sql_builder::make_case_simple ( string field,
vector< pair< string, string > > when_then,
string else_val = "" )
static

构建简单CASE表达式(CASE field WHEN ... THEN ... ELSE ... END)

参数
fieldCASE目标字段
when_thenWHEN-THEN对列表
else_valELSE默认值(可选,为空则省略ELSE子句)
返回
完整的CASE表达式字符串

◆ make_cast()

string neforce::sql_builder::make_cast ( string expression,
string target_type )
static

构建CAST类型转换表达式

参数
expression源表达式
target_type目标类型
返回
CAST(expression AS target_type) 字符串

◆ next_placeholder()

string neforce::sql_builder::next_placeholder ( )
inlinenodiscard

获取下一个参数占位符

返回
占位符字符串

每次调用后内部序号 +1,用于 UPDATE/SELECT 中按顺序分配占位符

注解
调用 reset() 时序号归零

在文件 sql_builder.hpp1427 行定义.

被这些函数引用 set_param() , 以及 neforce::sql_mapper< T >::update_sql().

◆ offset()

sql_builder & neforce::sql_builder::offset ( int count)

添加OFFSET偏移

参数
count偏移行数
返回
自身引用

引用了 neforce::count(), offset() , 以及 sql_builder().

被这些函数引用 offset().

◆ operator=() [1/2]

sql_builder & neforce::sql_builder::operator= ( const sql_builder & other)

拷贝赋值运算符

参数
other源对象
返回
自身引用

引用了 sql_builder().

◆ operator=() [2/2]

sql_builder & neforce::sql_builder::operator= ( sql_builder && other)
defaultnoexcept

移动赋值运算符

参数
other源对象
返回
自身引用

引用了 sql_builder().

◆ or_where()

sql_builder & neforce::sql_builder::or_where ( string condition)

添加OR条件(与上一个条件组合)

参数
condition条件表达式
返回
自身引用

将当前条件与上一个条件用OR连接。

引用了 or_where() , 以及 sql_builder().

被这些函数引用 or_where().

◆ order_by()

sql_builder & neforce::sql_builder::order_by ( string field,
sql_order order = sql_order::ASC )

添加ORDER BY子句

参数
field字段名
order排序方向
返回
自身引用

引用了 order_by() , 以及 sql_builder().

被这些函数引用 order_by().

◆ order_by_asc()

sql_builder & neforce::sql_builder::order_by_asc ( string field)

添加升序排序

参数
field字段名
返回
自身引用

引用了 order_by_asc() , 以及 sql_builder().

被这些函数引用 neforce::repository< T, Connect >::find_page() , 以及 order_by_asc().

◆ order_by_desc()

sql_builder & neforce::sql_builder::order_by_desc ( string field)

添加降序排序

参数
field字段名
返回
自身引用

引用了 order_by_desc() , 以及 sql_builder().

被这些函数引用 order_by_desc().

◆ page()

sql_builder & neforce::sql_builder::page ( int page_num,
int page_size )

添加分页

参数
page_num页码(从1开始)
page_size每页大小
返回
自身引用

引用了 page() , 以及 sql_builder().

被这些函数引用 neforce::repository< T, Connect >::find_page() , 以及 page().

◆ param_count()

size_t neforce::sql_builder::param_count ( ) const
inlinenodiscardnoexcept

获取当前语句的参数占位符数量

返回
参数总数(方言无关)

数量由内部计数器追踪,与占位符格式(? / $N / :N)无关。

在文件 sql_builder.hpp1409 行定义.

◆ placeholder()

string neforce::sql_builder::placeholder ( const size_t index) const
inlinenodiscard

生成方言感知的参数占位符

参数
index参数序号(1-based)
返回
占位符字符串
注解
仅当手动调用 values() / add_values() / set() 时才需自行调用

在文件 sql_builder.hpp1417 行定义.

被这些函数引用 neforce::sql_mapper< T >::delete_sql() , 以及 neforce::sql_mapper< T >::select_by_pk_sql().

◆ remove()

sql_builder & neforce::sql_builder::remove ( )

设置DELETE操作

返回
自身引用

引用了 remove() , 以及 sql_builder().

被这些函数引用 remove().

◆ rename_column()

sql_builder & neforce::sql_builder::rename_column ( string old_name,
string new_name )

重命名列(ALTER TABLE RENAME COLUMN)

参数
old_name旧列名
new_name新列名
返回
自身引用

引用了 sql_builder().

◆ reset()

sql_builder & neforce::sql_builder::reset ( )
noexcept

重置构建器状态

返回
自身引用

引用了 sql_builder().

◆ right_join()

sql_builder & neforce::sql_builder::right_join ( string table,
string on_condition )

添加RIGHT JOIN子句

参数
table连接表名
on_conditionON条件
返回
自身引用

引用了 right_join(), sql_builder() , 以及 table().

被这些函数引用 right_join().

◆ select() [1/3]

sql_builder & neforce::sql_builder::select ( std::initializer_list< string > fields)

初始化列表设置SELECT字段

参数
fields字段列表
返回
自身引用

引用了 select() , 以及 sql_builder().

◆ select() [2/3]

sql_builder & neforce::sql_builder::select ( string field)

添加SELECT字段

参数
field字段名
返回
自身引用

引用了 select() , 以及 sql_builder().

◆ select() [3/3]

◆ select_all()

sql_builder & neforce::sql_builder::select_all ( )
noexcept

选择所有字段(SELECT *)

返回
自身引用

引用了 select_all() , 以及 sql_builder().

被这些函数引用 select_all().

◆ select_avg() [1/2]

sql_builder & neforce::sql_builder::select_avg ( string field)

添加AVG聚合函数(无别名)

参数
field求平均字段名
返回
自身引用

引用了 sql_builder().

◆ select_avg() [2/2]

sql_builder & neforce::sql_builder::select_avg ( string field,
string alias )

添加AVG聚合函数(带别名)

参数
field求平均字段名
alias结果别名
返回
自身引用

引用了 sql_builder().

◆ select_count() [1/3]

sql_builder & neforce::sql_builder::select_count ( )

添加COUNT(*)聚合函数

返回
自身引用

引用了 sql_builder().

◆ select_count() [2/3]

sql_builder & neforce::sql_builder::select_count ( string field)

添加COUNT聚合函数(无别名)

参数
field计数字段名
返回
自身引用

引用了 sql_builder().

◆ select_count() [3/3]

sql_builder & neforce::sql_builder::select_count ( string field,
string alias )

添加COUNT聚合函数(带别名)

参数
field计数字段名
alias结果别名
返回
自身引用

引用了 sql_builder().

被这些函数引用 neforce::repository< T, Connect >::count().

◆ select_dense_rank()

sql_builder & neforce::sql_builder::select_dense_rank ( string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加DENSE_RANK窗口函数

参数
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_distinct()

sql_builder & neforce::sql_builder::select_distinct ( string field)

添加DISTINCT字段

参数
field字段名
返回
自身引用

引用了 sql_builder().

◆ select_first_value()

sql_builder & neforce::sql_builder::select_first_value ( string field,
string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加FIRST_VALUE窗口函数

参数
field目标字段名
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_lag()

sql_builder & neforce::sql_builder::select_lag ( string field,
string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加LAG窗口函数

参数
field目标字段名
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_last_value()

sql_builder & neforce::sql_builder::select_last_value ( string field,
string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加LAST_VALUE窗口函数

参数
field目标字段名
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_lead()

sql_builder & neforce::sql_builder::select_lead ( string field,
string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加LEAD窗口函数

参数
field目标字段名
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_max() [1/2]

sql_builder & neforce::sql_builder::select_max ( string field)

添加MAX聚合函数(无别名)

参数
field求最大字段名
返回
自身引用

引用了 sql_builder().

◆ select_max() [2/2]

sql_builder & neforce::sql_builder::select_max ( string field,
string alias )

添加MAX聚合函数(带别名)

参数
field求最大字段名
alias结果别名
返回
自身引用

引用了 sql_builder().

◆ select_min() [1/2]

sql_builder & neforce::sql_builder::select_min ( string field)

添加MIN聚合函数(无别名)

参数
field求最小字段名
返回
自身引用

引用了 sql_builder().

◆ select_min() [2/2]

sql_builder & neforce::sql_builder::select_min ( string field,
string alias )

添加MIN聚合函数(带别名)

参数
field求最小字段名
alias结果别名
返回
自身引用

引用了 sql_builder().

◆ select_ntile()

sql_builder & neforce::sql_builder::select_ntile ( int buckets,
string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加NTILE窗口函数

参数
buckets分桶数量
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_rank()

sql_builder & neforce::sql_builder::select_rank ( string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加RANK窗口函数

参数
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 sql_builder().

◆ select_row_number()

sql_builder & neforce::sql_builder::select_row_number ( string alias,
const vector< string > & partition_by = {},
const vector< string > & order_by = {} )

添加ROW_NUMBER窗口函数

参数
alias结果别名
partition_byPARTITION BY字段列表(可选)
order_byORDER BY字段列表(可选)
返回
自身引用

引用了 select_row_number() , 以及 sql_builder().

被这些函数引用 select_row_number().

◆ select_subquery() [1/2]

sql_builder & neforce::sql_builder::select_subquery ( string subquery)

添加子查询作为SELECT字段(无别名)

参数
subquery子查询SQL
返回
自身引用

引用了 sql_builder().

◆ select_subquery() [2/2]

sql_builder & neforce::sql_builder::select_subquery ( string subquery,
string alias )

添加子查询作为SELECT字段

参数
subquery子查询SQL
alias别名
返回
自身引用

引用了 sql_builder().

◆ select_sum() [1/2]

sql_builder & neforce::sql_builder::select_sum ( string field)

添加SUM聚合函数(无别名)

参数
field求和字段名
返回
自身引用

引用了 sql_builder().

◆ select_sum() [2/2]

sql_builder & neforce::sql_builder::select_sum ( string field,
string alias )

添加SUM聚合函数(带别名)

参数
field求和字段名
alias结果别名
返回
自身引用

引用了 sql_builder().

◆ set() [1/2]

sql_builder & neforce::sql_builder::set ( string assignment)

添加SET赋值

参数
assignment赋值表达式(如"field = value")
返回
自身引用

引用了 set() , 以及 sql_builder().

被这些函数引用 set(), set() , 以及 set_param().

◆ set() [2/2]

sql_builder & neforce::sql_builder::set ( string field,
string value )

添加SET赋值(字段=值形式)

参数
field字段名
value
返回
自身引用

引用了 set() , 以及 sql_builder().

◆ set_decrement()

sql_builder & neforce::sql_builder::set_decrement ( string field,
int value = 1 )

添加自减赋值

参数
field字段名
value减少量,默认为1
返回
自身引用

引用了 set_decrement() , 以及 sql_builder().

被这些函数引用 set_decrement().

◆ set_dialect()

sql_builder & neforce::sql_builder::set_dialect ( const sql_dialect dialect)
inlinenoexcept

设置数据库方言

参数
dialect目标数据库方言
返回
自身引用

设置后 build() 会根据方言调整生成的 SQL 语法。

在文件 sql_builder.hpp1390 行定义.

引用了 dialect() , 以及 sql_builder().

被这些函数引用 neforce::sql_mapper< T >::delete_sql(), neforce::sql_mapper< T >::insert_sql(), neforce::sql_mapper< T >::select_by_pk_sql() , 以及 neforce::sql_mapper< T >::update_sql().

◆ set_increment()

sql_builder & neforce::sql_builder::set_increment ( string field,
int value = 1 )

添加自增赋值

参数
field字段名
value增加量,默认为1
返回
自身引用

引用了 set_increment() , 以及 sql_builder().

被这些函数引用 set_increment().

◆ set_param()

sql_builder & neforce::sql_builder::set_param ( string field)
inline

添加 SET 赋值

参数
field字段名
返回
自身引用

自动使用下一个参数占位符

在文件 sql_builder.hpp1436 行定义.

引用了 neforce::move(), next_placeholder(), set() , 以及 sql_builder().

被这些函数引用 neforce::sql_mapper< T >::update_sql().

◆ table()

◆ table_check()

sql_builder & neforce::sql_builder::table_check ( string expr)

添加表级CHECK约束

参数
exprCHECK表达式
返回
自身引用

引用了 sql_builder().

◆ table_foreign_key()

sql_builder & neforce::sql_builder::table_foreign_key ( string column,
string ref_table,
string ref_column )

添加表级FOREIGN KEY约束

参数
column外键列名
ref_table引用表名
ref_column引用列名
返回
自身引用

引用了 column() , 以及 sql_builder().

◆ table_primary_key()

sql_builder & neforce::sql_builder::table_primary_key ( vector< string > columns)

添加表级PRIMARY KEY约束

参数
columns主键列列表
返回
自身引用

引用了 columns() , 以及 sql_builder().

◆ table_unique()

sql_builder & neforce::sql_builder::table_unique ( vector< string > columns)

添加表级UNIQUE约束

参数
columns唯一约束列列表
返回
自身引用

引用了 columns() , 以及 sql_builder().

◆ truncate()

sql_builder & neforce::sql_builder::truncate ( string table)

截断表(TRUNCATE TABLE)

参数
table表名
返回
自身引用

引用了 sql_builder() , 以及 table().

◆ type()

sql_operate neforce::sql_builder::type ( ) const
inlinenodiscardnoexcept

获取当前SQL操作类型

返回
操作类型

在文件 sql_builder.hpp1369 行定义.

引用了 type().

被这些函数引用 add_column(), column(), column_auto_increment(), column_check(), column_default(), column_not_null(), column_primary_key(), column_unique(), join() , 以及 type().

◆ union_()

sql_builder & neforce::sql_builder::union_ ( string query)

添加UNION集合操作

参数
query要合并的查询SQL
返回
自身引用

引用了 sql_builder() , 以及 union_().

被这些函数引用 union_().

◆ union_all()

sql_builder & neforce::sql_builder::union_all ( string query)

添加UNION ALL集合操作

参数
query要合并的查询SQL
返回
自身引用

引用了 sql_builder() , 以及 union_all().

被这些函数引用 union_all().

◆ update()

sql_builder & neforce::sql_builder::update ( string table)

设置UPDATE表名

参数
table表名
返回
自身引用

引用了 sql_builder(), table() , 以及 update().

被这些函数引用 update() , 以及 neforce::sql_mapper< T >::update_sql().

◆ values() [1/3]

sql_builder & neforce::sql_builder::values ( std::initializer_list< string > values)

设置VALUES占位符

参数
values值占位符初始化列表(如"?"或实际值)
返回
自身引用

引用了 sql_builder() , 以及 values().

◆ values() [2/3]

sql_builder & neforce::sql_builder::values ( vector< string > values)

设置VALUES占位符

参数
values值占位符列表(如"?"或实际值)
返回
自身引用

引用了 sql_builder() , 以及 values().

被这些函数引用 add_values(), values(), values(), values(), where_in() , 以及 where_not_in().

◆ values() [3/3]

sql_builder & neforce::sql_builder::values ( vector< vector< string > > value_rows)

设置多行VALUES(批量插入)

参数
value_rows值占位符列表的列表,第一行为主行,其余为附加行
返回
自身引用

引用了 sql_builder() , 以及 values().

◆ where()

sql_builder & neforce::sql_builder::where ( string condition)

添加WHERE条件

参数
condition条件表达式
返回
自身引用

引用了 sql_builder() , 以及 where().

被这些函数引用 neforce::repository< T, Connect >::find_where() , 以及 where().

◆ where_between()

sql_builder & neforce::sql_builder::where_between ( string field,
string start,
string end )

添加BETWEEN条件

参数
field字段名
start起始值
end结束值
返回
自身引用

引用了 neforce::end(), sql_builder() , 以及 where_between().

被这些函数引用 where_between().

◆ where_eq()

sql_builder & neforce::sql_builder::where_eq ( string field,
string value )

◆ where_exists()

sql_builder & neforce::sql_builder::where_exists ( string subquery)

添加EXISTS条件

参数
subquery子查询
返回
自身引用

引用了 sql_builder() , 以及 where_exists().

被这些函数引用 where_exists().

◆ where_ge()

sql_builder & neforce::sql_builder::where_ge ( string field,
string value )

添加大于等于条件

参数
field字段名
value
返回
自身引用

引用了 sql_builder() , 以及 where_ge().

被这些函数引用 where_ge().

◆ where_gt()

sql_builder & neforce::sql_builder::where_gt ( string field,
string value )

添加大于条件

参数
field字段名
value
返回
自身引用

引用了 sql_builder() , 以及 where_gt().

被这些函数引用 where_gt().

◆ where_in()

sql_builder & neforce::sql_builder::where_in ( string field,
vector< string > values )

添加IN条件

参数
field字段名
values值列表
返回
自身引用

引用了 sql_builder(), values() , 以及 where_in().

被这些函数引用 where_in().

◆ where_is_not_null()

sql_builder & neforce::sql_builder::where_is_not_null ( string field)

添加IS NOT NULL条件

参数
field字段名
返回
自身引用

引用了 sql_builder() , 以及 where_is_not_null().

被这些函数引用 where_is_not_null().

◆ where_is_null()

sql_builder & neforce::sql_builder::where_is_null ( string field)

添加IS NULL条件

参数
field字段名
返回
自身引用

引用了 sql_builder() , 以及 where_is_null().

被这些函数引用 where_is_null().

◆ where_le()

sql_builder & neforce::sql_builder::where_le ( string field,
string value )

添加小于等于条件

参数
field字段名
value
返回
自身引用

引用了 sql_builder() , 以及 where_le().

被这些函数引用 where_le().

◆ where_like()

sql_builder & neforce::sql_builder::where_like ( string field,
string pattern )

添加LIKE条件

参数
field字段名
pattern模式
返回
自身引用

引用了 sql_builder() , 以及 where_like().

被这些函数引用 where_like().

◆ where_lt()

sql_builder & neforce::sql_builder::where_lt ( string field,
string value )

添加小于条件

参数
field字段名
value
返回
自身引用

引用了 sql_builder() , 以及 where_lt().

被这些函数引用 where_lt().

◆ where_ne()

sql_builder & neforce::sql_builder::where_ne ( string field,
string value )

添加不等条件

参数
field字段名
value
返回
自身引用

引用了 sql_builder() , 以及 where_ne().

被这些函数引用 where_ne().

◆ where_not_between()

sql_builder & neforce::sql_builder::where_not_between ( string field,
string start,
string end )

添加NOT BETWEEN条件

参数
field字段名
start起始值
end结束值
返回
自身引用

引用了 neforce::end(), sql_builder() , 以及 where_not_between().

被这些函数引用 where_not_between().

◆ where_not_exists()

sql_builder & neforce::sql_builder::where_not_exists ( string subquery)

添加NOT EXISTS条件

参数
subquery子查询
返回
自身引用

引用了 sql_builder() , 以及 where_not_exists().

被这些函数引用 where_not_exists().

◆ where_not_in()

sql_builder & neforce::sql_builder::where_not_in ( string field,
vector< string > values )

添加NOT IN条件

参数
field字段名
values值列表
返回
自身引用

引用了 sql_builder(), values() , 以及 where_not_in().

被这些函数引用 where_not_in().

◆ where_not_like()

sql_builder & neforce::sql_builder::where_not_like ( string field,
string pattern )

添加NOT LIKE条件

参数
field字段名
pattern模式
返回
自身引用

引用了 sql_builder() , 以及 where_not_like().

被这些函数引用 where_not_like().

◆ with_()

sql_builder & neforce::sql_builder::with_ ( string name,
string query )

添加CTE(WITH子句)

参数
nameCTE名称
queryCTE查询SQL
返回
自身引用

引用了 sql_builder() , 以及 with_().

被这些函数引用 with_().

◆ with_recursive()

sql_builder & neforce::sql_builder::with_recursive ( string name,
string query )

添加递归CTE(WITH RECURSIVE子句)

参数
nameCTE名称
queryCTE查询SQL
返回
自身引用

引用了 sql_builder() , 以及 with_recursive().

被这些函数引用 with_recursive().


该类的文档由以下文件生成: