Yes, it's guaranteed that 3 will be logged after 1 and 2.
That's because FMDatabaseQueue -inDatabase:
uses a dispatch_sync
call internally to do the database operations (as you can see in the source code).
So, the recommendation would be do the less work possible inside the block, and do all the other work on your own queue.
Also, [db open]
is not needed, because FMDatabaseQueue -initWithPath:
(called by FMDatabaseQueue +databaseQueueWithPath:
) already does that (as again, you can see in the source code).