mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
fix last_row_id key name
This commit is contained in:
parent
dd17cf216c
commit
466065d6d3
@ -17,7 +17,7 @@ var (
|
|||||||
// LastInsertId returns id of result's last row.
|
// LastInsertId returns id of result's last row.
|
||||||
// If lastRowId can't be retrieved, this method returns error.
|
// If lastRowId can't be retrieved, this method returns error.
|
||||||
func (r *result) LastInsertId() (int64, error) {
|
func (r *result) LastInsertId() (int64, error) {
|
||||||
v := r.resultObj.Get("meta").Get("lastRowId")
|
v := r.resultObj.Get("meta").Get("last_row_id")
|
||||||
if v.IsNull() || v.IsUndefined() {
|
if v.IsNull() || v.IsUndefined() {
|
||||||
return 0, errors.New("d1: lastRowId cannot be retrieved")
|
return 0, errors.New("d1: lastRowId cannot be retrieved")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user