fix rowsObj

This commit is contained in:
syumai 2023-02-06 02:49:21 +09:00
parent f25a65c45a
commit 2aeed0ad5d

View File

@ -64,7 +64,10 @@ func (s *stmt) QueryContext(_ context.Context, args []driver.NamedValue) (driver
if err != nil {
return nil, err
}
if !rowsObj.Get("success").Bool() {
return nil, errors.New("d1: failed to query")
}
return &rows{
rowsObj: rowsObj,
rowsObj: rowsObj.Get("results"),
}, nil
}