@@ -307,13 +303,13 @@ func (s *Stmt) BindParameterIndex(name string) int {
...
@@ -307,13 +303,13 @@ 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()
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.
iferr!=nil{
iferr!=nil{
returnerr
returnerr
}
}
n:=s.BindParameterCount()
n:=s.BindParameterCount()
ifn!=len(args){
ifn!=len(args){// TODO What happens when the number of arguments is less than the number of parameters?
returnos.NewError(fmt.Sprintf("incorrect argument count for Stmt.Bind: have %d want %d",len(args),n))
returnos.NewError(fmt.Sprintf("incorrect argument count for Stmt.Bind: have %d want %d",len(args),n))