mirror of
https://github.com/syumai/workers.git
synced 2025-03-11 01:39:11 +00:00
fix some minor points
This commit is contained in:
parent
cef5b9b6a2
commit
33abcb5423
@ -59,7 +59,7 @@ func (s *stmt) QueryContext(_ context.Context, args []driver.NamedValue) (driver
|
|||||||
for i, arg := range args {
|
for i, arg := range args {
|
||||||
argValues[i] = arg.Value
|
argValues[i] = arg.Value
|
||||||
}
|
}
|
||||||
resultPromise := s.stmtObj.Call("bind", argValues...).Call("raw", map[string]interface{}{"columnNames": true})
|
resultPromise := s.stmtObj.Call("bind", argValues...).Call("raw", map[string]any{"columnNames": true})
|
||||||
rowsObj, err := jsutil.AwaitPromise(resultPromise)
|
rowsObj, err := jsutil.AwaitPromise(resultPromise)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -70,7 +70,8 @@ func (s *stmt) QueryContext(_ context.Context, args []driver.NamedValue) (driver
|
|||||||
columns: nil,
|
columns: nil,
|
||||||
rowsObj: rowsObj,
|
rowsObj: rowsObj,
|
||||||
}, nil
|
}, nil
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// The first result array includes the column names.
|
// The first result array includes the column names.
|
||||||
colsArray := rowsObj.Index(0)
|
colsArray := rowsObj.Index(0)
|
||||||
colsLen := colsArray.Length()
|
colsLen := colsArray.Length()
|
||||||
@ -84,5 +85,4 @@ func (s *stmt) QueryContext(_ context.Context, args []driver.NamedValue) (driver
|
|||||||
columns: cols,
|
columns: cols,
|
||||||
rowsObj: rowsObj,
|
rowsObj: rowsObj,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user