Added constructors to construct from db info

This is in no way finished. CHECK TODOs!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This commit is contained in:
TinyAtoms
2019-06-30 00:37:18 -03:00
parent 085cd5af08
commit bf17b82c2e
10 changed files with 136 additions and 124 deletions

View File

@ -2,12 +2,20 @@
namespace data {
SQLite::Database start_db() {
SQLite::Database db("test.db3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
SQLite::Database
start_db() {
SQLite::Database db("test.db3",
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
db.exec("create table if not exists Customer (id integer primary key, name text, card_code varchar(20), verhicle int)");
db.exec("create table if not exists Park_spot (id integer primary key, taken boolean, 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)");
db.exec(
"create table if not exists Customer (id integer primary key, name "
"text, card_code varchar(20), verhicle int)");
db.exec(
"create table if not exists Park_spot (id integer primary key, taken "
"boolean, 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;
}