|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
SQL连接CRTP基类 更多...
#include <sql_connect_base.hpp>
Public 成员函数 | |
| bool | begin () final |
| 开始事务 | |
| bool | commit () final |
| 提交事务 | |
| bool | rollback () final |
| 回滚事务 | |
| void * | native_handle () noexcept final |
| 获取原生连接句柄 | |
| Public 成员函数 继承自 neforce::idb_tb_connect | |
| virtual unique_ptr< idb_tb_result > | query (const string &sql) const =0 |
| 执行查询SQL语句 | |
| virtual unique_ptr< idb_prepared_statement > | prepare_statement (const string &sql) const =0 |
| 创建预处理语句 | |
| Public 成员函数 继承自 neforce::idb_connect | |
| virtual bool | update (const string &sql) const =0 |
| 执行非查询SQL语句 | |
| void | refresh_alive () noexcept |
| 刷新连接存活时间 | |
| clock_type | get_alive () const noexcept |
| 获取连接空闲时间 | |
| virtual bool | connect (const db_config &config)=0 |
| 建立连接 | |
| virtual bool | reconnect (const db_config &config)=0 |
| 重新连接 | |
| virtual void | close ()=0 |
| 关闭连接 | |
| virtual bool | set_character_set (const string &encoding)=0 |
| 设置字符集 | |
| virtual string_view | get_character_set () const =0 |
| 获取字符集 | |
| virtual string_view | get_error () const =0 |
| 获取错误信息 | |
| virtual uint32_t | get_errno () const =0 |
| 获取错误码 | |
| virtual bool | connected () const =0 |
| 检查连接状态 | |
| virtual bool | is_valid () const =0 |
| 检查连接有效性 | |
额外继承的成员函数 | |
| Public 类型 继承自 neforce::idb_connect | |
| using | clock_type = milliseconds |
| 存活时间计时器类型 | |
SQL连接CRTP基类
通过CRTP静态多态为MySQL/PostgreSQL/SQLite提供事务管理和表存在性检查的共享实现。
| Derived | 派生类类型 |
派生类需要提供:
在文件 sql_connect_base.hpp 第 38 行定义.
|
inlinenodiscardfinalvirtualnoexcept |