support named params
This commit is contained in:
@@ -23,6 +23,14 @@ func (c *SQLiteConn) QueryContext(ctx context.Context, query string, args []driv
|
||||
return c.query(ctx, query, list)
|
||||
}
|
||||
|
||||
func (c *SQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) {
|
||||
list := make([]namedValue, len(args))
|
||||
for i, nv := range args {
|
||||
list[i] = namedValue(nv)
|
||||
}
|
||||
return c.exec(ctx, query, list)
|
||||
}
|
||||
|
||||
func (s *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) {
|
||||
list := make([]namedValue, len(args))
|
||||
for i, nv := range args {
|
||||
@@ -30,3 +38,11 @@ func (s *SQLiteStmt) QueryContext(ctx context.Context, args []driver.NamedValue)
|
||||
}
|
||||
return s.query(ctx, list)
|
||||
}
|
||||
|
||||
func (s *SQLiteStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
|
||||
list := make([]namedValue, len(args))
|
||||
for i, nv := range args {
|
||||
list[i] = namedValue(nv)
|
||||
}
|
||||
return s.exec(ctx, list)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user