chunks sql query with lon IN(...) lists using suboptimal library specific escaping