diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dfd9a6..f965e73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.11) project(park) set(CMAKE_CXX_STANDARD 11) diff --git a/Query.cpp b/Query.cpp index bbc1a26..ecebb11 100644 --- a/Query.cpp +++ b/Query.cpp @@ -94,16 +94,16 @@ Customer query_customer_with_id(int id) { -// vector populate_spots(){ -// vector spots; -// SQLite::Statement query(data::db, "SELECT * FROM Park_spot WHERE id > 0;"); -// // query.bind(1, 2); -// while (query.executeStep()) { -// int id = query.getColumn(0); -// int taken = query.getColumn(1); -// int cid = query.getColumn(2); -// // park_customers.push_back(query_customer_with_id(cid)); -// spots.push_back({id, taken, cid}); -// } -// return spots; -// } \ No newline at end of file +vector populate_spots(){ + vector spots; + SQLite::Statement query(data::db, "SELECT * FROM Park_spot WHERE id > 0;"); + // query.bind(1, 2); + while (query.executeStep()) { + int id = query.getColumn(0); + int taken = query.getColumn(1); + int cid = query.getColumn(2); + // park_customers.push_back(query_customer_with_id(cid)); + spots.push_back({id, taken, cid}); + } + return spots; +} \ No newline at end of file diff --git a/main.cpp b/main.cpp index 3fc3dd5..872fd19 100644 --- a/main.cpp +++ b/main.cpp @@ -43,21 +43,23 @@ int main() { cout << "\n" << i.id << "," << i.parked_customer; } + populate_spots(); + } -vector populate_spots(){ - vector spots; - SQLite::Statement query(data::db, "SELECT * FROM Park_spot WHERE id > 0;"); - // query.bind(1, 2); - while (query.executeStep()) { - int id = query.getColumn(0); - int taken = query.getColumn(1); - int cid = query.getColumn(2); - // park_customers.push_back(query_customer_with_id(cid)); - spots.push_back({id, taken, cid}); - } - return spots; -} \ No newline at end of file +// vector populate_spots(){ +// vector spots; +// SQLite::Statement query(data::db, "SELECT * FROM Park_spot WHERE id > 0;"); +// // query.bind(1, 2); +// while (query.executeStep()) { +// int id = query.getColumn(0); +// int taken = query.getColumn(1); +// int cid = query.getColumn(2); +// // park_customers.push_back(query_customer_with_id(cid)); +// spots.push_back({id, taken, cid}); +// } +// return spots; +// } \ No newline at end of file