]> granicus.if.org Git - python/commitdiff
Clarify that a new connection needs to be made after the close.
authorRaymond Hettinger <python@rcn.com>
Tue, 17 Apr 2012 19:03:20 +0000 (15:03 -0400)
committerRaymond Hettinger <python@rcn.com>
Tue, 17 Apr 2012 19:03:20 +0000 (15:03 -0400)
Doc/library/sqlite3.rst

index 0745cefe37e1c8cd9e07da40d5fc3c2ac4a2cd56..f7aca70601e64e28ba5710051befd914d605a41a 100644 (file)
@@ -51,6 +51,12 @@ Usually your SQL operations will need to use values from Python variables.  You
 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