Open aiafrasinei opened 5 years ago
I wouldn't recommend this, because "SELECT * FROM multiverse;"
is more fragile if the table ever changes, but sqlite_modern_cpp never parses your SQL command in any way, it is directly forwarded to sqlite. So iff your table contains three columns idx,name,shells_nr
in this order, then "SELECT * FROM multiverse;"
behaves in the same way as "SELECT idx,name,shells_nr FROM multiverse;";
.
tl;dr: Have you tried using const char* sql = "SELECT * FROM multiverse;";
in your example code above? At least on my system, it works.
This is more of a question, i didnt find an answer by looking at examples and tests. Im trying to convert below sqlite3 code to this c++ api.
So i translated this to sqlitemodern_cpp form:
Works great. But i dont want to change the sqls to include all the column names. Is there a way to write in sql_modern_sql to access all columns by index ?
so i can use: char sql = "SELECT FROM multiverse;";