Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Db.lastInsertId

Db.lastInsertId($sequenceName='') -> number

Description

Returns the ID of the last inserted row.

If using PostgreSql, you must pass in a sequence name.

Db.insertRow('users', { userName: 'theo' })

Db.lastInsertId()
//= Ex: 123

See Also