mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-01 11:43:41 +00:00
34 lines
785 B
C++
34 lines
785 B
C++
#pragma once
|
|
#include "../../Session.h"
|
|
|
|
struct sqlite3;
|
|
namespace DB
|
|
{
|
|
|
|
class SQLiteSession : public Session
|
|
{
|
|
|
|
sqlite3* conn = nullptr;
|
|
|
|
public:
|
|
|
|
SQLiteSession();
|
|
SQLiteSession(const ConnParams& params);
|
|
~SQLiteSession();
|
|
void open(const ConnParams& params);
|
|
bool execute(const std::string& query);
|
|
Session& query(const std::string& query, std::function<bool(const Row&)> callback);
|
|
SharedPointer<Stmt> prepare(const std::string& query, bool autoExecute = false);
|
|
std::string getLastError() const;
|
|
uint64_t getAffectedRows() const;
|
|
uint64_t getLastInsertId() const;
|
|
void close();
|
|
bool isOpen();
|
|
DBType getType();
|
|
|
|
SharedPointer<Stmt> operator<<(const std::string& query);
|
|
|
|
friend class SQLiteStmt;
|
|
};
|
|
|
|
} // namespace DB
|