SQLite API - access column names for a query

Started by Kirill, November 09, 2009, 02:42:45 PM

Previous topic - Next topic

Kirill

sql3:col-names and sql3:col-types are not mentioned in the documentation of the module for accessing an SQLite database. Still, especially sql3:col-names is useful in situations where one wants to know what columns are returned after doing, e.g. a select * from <table> In this particular case the columns may be retrieved by using (sql3:columns <table>), but that would be an ugly workaround. What if the user specifies select count(*) as count,* from <table> sql3:col-names would give me the correct number of columns with their names.



I'd like to see a documented accessor to sql3:col-names.



Thanks :)



-- Kirill

Lutz

#1
Now documented here: http://www.newlisp.org/code/modules/sqlite3.lsp.html#sql3_col-names">http://www.newlisp.org/code/modules/sql ... _col-names">http://www.newlisp.org/code/modules/sqlite3.lsp.html#sql3_col-names

Kirill

#2
Now that it's documented, it is a part of the API and it's safe to use it - it won't just seddenly disappear.



Thank you!

Kirill

#3
Lutz, col-names is now not consistent with the rest of the functions. Could you please add a wrapper as for rowid. It's only three lines.



Thank you.