customer can be saved into db

This commit is contained in:
MassiveAtoms
2019-06-26 15:12:23 -03:00
parent 2e22008040
commit f11ebc6a9c
7 changed files with 75 additions and 36 deletions

14
data.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "headers/data.h"
namespace data {
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 real, end real, duration real)");
return db;
}
} // namespace data