X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fccbs_bigscreen.cpp;h=2dbb34a81fe21ac37550cbac08caaf1332b6bc92;hp=dc31c06c2e1096e63748aa9eeb2c7a3e7a2accd8;hb=c2208d9a688b56565cd84db6152181ebd26781a0;hpb=9a52077de6b9ebda35e2db899f0dda30c41fb7af diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index dc31c06..2dbb34a 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -9,6 +9,13 @@ int main(int argc, char **argv) try { pqxx::connection conn("dbname=ccbs host=sql.samfundet.no user=ccbs password=GeT|>>B_"); pqxx::transaction<> t(conn, "trx"); + + // fetch all songs + pqxx::result res( t.exec("SELECT * FROM songs") ); + for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) { + std::fprintf(stderr, "%s\n", i["title"].c_str()); + } + t.commit(); } catch (const std::exception &e) { std::fprintf(stderr, "Exception: %s\n", e.what()); exit(1);