sqlite3 implementation, refs register, refs update