Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RameshJangama opened this issue Jun 26, 2019 · 1 comment
Open

Comments

@RameshJangama
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants