sqlite: add ability to get id of last inserted row

cvs
Chris Double 2005-09-30 00:56:34 +00:00
parent 2f9a226432
commit d183e94a39
1 changed files with 7 additions and 0 deletions

View File

@ -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.