@@ -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 ()
@@ -1985,17 +1979,17 @@ func (s *SQLiteStmt) bind(args []namedValue) error {
19851979
19861980// Query the statement with arguments. Return records.
19871981func (s * SQLiteStmt ) Query (args []driver.Value ) (driver.Rows , error ) {
1988- list := make ([]namedValue , len (args ))
1982+ list := make ([]driver. NamedValue , len (args ))
19891983 for i , v := range args {
1990- list [i ] = namedValue {
1984+ list [i ] = driver. NamedValue {
19911985 Ordinal : i + 1 ,
19921986 Value : v ,
19931987 }
19941988 }
19951989 return s .query (context .Background (), list )
19961990}
19971991
1998- func (s * SQLiteStmt ) query (ctx context.Context , args []namedValue ) (driver.Rows , error ) {
1992+ func (s * SQLiteStmt ) query (ctx context.Context , args []driver. NamedValue ) (driver.Rows , error ) {
19991993 if err := s .bind (args ); err != nil {
20001994 return nil , err
20011995 }
@@ -2025,9 +2019,9 @@ func (r *SQLiteResult) RowsAffected() (int64, error) {
20252019
20262020// Exec execute the statement with arguments. Return result object.
20272021func (s * SQLiteStmt ) Exec (args []driver.Value ) (driver.Result , error ) {
2028- list := make ([]namedValue , len (args ))
2022+ list := make ([]driver. NamedValue , len (args ))
20292023 for i , v := range args {
2030- list [i ] = namedValue {
2024+ list [i ] = driver. NamedValue {
20312025 Ordinal : i + 1 ,
20322026 Value : v ,
20332027 }
@@ -2044,7 +2038,7 @@ func isInterruptErr(err error) bool {
20442038}
20452039
20462040// exec executes a query that doesn't return rows. Attempts to honor context timeout.
2047- func (s * SQLiteStmt ) exec (ctx context.Context , args []namedValue ) (driver.Result , error ) {
2041+ func (s * SQLiteStmt ) exec (ctx context.Context , args []driver. NamedValue ) (driver.Result , error ) {
20482042 if ctx .Done () == nil {
20492043 return s .execSync (args )
20502044 }
@@ -2076,7 +2070,7 @@ func (s *SQLiteStmt) exec(ctx context.Context, args []namedValue) (driver.Result
20762070 return rv .r , rv .err
20772071}
20782072
2079- func (s * SQLiteStmt ) execSync (args []namedValue ) (driver.Result , error ) {
2073+ func (s * SQLiteStmt ) execSync (args []driver. NamedValue ) (driver.Result , error ) {
20802074 if err := s .bind (args ); err != nil {
20812075 C .sqlite3_reset (s .s )
20822076 C .sqlite3_clear_bindings (s .s )
0 commit comments