Most people are used to an atomic
database such as SQL Server, MySql, SQLite, etc... were one would expect that an INSERT followed by an SELECT (for the same data) would return the newly entered data. However as the database (which is still SQLite) has been wrapped in an Javacript style asynchronous mathods you can not be sure that is the case (the INSERT may not finish untill AFTER teh select has run).
After a bit of looking I've remember jQuery adding a new Defered Object sub-system in v1.5. What this allows is syntax like so;
var dfd = $.Deferred().DoInsert.done(DoSelect).done(DoSomethingelse);
This allows the same effect as using nestted callbacks, but without the depth and in a mucher easier to read syntax.