From 5d9cdc65b5c58bff52290a6219cce7abe80b56f6 Mon Sep 17 00:00:00 2001 From: Mieszko Date: Sat, 8 Nov 2014 22:21:27 +0100 Subject: [PATCH] Update sqlite3.rst --- docs/patterns/sqlite3.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/patterns/sqlite3.rst b/docs/patterns/sqlite3.rst index 9cf5c94b..1f9e3671 100644 --- a/docs/patterns/sqlite3.rst +++ b/docs/patterns/sqlite3.rst @@ -4,7 +4,7 @@ Using SQLite 3 with Flask ========================= In Flask you can easily implement the opening of database connections on -demand, closing them when the context dies (usually at the end of the +demand and closing them when the context dies (usually at the end of the request). Here is a simple example of how you can use SQLite 3 with Flask:: @@ -83,7 +83,7 @@ Or even simpler:: db.row_factory = sqlite3.Row -Additionally it is a good idea to provide a query function that combines +Additionally, it is a good idea to provide a query function that combines getting the cursor, executing and fetching the results:: def query_db(query, args=(), one=False): @@ -131,7 +131,7 @@ can do that for you:: db.cursor().executescript(f.read()) db.commit() -You can then create such a database from the python shell: +You can then create such a database from the Python shell: >>> from yourapplication import init_db >>> init_db()