func (*DB) QueryContext

func (db *DB) QueryContext(ctx context.Context, query string, args ...interface{}) (*Rows, error)

QueryContext 执行一个返回行的查询,通常是一个 SELECT语句。args参数用于SQL语句中的任何占位符参数。提供的上下文用于查询。