mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
38 lines
788 B
C++
38 lines
788 B
C++
#ifndef DATABASE_H
|
|
#define DATABASE_H
|
|
|
|
#include <string>
|
|
|
|
enum QueryErrorCode {
|
|
OK,
|
|
ERROR
|
|
};
|
|
|
|
class QueryResult {
|
|
public:
|
|
//rows
|
|
//next_row()
|
|
//get_int(int index)
|
|
//get_string(int column) etc
|
|
};
|
|
|
|
class Database {
|
|
public:
|
|
//probably needs refcount, depending on what db engines do, todo
|
|
//virtual QueryResult *query(const std::string &sql);
|
|
//virtual QueryResult *query_async(const std::string &sql);
|
|
//or
|
|
//virtual QueryErrorCode query(QueryResult *result, const std::string &sql);
|
|
//virtual QueryErrorCode query_async(QueryResult *result, const std::string &sql);
|
|
|
|
//also
|
|
//virtual QueryResult *query_prepared(const std::string &sql, param1, param2, ...);
|
|
|
|
//query interface (codeigniter 3 style)
|
|
//virtual void where(""); etc
|
|
|
|
Database();
|
|
~Database();
|
|
};
|
|
|
|
#endif |