MCPcopy Create free account
hub / github.com/SqliteModernCpp/sqlite_modern_cpp / LogRequest

Method LogRequest

tests/trycatchblocks.cc:31–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 }
30
31 void LogRequest( const string& username, const string& ip, const string& request )
32 {
33 try {
34 auto timestamp = std::to_string( time( nullptr ) );
35
36 db <<
37 "create table if not exists log_request ("
38 " _id integer primary key autoincrement not null,"
39 " username text,"
40 " timestamp text,"
41 " ip text,"
42 " request text"
43 ");";
44 db << "INSERT INTO log_request (username, timestamp, ip, request) VALUES (?,?,?,?);"
45 << username
46 << timestamp
47 << ip
48 << request;
49 } catch ( const std::exception& e ) {
50 std::cout << e.what() << std::endl;
51 }
52 }
53
54 bool TestData( void ) {
55 try {

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected