text: Title: port query methods to select
  Body: The query interface is legacy in SQLAlchemy 2.0, instead using the `session.execute(select())` pattern. It's not possible (or at least not at all supported) to modify the `Result` returned from `session.execute` the way that `Query` could be.
  
  Implement the `or_404` and `paginate` methods on the `db` object directly, so that they can be used like `db.one_or_404(select(User).filter_by(username=username))`. The methods can still take `query` objects.