Newer
Older
- postgresql(libpq)
- sqlite(sqlite-dev)
- duckdb(duckdb headers)
- C++14
1. cd libdbpp
2. mkdir build
3. cd build
4. cmake ../
5. make || ninja
int main(int argc,char **argv){
dbpp::Database db(atoi(argv[1]),argv[2]);
dbpp::DBResult res;
dbpp::SQL sql;
<< db.autoincrement(sql)
<< ",name VARCHAR(255),value TEXT);";
std::cout << "Enter Value: " << std::endl;
std::cin >> value;
sql << "INSERT INTO test (name,value) VALUES"
<< "('"<< name.c_str() <<"','" << value.c_str() << "');";
for(int i=0; i<count; ++i){
std::cout << "name: " << res[i][0]
<< " value:" << res[i][1]
<< std::endl;
}