[Python-checkins] cpython (2.7): Clarify that a new connection needs to be made after the close.
raymond.hettinger
python-checkins at python.org
Wed Apr 18 04:48:13 CEST 2012
http://hg.python.org/cpython/rev/f45605e5c037
changeset: 76386:f45605e5c037
branch: 2.7
parent: 76376:8a4c9a168d09
user: Raymond Hettinger <python at rcn.com>
date: Tue Apr 17 15:03:20 2012 -0400
summary:
Clarify that a new connection needs to be made after the close.
files:
Doc/library/sqlite3.rst | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -51,6 +51,12 @@
shouldn't assemble your query using Python's string operations because doing so
is insecure; it makes your program vulnerable to an SQL injection attack.
+The data you've saved is persistent and is available in subsequent sessions::
+
+ import sqlite3
+ conn = sqlite3.connect('/tmp/example')
+ c = conn.cursor()
+
Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder
wherever you want to use a value, and then provide a tuple of values as the
second argument to the cursor's :meth:`~Cursor.execute` method. (Other database
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list