bottle-sqlite
bottle-sqlite copied to clipboard
Feature Request: Ability to receive connection not in routes
I like the concept of this plugin, but I found I had to roll my own because I needed a way to get a database connection object (with all of the same settings) in function that do not originate as the route. For example, I had something along the lines of
@route('/special')
def special():
do_something_special()
return main()
@route('/')
def main(db):
content = do_main_stuff_with_db()
return content
That is just one example. Another one would be if there is something with the DB in the background (say, in a thread that checks the DB occasionally)
Just thought I would suggest this.
Thanks!