2022-12-21 20:30:44 +08:00
|
|
|
#ifndef DB_OPERATION_H_
|
|
|
|
#define DB_OPERATION_H_
|
|
|
|
#include <windows.h>
|
|
|
|
#include <vector>
|
|
|
|
struct SqlResult {
|
|
|
|
char *column_name;
|
|
|
|
DWORD column_name_len;
|
|
|
|
char *content;
|
|
|
|
DWORD content_len;
|
|
|
|
BOOL is_blob;
|
|
|
|
};
|
|
|
|
/// @brief exec sql
|
|
|
|
/// @param db opened db
|
|
|
|
/// @param sql sql
|
|
|
|
/// @param callback callback func
|
|
|
|
/// @param data data
|
|
|
|
/// @return
|
|
|
|
int ExecuteSQL(DWORD db, const char *sql, DWORD callback, void *data);
|
|
|
|
|
2023-02-06 11:21:13 +08:00
|
|
|
int Select(DWORD db_hanle, const char *sql,std::vector<std::vector<std::string>> &query_result);
|
2022-12-21 20:30:44 +08:00
|
|
|
|
|
|
|
#endif
|