NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions
sdbapi.hpp File Reference
#include <string>
#include <map>
#include <vector>
#include <corelib/ncbitime.hpp>
#include <corelib/rwstream.hpp>
#include <util/ncbi_url.hpp>
#include <dbapi/dbapi.hpp>
#include <dbapi/error_codes.hpp>
+ Include dependency graph for sdbapi.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CSDB_Exception
 Exception class used throughout the API. More...
 
class  CSDB_DeadlockException
 
class  CQuery
 Object used to execute queries and stored procedures on the database server and retrieve result sets. More...
 
class  CQuery::CField
 Class representing value in result set or output parameter of stored procedure. More...
 
class  CQuery::CRow
 A full row of result data. More...
 
class  CQuery::CRowIterator
 Iterator class doing main navigation through result sets. More...
 
class  CBlobBookmark
 Object used to store bookmarks to blobs to be changed later. More...
 
class  CBulkInsert
 Object used to perform bulk-inserting operations to database. More...
 
class  CSDB_Decryptor
 Database password decryptor. More...
 
class  CSDB_ConnectionParam
 Convenience class to initialize database connection parameters from URL-like strings and/or application configuration and/or hard-code. More...
 
class  CDatabase
 Database connection object. More...
 
class  CSDBAPI
 

Macros

#define SDBAPI_TRANSACTION(obj)   DBAPI_TRANSACTION(obj)
 Establish an automatically managed anonymous SQL transaction on the specified object's connection for the duration of the immediately following code block: SDBAPI_TRANSACTION(obj) { ... More...
 

Enumerations

enum  ESDB_Type {
  eSDB_Byte , eSDB_Short , eSDB_Int4 , eSDB_Int8 ,
  eSDB_Float , eSDB_Double , eSDB_String , eSDB_StringUCS2 ,
  eSDB_Binary , eSDB_DateTime , eSDB_BigDateTime , eSDB_Text ,
  eSDB_TextUCS2 , eSDB_Image , eSDB_StringMax , eSDB_StringMaxUCS2 ,
  eSDB_BinaryMax , eSDB_Bit
}
 Database types used throughout API. More...
 
enum  ESP_ParamType { eSP_In , eSP_InOut }
 Stored procedure and statement parameter types. More...
 
enum  ENewBlobStoreFlags {
  fNBS_ZLib = 1 << 0 , fNBS_BZLib = 1 << 1 , fNBS_LogIt = 1 << 2 , fNBS_IsText = 1 << 3 ,
  fNBS_Preallocated = 1 << 4
}
 Flags for NewBlobStore methods. More...
 

Functions

 DECLARE_SAFE_FLAGS_TYPE (ENewBlobStoreFlags, TNewBlobStoreFlags)
 
 DECLARE_SAFE_FLAGS (ENewBlobStoreFlags)
 
CAutoTrans::CSubject DBAPI_MakeTrans (CDatabase &db)
 (S)DBAPI_TRANSACTION glue for CDatabase. More...
 
CAutoTrans::CSubject DBAPI_MakeTrans (CQuery &query)
 (S)DBAPI_TRANSACTION glue for CQuery. More...
 
CBulkInsertNullValue (CBulkInsert &bi)
 Manipulator putting null value into the bulk-insert row. More...
 
CBulkInsertEndRow (CBulkInsert &bi)
 Manipulator ending row in the bulk-insert object. More...
 

Macro Definition Documentation

◆ SDBAPI_TRANSACTION

#define SDBAPI_TRANSACTION (   obj)    DBAPI_TRANSACTION(obj)

Establish an automatically managed anonymous SQL transaction on the specified object's connection for the duration of the immediately following code block: SDBAPI_TRANSACTION(obj) { ...

}

Automatically COMMIT upon reaching the end of the block normally. Automatically ROLLBACK upon leaving the block early, via a break or return statement or uncaught exception. A client crash or severed connection will trigger an implicit server-side ROLLBACK.

Nested transactions are possible, and will use savepoints for inner transactions so they can fail cleanly (without also canceling outer transactions).

Definition at line 227 of file sdbapi.hpp.

Enumeration Type Documentation

◆ ENewBlobStoreFlags

Flags for NewBlobStore methods.

Enumerator
fNBS_ZLib 

Use zlib (gzip) compression.

fNBS_BZLib 

Use bzlib (bzip2) compression.

fNBS_LogIt 

Enable transaction logs.

fNBS_IsText 

Blobs have type TEXT or [N]VARCHAR(MAX)

fNBS_Preallocated 

Don't create rows or clean up any excess.

Definition at line 200 of file sdbapi.hpp.

◆ ESDB_Type

enum ESDB_Type

Database types used throughout API.

Each corresponds most naturally to a common Transact-SQL type, but implicit conversion is also possible in many cases, including to and from types with no exact SDBAPI equivalent.

Enumerator
eSDB_Byte 

Like Transact-SQL BYTE (unsigned 8-bit integer)

eSDB_Short 

Like Transact-SQL SMALLINT (signed 16-bit integer)

eSDB_Int4 

Like Transact-SQL INT (signed 32-bit integer)

eSDB_Int8 

Like Transact-SQL BIGINT (signed 64-bit integer)

eSDB_Float 

Like Transact-SQL REAL (32-bit floating point value)

eSDB_Double 

Like Transact-SQL DOUBLE (64-bit floating point value)

eSDB_String 

Like Transact-SQL VARCHAR(N)

eSDB_StringUCS2 

Like Transact-SQL NVARCHAR(N)

eSDB_Binary 

Like Transact-SQL VARBINARY(N)

eSDB_DateTime 

Like Transact-SQL DATETIME.

eSDB_BigDateTime 

Like Transact-SQL DATETIME2 (MS) or BIGDATETIME (Syb)

eSDB_Text 

Like Transact-SQL TEXT.

eSDB_TextUCS2 

Like Transact-SQL NTEXT.

eSDB_Image 

Like Transact-SQL IMAGE.

eSDB_StringMax 

Like Transact-SQL VARCHAR(MAX)

eSDB_StringMaxUCS2 

Like Transact-SQL NVARCHAR(MAX)

eSDB_BinaryMax 

Like Transact-SQL VARBINARY(MAX)

eSDB_Bit 

Like Transact-SQL BIT.

Definition at line 172 of file sdbapi.hpp.

◆ ESP_ParamType

Stored procedure and statement parameter types.

Enumerator
eSP_In 

Parameter is only passed to server, no return is expected.

eSP_InOut 

Parameter can be returned from stored procedure.

Definition at line 194 of file sdbapi.hpp.

Function Documentation

◆ DBAPI_MakeTrans() [1/2]

CAutoTrans::CSubject DBAPI_MakeTrans ( CDatabase db)

(S)DBAPI_TRANSACTION glue for CDatabase.

Definition at line 3513 of file sdbapi.cpp.

References CDatabaseImpl::GetConnection(), and CDatabase::m_Impl.

Referenced by DBAPI_MakeTrans().

◆ DBAPI_MakeTrans() [2/2]

CAutoTrans::CSubject DBAPI_MakeTrans ( CQuery query)

(S)DBAPI_TRANSACTION glue for CQuery.

Definition at line 3518 of file sdbapi.cpp.

References DBAPI_MakeTrans(), and query.

◆ DECLARE_SAFE_FLAGS()

DECLARE_SAFE_FLAGS ( ENewBlobStoreFlags  )

◆ DECLARE_SAFE_FLAGS_TYPE()

DECLARE_SAFE_FLAGS_TYPE ( ENewBlobStoreFlags  ,
TNewBlobStoreFlags   
)

◆ EndRow()

CBulkInsert& EndRow ( CBulkInsert bi)

Manipulator ending row in the bulk-insert object.

Definition at line 2508 of file sdbapi.cpp.

References CBulkInsertImpl::EndRow(), and CBulkInsert::m_Impl.

Referenced by CSdbapiTest::Run().

◆ NullValue()

CBulkInsert& NullValue ( CBulkInsert bi)

Manipulator putting null value into the bulk-insert row.

Definition at line 2501 of file sdbapi.cpp.

References CBulkInsert::m_Impl, and CBulkInsertImpl::WriteNull().

Referenced by do_binds(), and test_bind().

Modified on Wed Jun 19 17:05:03 2024 by modify_doxy.py rev. 669887