Changeset 734 for trunk/docs


Ignore:
Timestamp:
Jan 13, 2016, 10:50:25 AM (4 years ago)
Author:
cito
Message:

Add documentation for transaction handling methods

Also, the savepoint name is not optional.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/contents/pg/db_wrapper.rst

    r733 r734  
    126126Given the name of a table, digs out the set of attribute names.
    127127
    128 has_table_privilege -- check whether current user has specified table privilege
    129 -------------------------------------------------------------------------------
     128has_table_privilege -- check table privilege
     129--------------------------------------------
    130130
    131131.. method:: DB.has_table_privilege(table, privilege)
     
    141141
    142142.. versionadded:: 4.0
     143
     144begin/commit/rollback/savepoint/release -- transaction handling
     145---------------------------------------------------------------
     146
     147.. method:: DB.begin([mode])
     148
     149    Begin a transaction
     150
     151    :param str mode: an optional transaction mode such as 'READ ONLY'
     152
     153    This initiates a transaction block, that is, all following queries
     154    will be executed in a single transaction until :meth:`DB.commit`
     155    or :meth:`DB.rollback` is called.
     156
     157.. versionadded:: 4.1
     158
     159.. method:: DB.start()
     160
     161    This is the same as the :meth:`DB.begin` method.
     162
     163.. method:: DB.commit()
     164
     165    Commit a transaction
     166
     167    This commits the current transaction. All changes made by the
     168    transaction become visible to others and are guaranteed to be
     169    durable if a crash occurs.
     170
     171.. method:: DB.end()
     172
     173    This is the same as the :meth:`DB.commit` method.
     174
     175.. versionadded:: 4.1
     176
     177.. method:: DB.rollback([name])
     178
     179    Roll back a transaction
     180
     181    :param str name: optionally, roll back to the specified savepoint
     182
     183    This rolls back the current transaction and causes all the updates
     184    made by the transaction to be discarded.
     185
     186.. versionadded:: 4.1
     187
     188.. method:: DB.savepoint(name)
     189
     190    Define a new savepoint
     191
     192    :param str name: the name to give to the new savepoint
     193
     194    This establishes a new savepoint within the current transaction.
     195
     196.. versionadded:: 4.1
     197
     198.. method:: DB.release(name)
     199
     200    Destroy a savepoint
     201
     202    :param str name: the name of the savepoint to destroy
     203
     204    This destroys a savepoint previously defined in the current transaction.
     205
     206.. versionadded:: 4.1
    143207
    144208get -- get a row from a database table or view
Note: See TracChangeset for help on using the changeset viewer.