Parkmanne/data.cpp

24 lines
726 B
C++

#include "headers/data.h"
namespace data {
SQLite::Database start_db() {
SQLite::Database db("test.db3",
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
while (sodium_init() < 0) {
std::cout << "SODIUM NOT WORKING";
}
db.exec(
"create table if not exists Customer (id integer primary key, name "
"text, password text, verhicle int)");
db.exec(
"create table if not exists Park_spot (id integer primary key, taken "
"int, customer_id int)");
db.exec(
"create table if not exists Park_time (id integer primary key, "
"customer_id int, spot_id int, start int, end int, duration int)");
return db;
}
} // namespace data