@@ -837,17 +837,17 @@ func lastError(db *C.sqlite3) error {
837837
838838// Exec implements Execer.
839839func (c * SQLiteConn ) Exec (query string , args []driver.Value ) (driver.Result , error ) {
840- list := make ([]namedValue , len (args ))
840+ list := make ([]driver. NamedValue , len (args ))
841841 for i , v := range args {
842- list [i ] = namedValue {
842+ list [i ] = driver. NamedValue {
843843 Ordinal : i + 1 ,
844844 Value : v ,
845845 }
846846 }
847847 return c .exec (context .Background (), query , list )
848848}
849849
850- func (c * SQLiteConn ) exec (ctx context.Context , query string , args []namedValue ) (driver.Result , error ) {
850+ func (c * SQLiteConn ) exec (ctx context.Context , query string , args []driver. NamedValue ) (driver.Result , error ) {
851851 start := 0
852852 for {
853853 s , err := c .prepare (ctx , query )
@@ -856,7 +856,7 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue)
856856 }
857857 var res driver.Result
858858 if s .(* SQLiteStmt ).s != nil {
859- stmtArgs := make ([]namedValue , 0 , len (args ))
859+ stmtArgs := make ([]driver. NamedValue , 0 , len (args ))
860860 na := s .NumInput ()
861861 if len (args )- start < na {
862862 s .Close ()
@@ -894,28 +894,22 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue)
894894 }
895895}
896896
897- type namedValue struct {
898- Name string
899- Ordinal int
900- Value driver.Value
901- }
902-
903897// Query implements Queryer.
904898func (c * SQLiteConn ) Query (query string , args []driver.Value ) (driver.Rows , error ) {
905- list := make ([]namedValue , len (args ))
899+ list := make ([]driver. NamedValue , len (args ))
906900 for i , v := range args {
907- list [i ] = namedValue {
901+ list [i ] = driver. NamedValue {
908902 Ordinal : i + 1 ,
909903 Value : v ,
910904 }
911905 }
912906 return c .query (context .Background (), query , list )
913907}
914908
915- func (c * SQLiteConn ) query (ctx context.Context , query string , args []namedValue ) (driver.Rows , error ) {
909+ func (c * SQLiteConn ) query (ctx context.Context , query string , args []driver. NamedValue ) (driver.Rows , error ) {
916910 start := 0
917911 for {
918- stmtArgs := make ([]namedValue , 0 , len (args ))
912+ stmtArgs := make ([]driver. NamedValue , 0 , len (args ))
919913 s , err := c .prepare (ctx , query )
920914 if err != nil {
921915 return nil , err
@@ -1912,7 +1906,7 @@ func (s *SQLiteStmt) NumInput() int {
19121906
19131907var placeHolder = []byte {0 }
19141908
1915- func (s * SQLiteStmt ) bind (args []namedValue ) error {
1909+ func (s * SQLiteStmt ) bind (args []driver. NamedValue ) error {
19161910 rv := C .sqlite3_reset (s .s )
19171911 if rv != C .SQLITE_ROW && rv != C .SQLITE_OK && rv != C .SQLITE_DONE {
19181912 return s .c .lastError ()
@@ -1982,17 +1976,17 @@ func (s *SQLiteStmt) bind(args []namedValue) error {
19821976
19831977// Query the statement with arguments. Return records.
19841978func (s * SQLiteStmt ) Query (args []driver.Value ) (driver.Rows , error ) {
1985- list := make ([]namedValue , len (args ))
1979+ list := make ([]driver. NamedValue , len (args ))
19861980 for i , v := range args {
1987- list [i ] = namedValue {
1981+ list [i ] = driver. NamedValue {
19881982 Ordinal : i + 1 ,
19891983 Value : v ,
19901984 }
19911985 }
19921986 return s .query (context .Background (), list )
19931987}
19941988
1995- func (s * SQLiteStmt ) query (ctx context.Context , args []namedValue ) (driver.Rows , error ) {
1989+ func (s * SQLiteStmt ) query (ctx context.Context , args []driver. NamedValue ) (driver.Rows , error ) {
19961990 if err := s .bind (args ); err != nil {
19971991 return nil , err
19981992 }
@@ -2022,9 +2016,9 @@ func (r *SQLiteResult) RowsAffected() (int64, error) {
20222016
20232017// Exec execute the statement with arguments. Return result object.
20242018func (s * SQLiteStmt ) Exec (args []driver.Value ) (driver.Result , error ) {
2025- list := make ([]namedValue , len (args ))
2019+ list := make ([]driver. NamedValue , len (args ))
20262020 for i , v := range args {
2027- list [i ] = namedValue {
2021+ list [i ] = driver. NamedValue {
20282022 Ordinal : i + 1 ,
20292023 Value : v ,
20302024 }
@@ -2041,7 +2035,7 @@ func isInterruptErr(err error) bool {
20412035}
20422036
20432037// exec executes a query that doesn't return rows. Attempts to honor context timeout.
2044- func (s * SQLiteStmt ) exec (ctx context.Context , args []namedValue ) (driver.Result , error ) {
2038+ func (s * SQLiteStmt ) exec (ctx context.Context , args []driver. NamedValue ) (driver.Result , error ) {
20452039 if ctx .Done () == nil {
20462040 return s .execSync (args )
20472041 }
@@ -2073,7 +2067,7 @@ func (s *SQLiteStmt) exec(ctx context.Context, args []namedValue) (driver.Result
20732067 return rv .r , rv .err
20742068}
20752069
2076- func (s * SQLiteStmt ) execSync (args []namedValue ) (driver.Result , error ) {
2070+ func (s * SQLiteStmt ) execSync (args []driver. NamedValue ) (driver.Result , error ) {
20772071 if err := s .bind (args ); err != nil {
20782072 C .sqlite3_reset (s .s )
20792073 C .sqlite3_clear_bindings (s .s )
0 commit comments