IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7909


Ignore:
Timestamp:
Jul 14, 2006, 2:17:19 PM (20 years ago)
Author:
jhoblitt
Message:

add psDBLastInsertID()
add psDBExplicitTrans()
add psDBTransaction()
add psDBCommit()
add psDBRollback()
add p_psDBRunQueryPrepared()
add p_psDBFetchResult
add database subsubsecionts for Transaction Control Database Functions and Low Level Database Functions

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r7861 r7909  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.207 2006-07-11 03:23:10 jhoblitt Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.208 2006-07-15 00:17:19 jhoblitt Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    911911\item add \code{psTimeStrptime()}
    912912\item add \code{psTimeStrftime()}
    913 \end{itemize}
     913\item add \code{psDBLastInsertID()}
     914\item add \code{psDBExplicitTrans()}
     915\item add \code{psDBTransaction()}
     916\item add \code{psDBCommit()}
     917\item add \code{psDBRollback()}
     918\item add \code{p_psDBRunQueryPrepared()}
     919\item add \code{p_psDBFetchResult}
     920\item add database subsubsecionts for ``Transaction Control Database Functions'' and ``Low Level Database Functions''
     921\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r7861 r7909  
    1 %%% $Id: psLibSDRS.tex,v 1.418 2006-07-11 03:23:10 jhoblitt Exp $
     1%%% $Id: psLibSDRS.tex,v 1.419 2006-07-15 00:17:19 jhoblitt Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    41264126indicate an error.
    41274127
     4128\begin{prototype}
     4129long psDBLastInsertID(
     4130    psDB *dbh                          ///< Database handle
     4131);
     4132\end{prototype}
     4133
     4134Returns the last value created in an ``auto-increment'' field.
     4135
     4136
     4137\subsubsection{Transaction Control Database Functions}
     4138
     4139By default the database functions shall behave as if each operation effects a
     4140permanent change to the database.  An API is provided to change this behavior
     4141such that operations may be grouped together into a ``transaction'' that is
     4142atomic.
     4143
     4144\begin{prototype}
     4145bool psDBExplicitTrans(
     4146    psDB *dbh,                          ///< Database handle
     4147    bool mode                           ///< transactions enable/disable
     4148);
     4149\end{prototype}
     4150
     4151Enable/Disable explicit transactions.  When enabled \code{psDBCommit()} must
     4152be called to make changes to the database's state persistent.
     4153
     4154\begin{prototype}
     4155bool psDBTransaction(
     4156    psDB *dbh                           ///< Database handle
     4157);
     4158\end{prototype}
     4159
     4160Start a new transaction.
     4161
     4162\begin{prototype}
     4163bool psDBCommit(
     4164    psDB *dbh                           ///< Database handle
     4165);
     4166\end{prototype}
     4167
     4168Commit the current transaction.
     4169
     4170\begin{prototype}
     4171bool psDBRollback(
     4172    psDB *dbh                           ///< Database handle
     4173);
     4174\end{prototype}
     4175
     4176Undo the current transaction.
     4177
     4178
     4179\subsubsection{Low Level Database Functions}
     4180
     4181This collection of functions is primarily intended for us internally by the
     4182other database functions.  However, in certain cases their direct use may be
     4183needed to express semantics that are not supported by the public database
     4184interface.
     4185
     4186\begin{prototype}
     4187long p_psDBRunQueryPrepared(
     4188    psDB *dbh,                          ///< Database handle
     4189    const psArray *rowSet,              ///< row data as psArray of psMetadata
     4190    const char *format,                 ///< SQL string to execute
     4191    ...
     4192);
     4193\end{prototype}
     4194
     4195\code{p_psDBRunQueryPrepared()} is similar to \code{p_psDBRunQuery()} except
     4196that \code{format} is expected to be a query string with value ``place
     4197holders'' in it.  This allows the data in \code{rowSet} is inserted into the
     4198database via the use of a more efficent ``prepared query''.
     4199
     4200\begin{prototype}
     4201psArray *p_psDBFetchResult(
     4202    psDB *dbh                          ///< Database handle
     4203);
     4204\end{prototype}
     4205
     4206\code{p_psDBFetchResult()} is the inverse operation of \code{p_psDBRunQuery}.
     4207It shall load the latest result set from the database into an \code{psArray}
     4208and return it.
     4209
     4210
    41284211\subsection{FITS I/O Functions}
    41294212
Note: See TracChangeset for help on using the changeset viewer.