using songs from practice db

master
Matt Huntington 6 months ago
parent bb5c4ff0ab
commit 29a6b36315

@ -31,8 +31,7 @@ int main()
driver = get_driver_instance(); driver = get_driver_instance();
CROW_ROUTE(app, "/sessions").methods(crow::HTTPMethod::POST)([](const crow::request& req){ CROW_ROUTE(app, "/sessions").methods(crow::HTTPMethod::POST)([](const crow::request& req){
con = driver->connect(getenv("DBURL"),getenv("DBUSER"),getenv("DBPWD")); connect();
con->setSchema("practice");
crow::json::wvalue status; crow::json::wvalue status;
auto request_body = crow::json::load(req.body); auto request_body = crow::json::load(req.body);
@ -71,9 +70,7 @@ int main()
}); });
CROW_ROUTE(app, "/songs")([](){ CROW_ROUTE(app, "/songs")([](){
con = driver->connect(getenv("DBURL"),getenv("DBUSER"),getenv("DBPWD")); connect();
con->setSchema("my_group_songs");
stmt = con->createStatement();
crow::json::wvalue entries; crow::json::wvalue entries;
ResultSet *res = stmt->executeQuery("SELECT * FROM songs WHERE learned=True ORDER BY title ASC;"); ResultSet *res = stmt->executeQuery("SELECT * FROM songs WHERE learned=True ORDER BY title ASC;");

Loading…
Cancel
Save