From 29a6b36315a7da575820932fdef97445c1aac0ab Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 30 Jun 2025 21:21:16 -0400 Subject: [PATCH] using songs from practice db --- server.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server.cpp b/server.cpp index f8ccc0e..33c0a87 100644 --- a/server.cpp +++ b/server.cpp @@ -31,8 +31,7 @@ int main() driver = get_driver_instance(); CROW_ROUTE(app, "/sessions").methods(crow::HTTPMethod::POST)([](const crow::request& req){ - con = driver->connect(getenv("DBURL"),getenv("DBUSER"),getenv("DBPWD")); - con->setSchema("practice"); + connect(); crow::json::wvalue status; auto request_body = crow::json::load(req.body); @@ -71,9 +70,7 @@ int main() }); CROW_ROUTE(app, "/songs")([](){ - con = driver->connect(getenv("DBURL"),getenv("DBUSER"),getenv("DBPWD")); - con->setSchema("my_group_songs"); - stmt = con->createStatement(); + connect(); crow::json::wvalue entries; ResultSet *res = stmt->executeQuery("SELECT * FROM songs WHERE learned=True ORDER BY title ASC;");