bottle-sqlite icon indicating copy to clipboard operation
bottle-sqlite copied to clipboard

Feature Request: Ability to receive connection not in routes

Open Jwink3101 opened this issue 7 years ago • 0 comments

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!

Jwink3101 avatar Oct 02 '17 14:10 Jwink3101