mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@ -148,13 +148,10 @@ pub fn (db Connection) delete(table string, where orm.QueryData) ! {
|
||||
mysql_stmt_worker(db, query, orm.QueryData{}, where)!
|
||||
}
|
||||
|
||||
pub fn (db Connection) last_id() orm.Primitive {
|
||||
pub fn (db Connection) last_id() int {
|
||||
query := 'SELECT last_insert_id();'
|
||||
id := db.query(query) or {
|
||||
Result{
|
||||
result: 0
|
||||
}
|
||||
}
|
||||
id := db.query(query) or { return 0 }
|
||||
|
||||
return orm.Primitive(id.rows()[0].vals[0].int())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user