Version: v0.7.0 - 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()
//= e.g. 123

See Also