Skip to content

Commit 37fb051

Browse files
committed
Minor typos in sqlite3.rst
Self-explanatory.
1 parent a25ee7e commit 37fb051

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/patterns/sqlite3.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
Using SQLite 3 with Flask
44
=========================
55

6-
In Flask you can implement the opening of database connections on demand
7-
and closing it when the context dies (usually at the end of the request)
8-
easily.
6+
In Flask you can easily implement the opening of database connections on
7+
demand, closing them when the context dies (usually at the end of the
8+
request).
99

1010
Here is a simple example of how you can use SQLite 3 with Flask::
1111

@@ -26,8 +26,8 @@ Here is a simple example of how you can use SQLite 3 with Flask::
2626
if db is not None:
2727
db.close()
2828

29-
All the application needs to do in order to now use the database is having
30-
an active application context (which is always true if there is an request
29+
All the application needs to do in order to now use the database is have
30+
an active application context (which is always true if there is a request
3131
in flight) or to create an application context itself. At that point the
3232
``get_db`` function can be used to get the current database connection.
3333
Whenever the context is destroyed the database connection will be
@@ -56,7 +56,7 @@ Connect on Demand
5656
-----------------
5757

5858
The upside of this approach (connecting on first use) is that this will
59-
only opening the connection if truly necessary. If you want to use this
59+
only open the connection if truly necessary. If you want to use this
6060
code outside a request context you can use it in a Python shell by opening
6161
the application context by hand::
6262

@@ -71,8 +71,8 @@ Easy Querying
7171
Now in each request handling function you can access `g.db` to get the
7272
current open database connection. To simplify working with SQLite, a
7373
row factory function is useful. It is executed for every result returned
74-
from the database to convert the result. For instance in order to get
75-
dictionaries instead of tuples this could be inserted into ``get_db``::
74+
from the database to convert the result. For instance, in order to get
75+
dictionaries instead of tuples, this could be inserted into ``get_db``::
7676

7777
def make_dicts(cursor, row):
7878
return dict((cursor.description[idx][0], value)
@@ -93,9 +93,9 @@ getting the cursor, executing and fetching the results::
9393
cur.close()
9494
return (rv[0] if rv else None) if one else rv
9595

96-
This handy little function in combination with a row factory makes working
97-
with the database much more pleasant than it is by just using the raw
98-
cursor and connection objects.
96+
This handy little function, in combination with a row factory, makes
97+
working with the database much more pleasant than it is by just using the
98+
raw cursor and connection objects.
9999

100100
Here is how you can use it::
101101

0 commit comments

Comments
 (0)