chalice with peewee
So I took a quick look. You can't really rely on state or local memory being preserved between any two requests w/a lambda function, so I'm not sure if connection pooling makes sense in that environment (though you could try it and measure).

I'd just wrap the `route()` function to add a decorator that opens and closes the db on each request.

```python

app = Chalice(...)
db = MySQLDatabase(...)
# Or,
# db = PooledMySQLDatabase(...)

def my_route(*args, **kwargs):
    def inner(fn):
        def deco(*fa, **fk):
            db.connect()
            try:
                return fn(*fa, **fk)
            finally:
                db.close()
        return app.route(*args, **kwargs)(deco)
    return inner

@my_route('/foo/', ...)
def some_view(...):
    # db should be opened before this function is called
    # and will be closed afterwards
```

Something like that -- I didn't test it, but hopefully you get the idea.
Do you have any suggestion for chalice framework to open close connect with MySql
only at https request occurred? 
thanks 