A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/shawalli/flask-sqlalchemy-pgevents below:

shawalli/flask-sqlalchemy-pgevents: Flask extension for psycopg2-pgevents, via SQLAlchemy.

flask-sqlalchemy-pgevents

flask-sqlalchemy-pgevents provides PostGreSQL eventing for Flask. It handles setting up the underlying database, registering triggers, and polling for events.

I have SQLAlchemy, which supports event listeners. Why do I care about this extension?

SQLAlchemy's event listening framework is great for listening to database changes made through SQLAlchemy. However, in the real world, not every data event that affects a database takes place through SQLAlchemy; an application may be created from any number of packages, libraries, and modules written in different languages and with different frameworks. If any of these non-SQLAlchemy items modify a database, SQLAlchemy will not know, and will therefore not notify event listeners of these changes.

With this extension, an application may be notified of events at the database layer. This means that any changes made to a table are caught by this extension and registered event listeners (for the affected table) are called.

You just said that SQLAlchemy has nothing to do with the eventing aspect of this extension...So why are you using SQLAlchemy?

Great question! SQLAlchemy is primarily used as a convenience mechanism for creating a consistent connection to the database.

Additionally, many Flask applications use SQLAlchemy as their ORM. As such, this extension will integrate seamlessly with any Flask applications that use Flask-SQLAlchemy. To provide a consistent SQLAlchemy experience, this extension's event listener decorator is designed to closely resemble SQLAlchemy event listener decorators.

Note
While this extension may appear to integrate with SQLAlchemy's event listeners, it actually sits alongside that eventing structure. Registering a PGEvents event listener does not register the event listener with SQLAlchemy's event registrar.

See the examples directory for example use cases for this package.

Written by Shawn Wallis and distributed under the MIT license.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4