Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
95d7cdfd
Commit
95d7cdfd
authored
Sep 30, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sqlite3 class markup.
parent
c820de5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
213 additions
and
213 deletions
+213
-213
Doc/library/sqlite3.rst
Doc/library/sqlite3.rst
+213
-213
No files found.
Doc/library/sqlite3.rst
View file @
95d7cdfd
...
...
@@ -231,58 +231,58 @@ Connection Objects
A SQLite database connection has the following attributes and methods:
.. attribute:: Connection.
isolation_level
.. attribute::
isolation_level
Get or set the current isolation level. :const:`None` for autocommit mode or
one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section
:ref:`sqlite3-controlling-transactions` for a more detailed explanation.
.. method:: Connection.
cursor([cursorClass])
.. method::
cursor([cursorClass])
The cursor method accepts a single optional parameter *cursorClass*. If
supplied, this must be a custom cursor class that extends
:class:`sqlite3.Cursor`.
.. method:: Connection.
commit()
.. method::
commit()
This method commits the current transaction. If you don't call this method,
anything you did since the last call to ``commit()`` is not visible from
other database connections. If you wonder why you don't see the data you've
written to the database, please check you didn't forget to call this method.
.. method:: Connection.
rollback()
.. method::
rollback()
This method rolls back any changes to the database since the last call to
:meth:`commit`.
.. method:: Connection.
close()
.. method::
close()
This closes the database connection. Note that this does not automatically
call :meth:`commit`. If you just close your database connection without
calling :meth:`commit` first, your changes will be lost!
.. method:: Connection.
execute(sql, [parameters])
.. method::
execute(sql, [parameters])
This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor's :meth:`execute
<Cursor.execute>` method with the parameters given.
.. method:: Connection.
executemany(sql, [parameters])
.. method::
executemany(sql, [parameters])
This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor's :meth:`executemany
<Cursor.executemany>` method with the parameters given.
.. method:: Connection.
executescript(sql_script)
.. method::
executescript(sql_script)
This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor's :meth:`executescript
<Cursor.executescript>` method with the parameters given.
.. method:: Connection.
create_function(name, num_params, func)
.. method::
create_function(name, num_params, func)
Creates a user-defined function that you can later use from within SQL
statements under the function name *name*. *num_params* is the number of
...
...
@@ -297,7 +297,7 @@ Connection Objects
.. literalinclude:: ../includes/sqlite3/md5func.py
.. method:: Connection.
create_aggregate(name, num_params, aggregate_class)
.. method::
create_aggregate(name, num_params, aggregate_class)
Creates a user-defined aggregate function.
...
...
@@ -313,7 +313,7 @@ Connection Objects
.. literalinclude:: ../includes/sqlite3/mysumaggr.py
.. method:: Connection.
create_collation(name, callable)
.. method::
create_collation(name, callable)
Creates a collation with the specified *name* and *callable*. The callable will
be passed two string arguments. It should return -1 if the first is ordered
...
...
@@ -333,14 +333,14 @@ Connection Objects
con.create_collation("reverse", None)
.. method:: Connection.
interrupt()
.. method::
interrupt()
You can call this method from a different thread to abort any queries that might
be executing on the connection. The query will then abort and the caller will
get an exception.
.. method:: Connection.
set_authorizer(authorizer_callback)
.. method::
set_authorizer(authorizer_callback)
This routine registers a callback. The callback is invoked for each attempt to
access a column of a table in the database. The callback should return
...
...
@@ -361,7 +361,7 @@ Connection Objects
one. All necessary constants are available in the :mod:`sqlite3` module.
.. method:: Connection.
set_progress_handler(handler, n)
.. method::
set_progress_handler(handler, n)
This routine registers a callback. The callback is invoked for every *n*
instructions of the SQLite virtual machine. This is useful if you want to
...
...
@@ -374,7 +374,7 @@ Connection Objects
.. versionadded:: 2.6
.. method:: Connection.
enable_load_extension(enabled)
.. method::
enable_load_extension(enabled)
This routine allows/disallows the SQLite engine to load SQLite extensions
from shared libraries. SQLite extensions can define new functions,
...
...
@@ -387,7 +387,7 @@ Connection Objects
.. literalinclude:: ../includes/sqlite3/load_extension.py
.. method:: Connection.
load_extension(path)
.. method::
load_extension(path)
This routine loads a SQLite extension from a shared library. You have to
enable extension loading with :meth:`enable_load_extension` before you can
...
...
@@ -397,7 +397,7 @@ Connection Objects
.. versionadded:: 2.7
.. attribute:: Connection.
row_factory
.. attribute::
row_factory
You can change this attribute to a callable that accepts the cursor and the
original row as a tuple and will return the real result row. This way, you can
...
...
@@ -418,7 +418,7 @@ Connection Objects
.. XXX what's a db_row-based solution?
.. attribute:: Connection.
text_factory
.. attribute::
text_factory
Using this attribute you can control what objects are returned for the ``TEXT``
data type. By default, this attribute is set to :class:`unicode` and the
...
...
@@ -437,13 +437,13 @@ Connection Objects
.. literalinclude:: ../includes/sqlite3/text_factory.py
.. attribute:: Connection.
total_changes
.. attribute::
total_changes
Returns the total number of database rows that have been modified, inserted, or
deleted since the database connection was opened.
.. attribute:: Connection.
iterdump
.. attribute::
iterdump
Returns an iterator to dump the database in an SQL text format. Useful when
saving an in-memory database for later restoration. This function provides
...
...
@@ -472,7 +472,7 @@ Cursor Objects
A :class:`Cursor` instance has the following attributes and methods.
.. method:: Cursor.
execute(sql, [parameters])
.. method::
execute(sql, [parameters])
Executes an SQL statement. The SQL statement may be parameterized (i. e.
placeholders instead of SQL literals). The :mod:`sqlite3` module supports two
...
...
@@ -489,7 +489,7 @@ Cursor Objects
call.
.. method:: Cursor.
executemany(sql, seq_of_parameters)
.. method::
executemany(sql, seq_of_parameters)
Executes an SQL command against all parameter sequences or mappings found in
the sequence *sql*. The :mod:`sqlite3` module also allows using an
...
...
@@ -502,7 +502,7 @@ Cursor Objects
.. literalinclude:: ../includes/sqlite3/executemany_2.py
.. method:: Cursor.
executescript(sql_script)
.. method::
executescript(sql_script)
This is a nonstandard convenience method for executing multiple SQL statements
at once. It issues a ``COMMIT`` statement first, then executes the SQL script it
...
...
@@ -515,13 +515,13 @@ Cursor Objects
.. literalinclude:: ../includes/sqlite3/executescript.py
.. method:: Cursor.
fetchone()
.. method::
fetchone()
Fetches the next row of a query result set, returning a single sequence,
or :const:`None` when no more data is available.
.. method:: Cursor.
fetchmany([size=cursor.arraysize])
.. method::
fetchmany([size=cursor.arraysize])
Fetches the next set of rows of a query result, returning a list. An empty
list is returned when no more rows are available.
...
...
@@ -537,14 +537,14 @@ Cursor Objects
If the *size* parameter is used, then it is best for it to retain the same
value from one :meth:`fetchmany` call to the next.
.. method:: Cursor.
fetchall()
.. method::
fetchall()
Fetches all (remaining) rows of a query result, returning a list. Note that
the cursor's arraysize attribute can affect the performance of this operation.
An empty list is returned when no rows are available.
.. attribute:: Cursor.
rowcount
.. attribute::
rowcount
Although the :class:`Cursor` class of the :mod:`sqlite3` module implements this
attribute, the database engine's own support for the determination of "rows
...
...
@@ -562,14 +562,14 @@ Cursor Objects
With SQLite versions before 3.6.5, :attr:`rowcount` is set to 0 if
you make a ``DELETE FROM table`` without any condition.
.. attribute:: Cursor.
lastrowid
.. attribute::
lastrowid
This read-only attribute provides the rowid of the last modified row. It is
only set if you issued a ``INSERT`` statement using the :meth:`execute`
method. For operations other than ``INSERT`` or when :meth:`executemany` is
called, :attr:`lastrowid` is set to :const:`None`.
.. attribute:: Cursor.
description
.. attribute::
description
This read-only attribute provides the column names of the last query. To
remain compatible with the Python DB API, it returns a 7-tuple for each
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment