init sqlite database library

This commit is contained in:
yggverse 2024-08-11 12:35:57 +03:00
parent cf64949986
commit 814b25a946
7 changed files with 57 additions and 5 deletions

12
src/lib/database.cpp Normal file
View 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
View 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

View file

@ -1,10 +1,16 @@
#include "main.hpp"
#include "app/browser.hpp"
#include "lib/database.hpp"
int main(
int argc,
char * argv[]
) {
// Init profile
auto database = lib::Database(
"database.sqlite3"
);
// Init app
auto app = Gtk::Application::create(
"io.github.yggverse.Yoda"