sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

column names are not exposed in Cursor

Open kkartaltepe opened this issue 2 years ago • 0 comments

Its a bit annoying to use the Cursor interface while also accessing column names. Column names are exposed by the base Statement but because it is consumed by into_cursor() you cannot hold references to column_names() across into_cursor().

Motivating example:

let s = conn.prepare("select * from dual")?;
let cols = s.column_names();
let c = s.into_cursor();
let err0505 = cols[1];

A simple solution would be to also expose column_names() on the cursor directly.

kkartaltepe avatar Apr 21 '22 17:04 kkartaltepe