~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Doc/library/sqlite3.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
541
541
 
542
542
   This read-only attribute provides the column names of the last query. To
543
543
   remain compatible with the Python DB API, it returns a 7-tuple for each
544
 
   column where the last six items of each tuple are :const:`None`. 
545
 
   
 
544
   column where the last six items of each tuple are :const:`None`.
 
545
 
546
546
   It is set for ``SELECT`` statements without any matching rows as well.
547
547
 
548
548
.. _sqlite3-row-objects:
553
553
.. class:: Row
554
554
 
555
555
   A :class:`Row` instance serves as a highly optimized
556
 
   :attr:`~Connection.row_factory` for :class:`Connection` objects. 
 
556
   :attr:`~Connection.row_factory` for :class:`Connection` objects.
557
557
   It tries to mimic a tuple in most of its features.
558
558
 
559
559
   It supports mapping access by column name and index, iteration,
561
561
 
562
562
   If two :class:`Row` objects have exactly the same columns and their
563
563
   members are equal, they compare equal.
564
 
   
565
 
   .. versionchanged:: 2.6
566
 
      Added iteration and equality (hashability).
567
564
 
568
565
   .. method:: keys
569
566
 
570
567
      This method returns a tuple of column names. Immediately after a query,
571
568
      it is the first member of each tuple in :attr:`Cursor.description`.
572
569
 
573
 
      .. versionadded:: 2.6
574
 
 
575
570
Let's assume we initialize a table as in the example given above::
576
571
 
577
572
    conn = sqlite3.connect(":memory:")
780
775
------------------------
781
776
 
782
777
By default, the :mod:`sqlite3` module opens transactions implicitly before a
783
 
Data Modification Language (DML)  statement (i.e. 
 
778
Data Modification Language (DML)  statement (i.e.
784
779
``INSERT``/``UPDATE``/``DELETE``/``REPLACE``), and commits transactions
785
780
implicitly before a non-DML, non-query statement (i. e.
786
781
anything other than ``SELECT`` or the aforementioned).