newLISP Fan Club

Forum => newLISP in the real world => Topic started by: Kirill on November 09, 2009, 02:42:45 PM

Title: SQLite API - access column names for a query
Post by: Kirill on November 09, 2009, 02:42:45 PM
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
Title: Re: SQLite API - access column names for a query
Post by: Lutz on November 09, 2009, 05:25:58 PM
Now documented here: http://www.newlisp.org/code/modules/sqlite3.lsp.html#sql3_col-names
Title: Re: SQLite API - access column names for a query
Post by: Kirill on November 10, 2009, 03:10:51 AM
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!
Title: Re: SQLite API - access column names for a query
Post by: Kirill on November 10, 2009, 01:58:46 PM
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.