Adapt ibus table query to the new database format