Skip to content
Myr

Fix docs, how to get db connection in pattern

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The docs are inaccurately suggestion a db connection would be available at `g.db`, after calling `get_db()` a connection will be available at `g._database` but even then I think instructing the user to use `get_db()` is the best way forward.

authored by Harry Moreno · committed by GitHub · parent d08d96a · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/patterns/sqlite3.rst+1 added-1 removed
65 unmodified lines
6667Easy Querying68-------------6970Now in each request handling function you can access `g.db` to get the70Now in each request handling function you can access `get_db()` to get the71current open database connection. To simplify working with SQLite, a72row factory function is useful. It is executed for every result returned73from the database to convert the result. For instance, in order to get74dictionaries instead of tuples, this could be inserted into the ``get_db``
80 unmodified lines