SqliteModernCpp / sqlite_modern_cpp

The C++14 wrapper around sqlite library
MIT License
904 stars 156 forks source link

[Need help] how to get column name, type and row count for select * #181

Open RameshJangama opened 5 years ago

RameshJangama commented 5 years ago

Sorry asking here but I wanted to use this library for my project but how to get name of columns, data type of columns and number of retuned rows for “select * from ...” kind of queries? In example provided, especially lambdas, exact columns with right types need to be added but I don’t don’t know what query I receive so I want extract column name and data type from result. Any simple example please.

BrannonKing commented 4 years ago

so you're looking for something like this?

db << "SELECT * FROM table" 
   >> [](const vector<pair<string, variant<int64, double, string, blob_t, null_t>>>& kvps) { ... };