lib/sqlite: Added last_rowid method to SQLite
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 30 Sep 2014 20:25:04 +0000 (16:25 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Mon, 6 Oct 2014 15:37:05 +0000 (11:37 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/sqlite3/sqlite3.nit

index d016a4c..05cbed0 100644 (file)
@@ -105,6 +105,9 @@ class Sqlite3DB
                if err.is_ok then return null
                return err.to_s
        end
+
+       # Returns the id for the last successful insert on the current connection.
+       fun last_insert_rowid: Int do return native_connection.last_insert_rowid
 end
 
 # A prepared Sqlite3 statement, created from `Sqlite3DB::prepare` or `Sqlite3DB::select`