Commit cb4fb030 authored by gwenn's avatar gwenn

Add binding to sqlite3_column_decltype.

parent aa28066a
......@@ -165,6 +165,12 @@ func (s *Stmt) ColumnOriginName(index int) string {
return C.GoString(C.sqlite3_column_origin_name(s.stmt, C.int(index)))
}
// The left-most column is column 0
// (See http://www.sqlite.org/c3ref/column_decltype.html)
func (s *Stmt) ColumnDeclaredType(index int) string {
return C.GoString(C.sqlite3_column_decltype(s.stmt, C.int(index)))
}
// See Conn.ForeignKeys
type ForeignKey struct {
Table string
......
......@@ -125,4 +125,6 @@ func TestColumnMetadata(t *testing.T) {
assertEquals(t, "wrong table name: %q <> %q", "sqlite_master", tableName)
originName := s.ColumnOriginName(0)
assertEquals(t, "wrong origin name: %q <> %q", "name", originName)
declType := s.ColumnDeclaredType(0)
assertEquals(t, "wrong declared type: %q <> %q", "text", declType)
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment