Sync mysql queries with sqlite