Ai
1 Star 0 Fork 0

天才楠/MySQL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mysql.hpp 935 Bytes
一键复制 编辑 原始数据 按行查看 历史
天才楠 提交于 2024-09-18 12:44 +08:00 . mysql
/**
* title: mysql.hpp
* author: sleeeeeping
* created: 2024-09-12 19:21:35
**/
#ifndef _MYSQL_HPP__
#define _MYSQL_HPP__
#include <vector>
#include <iostream>
#include <mysql/mysql.h>
using u32 = unsigned int;
class MySQL {
private:
MYSQL *mysql;
std::vector<std::vector<std::string>> result;
public:
MySQL(void);
~MySQL(void);
bool connect(const std::string &host,
const std::string &user, const std::string &passwd,
const std::string &db, u32 port = 3306
);
int query(const std::string &sql);
const std::vector<std::vector<std::string>> &getQueryRestult(void);
bool getAutoCommit(void);
bool setAutoCommit(bool isAutoCommit);
bool commit(void);
bool rollback(void);
bool setCharacterSet(const std::string &csname);
const char* getCharacterSet(void);
void showError(void);
};
#endif // _MYSQL_HPP__
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tcnpp/MySQL.git
git@gitee.com:tcnpp/MySQL.git
tcnpp
MySQL
MySQL
master

搜索帮助