Skip to content

Commit

Permalink
add test for #636
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-hykin committed Apr 16, 2024
1 parent 2d7198b commit b8ac792
Show file tree
Hide file tree
Showing 2 changed files with 509 additions and 0 deletions.
28 changes: 28 additions & 0 deletions language_examples/#636.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include "MyAwesomeDatabaseLibrary.h"
#include <string>
#include <iostream>

int main(int argc, char** argv)
{
std::string plate = argv[1];

AwesomeDBConnection conn;

conn.Open("myconnectionstring");

auto query = conn.Execute(R"sql(
SELECT uid, part_name, install_date FROM CarParts
WHERE plate = ')sql" + plate + "' ORDER BY install_date");

for (const auto& entry : query)
{
std::cout << entry["uid"] << ": ";
std::cout << entry["part_name"] << ", ";
std::cout << entry["install_date"] << std::endl;
}

conn.Close();

return 0;
}
Loading

0 comments on commit b8ac792

Please sign in to comment.