flask-sqlalchemy icon indicating copy to clipboard operation
flask-sqlalchemy copied to clipboard

Adds SQLAlchemy support to Flask

Results 110 flask-sqlalchemy issues
Sort by recently updated
recently updated
newest added

I found that the return type of `get_or_404` is `Any` now. This PR will bound return type to bond to `Self` Checklist: - [ ] Add tests that demonstrate the...

Running the test suite under Python 3.12 has multiple failures that all stem from: `DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to...

Mainly, show how to isolated the database per test, so that changes are rolled back without having to re-create the database each time. The [pytest-flask-sqlalchemy](https://github.com/jeancochrane/pytest-flask-sqlalchemy) package provided this, but [stopped...

```python from flask import Flask from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() app = Flask(__name__) app.config['SQLALCHEMY_BINDS'] = {'x': 'sqlite:///:memory:'} db.init_app(app) with app.app_context(): print(db) # KeyError: None ``` Environment: - Python...

Environment: - Python version: 3.x - Flask-SQLAlchemy version: 3.1.x - SQLAlchemy version: N/A I found a possibly incorrect example in the Reflecting Tables section of docs/models.rst There is a class...

docs

#1100 says that db.paginate currently not work for select(Model.column1, Model.column2), so will this feature going to be implemented in a future version, or what could I do to get this?

The Single Table Inheritance setup ( the first code below which is very self explanatory ) the following error is emmitted ``` sqlalchemy.exc.ArgumentError: Column 'bid' on class ChildB conflicts with...

This PR adds a `paginate_rows()` method to the extension object that behaves like `paginate()`, except its items are `sqlalchemy.Row` instances instead of whatever was the in the first column of...

Although the flask documentation claims it passes [ExecutionContext](https://docs.sqlalchemy.org/en/20/core/internals.html#sqlalchemy.engine.ExecutionContext) objects optionally, it appears it sometimes passes `PGExecutionContext_psycopg2` objects, which are not guaranteed to have a `.statement` attribute. This means that line...

After 3.0, the engines is created in `init_app`, so there is no way to update the configuration after instantiating the extension object. However, we do need to update the config...