@@ -303,7 +307,7 @@ func (s *Stmt) BindParameterIndex(name string) int {
...
@@ -303,7 +307,7 @@ func (s *Stmt) BindParameterIndex(name string) int {
// Calls sqlite3_bind_parameter_count and sqlite3_bind_(blob|double|int|int64|null|text) depending on args type.
// Calls sqlite3_bind_parameter_count and sqlite3_bind_(blob|double|int|int64|null|text) depending on args type.
func(s*Stmt)Bind(args...interface{})os.Error{
func(s*Stmt)Bind(args...interface{})os.Error{
err:=s.Reset()// TODO sqlite3_clear_bindings: Contrary to the intuition of many, sqlite3_reset() does not reset the bindings on a prepared statement. Use this routine to reset all host parameters to NULL.
err:=s.Reset()// TODO sqlite3_clear_bindings?
iferr!=nil{
iferr!=nil{
returnerr
returnerr
}
}
...
@@ -375,6 +379,15 @@ func (s *Stmt) Reset() os.Error {
...
@@ -375,6 +379,15 @@ func (s *Stmt) Reset() os.Error {
returnnil
returnnil
}
}
// Calls sqlite3_clear_bindings
func(s*Stmt)ClearBindings()os.Error{
rv:=C.sqlite3_clear_bindings(s.stmt)
ifrv!=C.SQLITE_OK{
returns.c.error(rv)
}
returnnil
}
// Calls sqlite3_column_count
// Calls sqlite3_column_count
func(s*Stmt)ColumnCount()int{
func(s*Stmt)ColumnCount()int{
returnint(C.sqlite3_column_count(s.stmt))
returnint(C.sqlite3_column_count(s.stmt))
...
@@ -383,9 +396,17 @@ func (s *Stmt) ColumnCount() int {
...
@@ -383,9 +396,17 @@ func (s *Stmt) ColumnCount() int {
// The leftmost column is number 0.
// The leftmost column is number 0.
// Calls sqlite3_column_name
// Calls sqlite3_column_name
func(s*Stmt)ColumnName(indexint)string{
func(s*Stmt)ColumnName(indexint)string{
// If there is no AS clause then the name of the column is unspecified and may change from one release of SQLite to the next.