function stringifyOuterOrder(orders, q) {
  const conditions = []
  for (let condition of orders) {
    for (let column in condition.columns) {
      const direction = condition.columns[column]
      conditions.push(`${q(condition.table)}.${q(column)} ${direction}`)
    }
  }
  return conditions.join(', ')
}