fix last_row_id key name

This commit is contained in:
syumai 2023-02-26 17:38:38 +09:00
parent dd17cf216c
commit 466065d6d3

View File

@ -17,7 +17,7 @@ var (
// LastInsertId returns id of result's last row.
// If lastRowId can't be retrieved, this method returns 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() {
return 0, errors.New("d1: lastRowId cannot be retrieved")
}