chenchun / gosqlite

Automatically exported from code.google.com/p/gosqlite
0 stars 0 forks source link

Get the field names of a table #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To get the field names of a table is neccesary the next functions:

* * *
func (s *Stmt) Columns() int {
    return int(C.sqlite3_column_count(s.stmt))
}

func (s *Stmt) ColumnName(column int) (name string) {
    cname := C.sqlite3_column_name(s.stmt, C.int(column))
    name = C.GoString(cname)
    return
* * *

Original issue reported on code.google.com by raul....@sent.com on 2 Dec 2010 at 12:35