sqlite_modern_cpp icon indicating copy to clipboard operation
sqlite_modern_cpp copied to clipboard

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

Open RameshJangama opened this issue 6 years ago • 1 comments

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.

RameshJangama avatar Jun 26 '19 11:06 RameshJangama

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) { ... };

BrannonKing avatar Dec 10 '19 17:12 BrannonKing