mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +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
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue