analyseether / ether_sql

A python library to push ethereum blockchain data into an sql database.
http://ether-sql.readthedocs.io
Apache License 2.0
69 stars 22 forks source link

Use context manager to handle sessions #38

Closed ankitchiplunkar closed 6 years ago

ankitchiplunkar commented 6 years ago

Is your feature request related to a problem? Please describe. Currently opening and closing a db_session with ether_sql session is not optimal. Would like to use a context manager so as to perform clean shutdown of the db_session.

Describe the solution you'd like Solution as prescribed in example 3 of this link: http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it