mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
init sqlite database library
This commit is contained in:
parent
cf64949986
commit
814b25a946
7 changed files with 57 additions and 5 deletions
12
src/lib/database.cpp
Normal file
12
src/lib/database.cpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include "database.hpp"
|
||||
|
||||
using namespace lib;
|
||||
|
||||
Database::Database(
|
||||
const char * filename
|
||||
) {
|
||||
status = sqlite3_open(
|
||||
filename,
|
||||
&connection
|
||||
);
|
||||
}
|
||||
26
src/lib/database.hpp
Normal file
26
src/lib/database.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef LIB_DATABASE_H
|
||||
#define LIB_DATABASE_H
|
||||
|
||||
#include <sqlite3.h>
|
||||
|
||||
namespace lib
|
||||
{
|
||||
class Database
|
||||
{
|
||||
private:
|
||||
|
||||
int status;
|
||||
|
||||
char * error;
|
||||
|
||||
sqlite3 * connection;
|
||||
|
||||
public:
|
||||
|
||||
Database(
|
||||
const char * filename
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // LIB_DATABASE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue