IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3158


Ignore:
Timestamp:
Feb 7, 2005, 10:57:20 PM (21 years ago)
Author:
jhoblitt
Message:

changed psDBDumpCols() to return a psMetadata (bug 285)
changed psDB to hold a MYSQL *
changed psDBSelectColumnNum() to accept a psElemType parameter
changed psDBSelectColumn() to return an psArray of strings
renamed psDBUpdateRow() to psDBUpdateRows()
renamed psDBDeleteRow() to psDBDeleteRows()
renamed psDBInsertRow() to psDBInsertOneRow()

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

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

    r3155 r3158  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.62 2005-02-08 04:56:24 eugene Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.63 2005-02-08 08:57:20 jhoblitt Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    451451\item added the function psMetadataAddV
    452452\item added the option flags \code{psMetadataFlags}
    453 \end{itemize}
     453\item changed psDBDumpCols() to return a psMetadata (bug 285)
     454\item changed psDB to hold a MYSQL *
     455\item changed psDBSelectColumnNum() to accept a psElemType parameter
     456\item changed psDBSelectColumn() to return an psArray of strings
     457\item renamed psDBUpdateRow() to psDBUpdateRows()
     458\item renamed psDBDeleteRow() to psDBDeleteRows()
     459\item renamed psDBInsertRow() to psDBInsertOneRow()
     460\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r3155 r3158  
    1 %%% $Id: psLibSDRS.tex,v 1.174 2005-02-08 04:56:24 eugene Exp $
     1%%% $Id: psLibSDRS.tex,v 1.175 2005-02-08 08:57:20 jhoblitt Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    43204320\begin{verbatim}
    43214321    typedef struct {
    4322         MYSQL mysql;
     4322        MYSQL *mysql;
    43234323    } psDB;
    43244324\end{verbatim}
     
    43984398\begin{verbatim}
    43994399    psArray *psDBSelectColumn(psDB *dbh, const char *tableName, const char *col, const psU64 limit);
    4400     psVector *psDBSelectColumnNum(psDB *dbh, const char *tableName, const char *col, const psU64 limit);
    4401 \end{verbatim}
    4402 
    4403 These functions generates and executes the SQL needed to select an
    4404 entire column from a table or up to \code{limit} rows from it.  If
    4405 \code{limit} is 0, the entire range is returned.  The database
    4406 response is processed and a \code{psArray} of elements of the native
    4407 type is returned.  The Num version of the function returns the data in
    4408 a \code{psVector}.  It returns an error (NULL) if the requested field
    4409 is not a numerical type.
     4400    psVector *psDBSelectColumnNum(psDB *dbh, const char *tableName, const char *col, psElemType pType, const psU64 limit);
     4401\end{verbatim}
     4402
     4403These functions generates and executes the SQL needed to select an entire
     4404column from a table or up to \code{limit} rows from it.  If \code{limit} is 0,
     4405the entire range is returned.  The database response is processed and a
     4406\code{psArray} of strings is returned.  The Num version of the function returns
     4407the data in a \code{psVector}, data cast to \code{pType}.  It returns an error
     4408(NULL) if the requested field is not a numerical type.
    44104409
    44114410\begin{verbatim}
     
    44234422
    44244423\begin{verbatim}
    4425     bool psDBInsertRow(psDB *dbh, const char *tableName, psMetadata *row);
     4424    bool psDBInsertOneRow(psDB *dbh, const char *tableName, psMetadata *row);
    44264425\end{verbatim}
    44274426
     
    44374436
    44384437\begin{verbatim}
    4439     psArray *psDBDumpCols(psDB *dbh, const char *tableName);
    4440 \end{verbatim}
    4441 
    4442 Fetch all columns as an psArray of psVector
    4443 
    4444 \begin{verbatim}
    4445     psU64 psDBUpdateRow(psDB *dbh, const char *tableName, psMetadata *where, psMetadata *values);
     4438    psMetadata *psDBDumpCols(psDB *dbh, const char *tableName);
     4439\end{verbatim}
     4440
     4441Fetch all columns, as either a psVector or a psArray depnding on whether or not
     4442the column is numeric, and return them in a psMetadata structure where
     4443psMetadataItem.name contains the column's name.
     4444
     4445\begin{verbatim}
     4446    psU64 psDBUpdateRows(psDB *dbh, const char *tableName, psMetadata *where, psMetadata *values);
    44464447\end{verbatim}
    44474448
     
    44544455
    44554456\begin{verbatim}
    4456     psU64 psDBDeleteRow(psDB *dbh, const char *tableName, psMetadata *where);
     4457    psU64 psDBDeleteRows(psDB *dbh, const char *tableName, psMetadata *where);
    44574458\end{verbatim}
    44584459
Note: See TracChangeset for help on using the changeset viewer.