sqlite: add ability to get id of last inserted row
parent
2f9a226432
commit
d183e94a39
|
@ -113,6 +113,9 @@ END-STRUCT
|
|||
: sqlite3_step ( stmt -- result )
|
||||
"int" "sqlite" "sqlite3_step" [ "sqlite3-stmt*" ] alien-invoke ;
|
||||
|
||||
: sqlite3_last_insert_rowid ( stmt index int -- result )
|
||||
"int" "sqlite" "sqlite3_last_insert_rowid" [ "sqlite3*" ] alien-invoke ;
|
||||
|
||||
: sqlite3_bind_blob ( stmt index pointer len destructor -- result )
|
||||
"int" "sqlite" "sqlite3_bind_blob" [ "sqlite3-stmt*" "int" "void*" "int" "int" ] alien-invoke ;
|
||||
|
||||
|
@ -170,6 +173,10 @@ END-STRUCT
|
|||
#! Close the given database
|
||||
sqlite3_close sqlite-check-result ;
|
||||
|
||||
: sqlite-last-insert-rowid ( db -- rowid )
|
||||
#! Return the rowid of the last insert
|
||||
sqlite3_last_insert_rowid ;
|
||||
|
||||
: sqlite-prepare ( db sql -- statement )
|
||||
#! Prepare a SQL statement. Returns the statement which
|
||||
#! can have values bound to parameters or simply executed.
|
||||
|
|
Loading…
Reference in New Issue