diff options
author | Georg Brandl <georg@python.org> | 2009-05-25 21:13:36 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-05-25 21:13:36 (GMT) |
commit | 8a1e4c4b6433522ff20528e87b642e4316bd2bd6 (patch) | |
tree | 34f4e397b78bfa4d45ff63fd569b22a5320e4993 /Doc/library/sqlite3.rst | |
parent | 0c31562a913e9a49842bd73c04847861c23774f1 (diff) | |
download | cpython-8a1e4c4b6433522ff20528e87b642e4316bd2bd6.zip cpython-8a1e4c4b6433522ff20528e87b642e4316bd2bd6.tar.gz cpython-8a1e4c4b6433522ff20528e87b642e4316bd2bd6.tar.bz2 |
Merged revisions 72661,72675-72677,72679,72712,72801,72820 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72661 | georg.brandl | 2009-05-15 10:03:03 +0200 (Fr, 15 Mai 2009) | 1 line
Fix example output for doctest-like demos.
........
r72675 | georg.brandl | 2009-05-16 13:13:21 +0200 (Sa, 16 Mai 2009) | 1 line
#6034: clarify __reversed__ doc.
........
r72676 | georg.brandl | 2009-05-16 13:14:46 +0200 (Sa, 16 Mai 2009) | 1 line
#6025: fix signature of parse().
........
r72677 | georg.brandl | 2009-05-16 13:18:55 +0200 (Sa, 16 Mai 2009) | 1 line
#6009: undocument default argument of Option as deprecated.
........
r72679 | georg.brandl | 2009-05-16 13:24:41 +0200 (Sa, 16 Mai 2009) | 1 line
Fix about and bugs pages to match real workflow.
........
r72712 | georg.brandl | 2009-05-17 10:55:00 +0200 (So, 17 Mai 2009) | 1 line
#5935: mention that BROWSER is looked for in PATH.
........
r72801 | georg.brandl | 2009-05-20 20:31:14 +0200 (Mi, 20 Mai 2009) | 1 line
#6055: refer to "sqlite3" consistently.
........
r72820 | georg.brandl | 2009-05-22 09:23:32 +0200 (Fr, 22 Mai 2009) | 1 line
Use raise X(y).
........
Diffstat (limited to 'Doc/library/sqlite3.rst')
-rw-r--r-- | Doc/library/sqlite3.rst | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index d849247..6c3f6e2 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -13,7 +13,7 @@ SQLite for internal data storage. It's also possible to prototype an application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. -pysqlite was written by Gerhard Häring and provides a SQL interface compliant +sqlite3 was written by Gerhard Häring and provides a SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`. To use the module, you must first create a :class:`Connection` object that @@ -50,8 +50,9 @@ is insecure; it makes your program vulnerable to an SQL injection attack. 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 modules -may use a different placeholder, such as ``%s`` or ``:1``.) For example:: +second argument to the cursor's :meth:`~Cursor.execute` method. (Other database +modules may use a different placeholder, such as ``%s`` or ``:1``.) For +example:: # Never do this -- insecure! symbol = 'IBM' @@ -90,11 +91,12 @@ This example uses the iterator form:: .. seealso:: http://www.pysqlite.org - The pysqlite web page. + The pysqlite web page -- sqlite3 is developed externally under the name + "pysqlite". http://www.sqlite.org - The SQLite web page; the documentation describes the syntax and the available - data types for the supported SQL dialect. + The SQLite web page; the documentation describes the syntax and the + available data types for the supported SQL dialect. :pep:`249` - Database API Specification 2.0 PEP written by Marc-André Lemburg. @@ -784,10 +786,10 @@ So if you are within a transaction and issue a command like ``CREATE TABLE ...``, ``VACUUM``, ``PRAGMA``, the :mod:`sqlite3` module will commit implicitly before executing that command. There are two reasons for doing that. The first is that some of these commands don't work within transactions. The other reason -is that pysqlite needs to keep track of the transaction state (if a transaction +is that sqlite3 needs to keep track of the transaction state (if a transaction is active or not). -You can control which kind of ``BEGIN`` statements pysqlite implicitly executes +You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes (or none at all) via the *isolation_level* parameter to the :func:`connect` call, or via the :attr:`isolation_level` property of connections. @@ -799,8 +801,8 @@ statement, or set it to one of SQLite's supported isolation levels: "DEFERRED", -Using pysqlite efficiently --------------------------- +Using :mod:`sqlite3` efficiently +-------------------------------- Using shortcut methods |