NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
Database APIs
+ Collaboration diagram for Database APIs:

Classes

class  IResultSetMetaData
 IResultSetMetaData –. More...
 
class  IResultSet
 
class  IStatement
 
class  ICallableStatement
 ICallableStatement –. More...
 
class  ICursor
 ICursor –. More...
 
class  IBulkInsert
 IBulkInsert –. More...
 
class  IConnection
 
class  IDataSource
 IDataSource –. More...
 
class  CSQLITE3_ICacheException
 SQLITE3 ICache exception. More...
 
class  CSQLITE3_Cache
 SQLITE3 cache implementation. More...
 
struct  CSQLITE3_Cache::SWriteRequest
 delayed write request object More...
 
class  CSQLITE3_Cache::CWriterThread
 thread for delayed writes More...
 

Typedefs

typedef int TBlobOStreamFlags
 
typedef CSyncQueue< CRef< SWriteRequest > > CSQLITE3_Cache::TWriteQueue
 queue for delayed writes More...
 
typedef struct sqlite3 CSQLITE3_Cache::TSqliteDb
 sqlite3 database handle More...
 

Enumerations

enum  EAllowLog { eDisableLog , eEnableLog }
 EDataSource –. More...
 
enum  EBlobOStreamFlags { fBOS_UseTransaction = 1 << 0 , fBOS_SkipLogging = 1 << 1 }
 EBlobOStreamFlags –. More...
 
enum  IBulkInsert::EHints {
  IBulkInsert::eOrder , IBulkInsert::eRowsPerBatch , IBulkInsert::eKilobytesPerBatch , IBulkInsert::eTabLock ,
  IBulkInsert::eCheckConstraints , IBulkInsert::eFireTriggers
}
 Type of hint that can be set. More...
 
enum  IConnection::EConnMode { IConnection::eBulkInsert = I_DriverContext::fBcpIn , IConnection::ePasswordEncrypted = I_DriverContext::fPasswordEncrypted }
 Which connection mode. More...
 
enum  CSQLITE3_ICacheException::EErrCode { CSQLITE3_ICacheException::eUnknown , CSQLITE3_ICacheException::eInitError , CSQLITE3_ICacheException::eNotImplemented }
 
enum  { CSQLITE3_Cache::kDefaultTimestampPolicy }
 

Functions

virtual IResultSetMetaData::~IResultSetMetaData (void)
 Destructor. More...
 
bool IResultSetMetaData::HasColumn (const CDBParamVariant &param) const
 Convenience method to check whether a column with a given name (or number) actually exists. More...
 
virtual unsigned int IResultSetMetaData::GetTotalColumns (void) const =0
 Get total number of columns in resultset. More...
 
virtual EDB_Type IResultSetMetaData::GetType (const CDBParamVariant &param) const =0
 Get data type for column in the resultset. More...
 
virtual int IResultSetMetaData::GetMaxSize (const CDBParamVariant &param) const =0
 Get maximum size in bytes for column. More...
 
virtual string IResultSetMetaData::GetName (const CDBParamVariant &param) const =0
 Get name of column. More...
 
virtual CDBParams::EDirection IResultSetMetaData::GetDirection (const CDBParamVariant &param) const =0
 Get parameter's direction (in/out/inout). More...
 
virtual IResultSet::~IResultSet ()
 Destructor. More...
 
virtual EDB_ResType IResultSet::GetResultType ()=0
 Get result type. More...
 
virtual bool IResultSet::Next ()=0
 Get next row. More...
 
virtual const CVariantIResultSet::GetVariant (const CDBParamVariant &param)=0
 Retrieve a CVariant class describing the data stored in a given column. More...
 
virtual void IResultSet::DisableBind (bool b)=0
 Disables column binding. More...
 
virtual void IResultSet::BindBlobToVariant (bool b)=0
 Bind blob to variant. More...
 
virtual size_t IResultSet::Read (void *buf, size_t size)=0
 Read unformatted data. More...
 
virtual bool IResultSet::WasNull ()=0
 Determine if last column was NULL. More...
 
virtual int IResultSet::GetColumnNo ()=0
 Get column number, currently available for Read() More...
 
virtual unsigned int IResultSet::GetTotalColumns ()=0
 Get total columns. More...
 
virtual CNcbiIstreamIResultSet::GetBlobIStream (size_t buf_size=0)=0
 Get Blob input stream. More...
 
virtual CNcbiOstreamIResultSet::GetBlobOStream (size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0
 Get Blob output stream. More...
 
virtual CNcbiOstreamIResultSet::GetBlobOStream (size_t blob_size, EAllowLog log_it, size_t buf_size=0)
 
virtual CNcbiOstreamIResultSet::GetBlobOStream (IConnection *conn, size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0
 Get Blob output stream with explicit additional connection. More...
 
virtual CNcbiOstreamIResultSet::GetBlobOStream (IConnection *conn, size_t blob_size, EAllowLog log_it, size_t buf_size=0)
 
virtual IReaderIResultSet::GetBlobReader ()=0
 Get a Blob Reader. More...
 
virtual void IResultSet::Close ()=0
 Close resultset. More...
 
virtual const IResultSetMetaDataIResultSet::GetMetaData (EOwnership ownership=eNoOwnership)=0
 Get Metadata. More...
 
virtual IStatement::~IStatement ()
 Destructor. More...
 
virtual IResultSetIStatement::GetResultSet ()=0
 Get resulset. More...
 
virtual bool IStatement::HasMoreResults ()=0
 Check for more results available. More...
 
virtual bool IStatement::Failed ()=0
 Check if the statement failed. More...
 
virtual bool IStatement::HasRows ()=0
 Check if resultset has rows. More...
 
virtual void IStatement::PurgeResults ()=0
 Purge results. More...
 
virtual void IStatement::Cancel ()=0
 Cancel statement. More...
 
virtual void IStatement::Close ()=0
 Close statement. More...
 
virtual void IStatement::SendSql (const string &sql)=0
 Sends one or more SQL statements to the SQL server. More...
 
virtual void IStatement::Execute (const string &sql)=0
 Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql()) More...
 
virtual void IStatement::ExecuteUpdate (const string &sql)=0
 Executes SQL statement with no results returned. More...
 
virtual IResultSetIStatement::ExecuteQuery (const string &sql)=0
 Exectues SQL statement and returns the first resultset. More...
 
virtual void IStatement::ExecuteLast ()=0
 Executes the last command (with changed parameters, if any). More...
 
virtual void IStatement::SetParam (const CVariant &v, const CDBParamVariant &param)=0
 Set input/output parameter. More...
 
virtual void IStatement::ClearParamList ()=0
 Clear parameter list. More...
 
virtual int IStatement::GetRowCount ()=0
 Get total of rows returned. More...
 
virtual IWriterIStatement::GetBlobWriter (I_BlobDescriptor &d, size_t blob_size, TBlobOStreamFlags flags=0)=0
 Get a writer for writing BLOBs using previously created CDB_BlobDescriptor. More...
 
virtual IWriterIStatement::GetBlobWriter (I_BlobDescriptor &d, size_t blob_size, EAllowLog log_it)
 
virtual CNcbiOstreamIStatement::GetBlobOStream (I_BlobDescriptor &d, size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0
 Get an ostream for writing BLOBs using previously created CDB_BlobDescriptor. More...
 
virtual CNcbiOstreamIStatement::GetBlobOStream (I_BlobDescriptor &d, size_t blob_size, EAllowLog log_it, size_t buf_size=0)
 
virtual class IConnectionIStatement::GetParentConn ()=0
 Get the parent connection. More...
 
virtual void IStatement::SetAutoClearInParams (bool flag=true)=0
 Set auto-clear input parameter flag. More...
 
virtual bool IStatement::IsAutoClearInParams (void) const =0
 Get auto-clear input parameter flag value. More...
 
virtual const IResultSetMetaDataIStatement::GetParamsMetaData (void)=0
 Get input parameters metadata. More...
 
virtual ICallableStatement::~ICallableStatement ()
 Destructor. More...
 
virtual void ICallableStatement::Execute ()=0
 Execute stored procedure. More...
 
virtual void ICallableStatement::ExecuteUpdate ()=0
 Executes stored procedure no results returned. More...
 
virtual int ICallableStatement::GetReturnStatus ()=0
 Get return status from the stored procedure. More...
 
virtual void ICallableStatement::SetParam (const CVariant &v, const CDBParamVariant &param)=0
 Set input parameters. More...
 
virtual void ICallableStatement::SetOutputParam (const CVariant &v, const CDBParamVariant &param)=0
 Set output parameter, which will be returned as resultset. More...
 
virtual void ICallableStatement::SendSql (const string &)
 Sends one or more SQL statements to the SQL server. More...
 
virtual void ICallableStatement::Execute (const string &)
 Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql()) More...
 
virtual void ICallableStatement::ExecuteUpdate (const string &)
 Executes SQL statement with no results returned. More...
 
virtual IResultSetICallableStatement::ExecuteQuery (const string &)
 Exectues SQL statement and returns the first resultset. More...
 
virtual ICursor::~ICursor ()
 Destructor. More...
 
virtual void ICursor::SetParam (const CVariant &v, const CDBParamVariant &param)=0
 Set input parameter. More...
 
virtual IResultSetICursor::Open ()=0
 Open cursor and get corresponding resultset. More...
 
virtual CNcbiOstreamICursor::GetBlobOStream (unsigned int col, size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0
 Get output stream for BLOB updates, requires BLOB column number. More...
 
virtual CNcbiOstreamICursor::GetBlobOStream (unsigned int col, size_t blob_size, EAllowLog log_it, size_t buf_size=0)
 
virtual IWriterICursor::GetBlobWriter (unsigned int col, size_t blob_size, TBlobOStreamFlags flags=0)=0
 Get Blob Writer. More...
 
virtual IWriterICursor::GetBlobWriter (unsigned int col, size_t blob_size, EAllowLog log_it)
 
virtual void ICursor::Update (const string &table, const string &updateSql)=0
 Update statement for cursor. More...
 
virtual void ICursor::Delete (const string &table)=0
 Delete statement for cursor. More...
 
virtual void ICursor::Cancel ()=0
 Cancel cursor. More...
 
virtual void ICursor::Close ()=0
 Close cursor. More...
 
virtual class IConnectionICursor::GetParentConn ()=0
 Get the parent connection. More...
 
virtual IBulkInsert::~IBulkInsert ()
 Destructor. More...
 
virtual void IBulkInsert::SetHints (CTempString hints)=0
 Set hints by one call. Resets everything that was set by Add*Hint(). More...
 
virtual void IBulkInsert::AddHint (EHints hint, unsigned int value=0)=0
 Add hint with value. More...
 
virtual void IBulkInsert::AddOrderHint (CTempString columns)=0
 Add "ORDER" hint. More...
 
virtual void IBulkInsert::Bind (const CDBParamVariant &param, CVariant *v)=0
 Bind column. More...
 
virtual void IBulkInsert::AddRow ()=0
 Add row to the batch. More...
 
virtual void IBulkInsert::StoreBatch ()=0
 Store batch of rows. More...
 
virtual void IBulkInsert::Cancel ()=0
 Cancel bulk insert. More...
 
virtual void IBulkInsert::Complete ()=0
 Complete batch. More...
 
virtual void IBulkInsert::Close ()=0
 Close. More...
 
virtual IConnection::~IConnection ()
 Destructor. More...
 
virtual void IConnection::SetMode (EConnMode mode)=0
 Set connection mode. More...
 
virtual void IConnection::ResetMode (EConnMode mode)=0
 Reset connection mode. More...
 
virtual unsigned int IConnection::GetModeMask ()=0
 Get mode mask. More...
 
virtual void IConnection::ForceSingle (bool enable)=0
 Force single connection mode, default false. More...
 
virtual IDataSourceIConnection::GetDataSource ()=0
 Get parent datasource object. More...
 
virtual void IConnection::Connect (const string &user, const string &password, const string &server, const string &database=kEmptyStr)=0
 Connect to a database. More...
 
virtual void IConnection::Connect (const CDBConnParams &params)=0
 Connect to a database. More...
 
virtual void IConnection::ConnectValidated (IConnValidator &validator, const string &user, const string &password, const string &server, const string &database=kEmptyStr)=0
 Connect to a database using connect validator. More...
 
virtual IConnectionIConnection::CloneConnection (EOwnership ownership=eNoOwnership)=0
 Clone existing connection. More...
 
virtual void IConnection::SetDatabase (const string &name)=0
 Set current database. More...
 
virtual string IConnection::GetDatabase ()=0
 Get current database. More...
 
virtual bool IConnection::IsAlive ()=0
 Check if the connection is alive. More...
 
virtual IStatementIConnection::GetStatement ()=0
 Get statement object for regular SQL queries. More...
 
virtual ICallableStatementIConnection::GetCallableStatement (const string &proc)=0
 Get callable statement object for stored procedures. More...
 
ICallableStatementIConnection::GetCallableStatement (const string &proc, int)
 
virtual ICursorIConnection::GetCursor (const string &name, const string &sql, int batchSize)=0
 Get cursor object. More...
 
ICursorIConnection::GetCursor (const string &name, const string &sql)
 
ICursorIConnection::GetCursor (const string &name, const string &sql, int, int batchSize)
 
virtual IBulkInsertIConnection::GetBulkInsert (const string &table_name)=0
 Create bulk insert object. More...
 
IBulkInsertIConnection::GetBulkInsert (const string &table_name, unsigned int)
 
virtual IStatementIConnection::CreateStatement ()=0
 Get statement object for regular SQL queries. More...
 
virtual ICallableStatementIConnection::PrepareCall (const string &proc)=0
 Get callable statement object for stored procedures. More...
 
ICallableStatementIConnection::PrepareCall (const string &proc, int)
 
virtual ICursorIConnection::CreateCursor (const string &name, const string &sql, int batchSize)=0
 Get cursor object. More...
 
ICursorIConnection::CreateCursor (const string &name, const string &sql)
 
ICursorIConnection::CreateCursor (const string &name, const string &sql, int, int batchSize)
 
virtual IBulkInsertIConnection::CreateBulkInsert (const string &table_name)=0
 Create bulk insert object. More...
 
IBulkInsertIConnection::CreateBulkInsert (const string &table_name, unsigned int)
 
virtual void IConnection::Close ()=0
 Close connecti. More...
 
virtual void IConnection::Abort ()=0
 Abort connection. More...
 
virtual void IConnection::SetTimeout (size_t nof_secs)=0
 Set connection timeout. More...
 
virtual void IConnection::SetCancelTimeout (size_t)
 Set timeout for command cancellation and connection closing. More...
 
virtual size_t IConnection::GetTimeout (void) const
 Get connection timeout. More...
 
virtual size_t IConnection::GetCancelTimeout (void) const
 Get timeout for command cancellation and connection closing. More...
 
virtual void IConnection::MsgToEx (bool v)=0
 If enabled, redirects all error messages to CDB_MultiEx object (see below). More...
 
virtual CDB_MultiExIConnection::GetErrorAsEx ()=0
 Returns all error messages as a CDB_MultiEx object. More...
 
virtual string IConnection::GetErrorInfo ()=0
 Returns all error messages as a single string. More...
 
virtual const CVersionInfoIConnection::GetVersionInfo () const =0
 
virtual CDB_ConnectionIConnection::GetCDB_Connection ()=0
 Returns the internal driver connection object. More...
 
virtual IDataSource::~IDataSource ()
 Protected Destructor. More...
 
virtual IConnectionIDataSource::CreateConnection (EOwnership ownership=eNoOwnership)=0
 
virtual void IDataSource::SetLoginTimeout (unsigned int i)=0
 Set login timeout. More...
 
virtual void IDataSource::SetLogStream (ostream *out)=0
 Set the output stream for server messages. More...
 
virtual CDB_MultiExIDataSource::GetErrorAsEx ()=0
 Returns all server messages as a CDB_MultiEx object. More...
 
virtual string IDataSource::GetErrorInfo ()=0
 Returns all server messages as a single string. More...
 
virtual I_DriverContextIDataSource::GetDriverContext ()=0
 Returns the pointer to the general driver interface. More...
 
virtual const I_DriverContextIDataSource::GetDriverContext () const =0
 
void IDataSource::SetApplicationName (const string &app_name)
 
string IDataSource::GetApplicationName (void) const
 
CAutoTrans::CSubject DBAPI_MakeTrans (IConnection &connection)
 
void SQLITE3_Register_Cache (void)
 Register NCBI_EntryPoint_SQLITE3_BlobCache. More...
 
virtual const char * CSQLITE3_ICacheException::GetErrCodeString (void) const override
 Get error code interpreted as text. More...
 
 CSQLITE3_ICacheException::NCBI_EXCEPTION_DEFAULT (CSQLITE3_ICacheException, CException)
 
 CSQLITE3_Cache::CSQLITE3_Cache ()
 
virtual CSQLITE3_Cache::~CSQLITE3_Cache ()
 
void CSQLITE3_Cache::Open (const string &database, bool remove=false)
 Open cache. More...
 
bool CSQLITE3_Cache::Vacuum ()
 Vacuum the database (should be open first) More...
 
unsigned CSQLITE3_Cache::GetMemBufferSize () const
 
void CSQLITE3_Cache::StoreSynchronous (const string &key, int version, const string &subkey, const void *data, size_t size)
 
const stringCSQLITE3_Cache::GetDatabase () const
 Get DB name/path. More...
 
 CSQLITE3_Cache::CWriterThread::CWriterThread (CSQLITE3_Cache &cache, TWriteQueue &write_q)
 
void * CSQLITE3_Cache::CWriterThread::Main ()
 Derived (user-created) class must provide a real thread function. More...
 
void CSQLITE3_Cache::CWriterThread::Stop ()
 Queue a request to stop the background writer Asyncronous! Thread may not stop yet when it gets back from this call. More...
 
 CSQLITE3_Cache::CWriterThread::CWriterThread (const CWriterThread &)
 
CWriterThreadCSQLITE3_Cache::CWriterThread::operator= (const CWriterThread &)
 
void CSQLITE3_Cache::x_SetTimestamp (const string &key, int version, const string &subkey)
 
 CSQLITE3_Cache::CSQLITE3_Cache (const CSQLITE3_Cache &)
 
CSQLITE3_CacheCSQLITE3_Cache::operator= (const CSQLITE3_Cache &)
 

Variables

string CSQLITE3_Cache::SWriteRequest::key
 
int CSQLITE3_Cache::SWriteRequest::version
 
string CSQLITE3_Cache::SWriteRequest::subkey
 
int CSQLITE3_Cache::SWriteRequest::timestamp
 
CSimpleBuffer CSQLITE3_Cache::SWriteRequest::buffer
 
TWriteQueue CSQLITE3_Cache::m_WriteQueue
 
CRef< SWriteRequestCSQLITE3_Cache::CWriterThread::m_StopRequest
 
CSQLITE3_CacheCSQLITE3_Cache::CWriterThread::m_Cache
 
TWriteQueueCSQLITE3_Cache::CWriterThread::m_WriteQueue
 
CRef< CWriterThreadCSQLITE3_Cache::m_WriterThread
 
bool CSQLITE3_Cache::m_ReadOnly
 
unsigned int CSQLITE3_Cache::m_Timeout
 
TTimeStampFlags CSQLITE3_Cache::m_TimeStampFlag
 
EKeepVersions CSQLITE3_Cache::m_VersionFlag
 
string CSQLITE3_Cache::m_Database
 filename of the database More...
 
CMutex CSQLITE3_Cache::m_Mutex
 
TSqliteDbCSQLITE3_Cache::m_DB
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_Store
 precompiled statements these are used to speed up time-critical accesses More...
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_HasBlobs_key
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_HasBlobs_key_subkey
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_GetBlobAccess
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_GetReadStream
 
unique_ptr< CSQLITE3_StatementCSQLITE3_Cache::m_Stmt_SetTimestamp
 
const string kSQLITE3_BlobCacheDriverName
 

Friends

class IDataSource::CDriverManager
 

ICache interface

virtual void CSQLITE3_Cache::SetTimeStampPolicy (TTimeStampFlags policy, unsigned int timeout, unsigned int max_timeout=0)
 Set timestamp update policy. More...
 
virtual TTimeStampFlags CSQLITE3_Cache::GetTimeStampPolicy () const
 Get timestamp policy. More...
 
virtual int CSQLITE3_Cache::GetTimeout () const
 Get expiration timeout. More...
 
virtual bool CSQLITE3_Cache::IsOpen () const
 
virtual void CSQLITE3_Cache::SetVersionRetention (EKeepVersions policy)
 Set version retention policy. More...
 
virtual EKeepVersions CSQLITE3_Cache::GetVersionRetention () const
 Get version retention. More...
 
virtual void CSQLITE3_Cache::Store (const string &key, int version, const string &subkey, const void *data, size_t size, unsigned int time_to_live=0, const string &owner=kEmptyStr)
 Add or replace BLOB. More...
 
virtual size_t CSQLITE3_Cache::GetSize (const string &key, int version, const string &subkey)
 Check if BLOB exists, return BLOB size. More...
 
virtual void CSQLITE3_Cache::GetBlobOwner (const string &key, int version, const string &subkey, string *owner)
 Retrieve BLOB owner. More...
 
virtual bool CSQLITE3_Cache::Read (const string &key, int version, const string &subkey, void *buf, size_t buf_size)
 Fetch the BLOB. More...
 
virtual IReaderCSQLITE3_Cache::GetReadStream (const string &key, int version, const string &subkey)
 Return sequential stream interface to read BLOB data. More...
 
virtual IReaderCSQLITE3_Cache::GetReadStream (const string &key, const string &subkey, int *version, EBlobVersionValidity *validity)
 Request the latest version of a BLOB. More...
 
virtual void CSQLITE3_Cache::SetBlobVersionAsValid (const string &key, const string &subkey, int version)
 
virtual void CSQLITE3_Cache::GetBlobAccess (const string &key, int version, const string &subkey, SBlobAccessDescr *blob_descr)
 Get BLOB access using BlobAccessDescr. More...
 
virtual IWriterCSQLITE3_Cache::GetWriteStream (const string &key, int version, const string &subkey, unsigned int time_to_live=0, const string &owner=kEmptyStr)
 Specifics of this IWriter implementation is that IWriter::Flush here cannot be called twice, because it finalises transaction Also you cannot call Write after Flush... More...
 
virtual void CSQLITE3_Cache::Remove (const string &key)
 
virtual void CSQLITE3_Cache::Remove (const string &key, int version, const string &subkey)
 Remove specific cache entry. More...
 
virtual time_t CSQLITE3_Cache::GetAccessTime (const string &key, int version, const string &subkey)
 Return last access time for the specified cache entry. More...
 
virtual bool CSQLITE3_Cache::HasBlobs (const string &key, const string &subkey)
 Check if any BLOB exists (any version) More...
 
virtual void CSQLITE3_Cache::Purge (time_t access_timeout)
 Delete all BLOBs older than specified. More...
 
virtual void CSQLITE3_Cache::Purge (const string &key, const string &subkey, time_t access_timeout)
 Delete BLOBs with access time older than specified. More...
 
virtual bool CSQLITE3_Cache::SameCacheParams (const TCacheParams *params) const
 
virtual string CSQLITE3_Cache::GetCacheName (void) const
 
virtual TFlags CSQLITE3_Cache::GetFlags ()
 Retrieve the effective combination of flags from the underlying storage. More...
 
virtual void CSQLITE3_Cache::SetFlags (TFlags flags)
 Pass flags to the underlying storage. More...
 

unimplemented

void CSQLITE3_Cache::SetMemBufferSize (unsigned int buf_size)
 Set size of the intermidiate BLOB memory buffer. More...
 

Detailed Description

Typedef Documentation

◆ TBlobOStreamFlags

Definition at line 103 of file dbapi.hpp.

◆ TSqliteDb

typedef struct sqlite3 CSQLITE3_Cache::TSqliteDb
private

sqlite3 database handle

Definition at line 288 of file sqlite_cache.hpp.

◆ TWriteQueue

queue for delayed writes

Definition at line 252 of file sqlite_cache.hpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDefaultTimestampPolicy 

Definition at line 103 of file sqlite_cache.hpp.

◆ EAllowLog

enum EAllowLog

EDataSource –.

Data source platform

enum EDataSource { eSybase, eMsSql };

EAllowLog –

Allow transaction log (general, to avoid using bools).

Enumerator
eDisableLog 

Disables log.

eEnableLog 

Enables log.

Definition at line 78 of file dbapi.hpp.

◆ EBlobOStreamFlags

EBlobOStreamFlags –.

How to send BLOB data (generalization of EAllowLog).

Enumerator
fBOS_UseTransaction 

Use a (sub)transaction (committed once all data's been sent successfully, rolled back for unrecoverable errors) to guard against races that could let readers see incomplete blobs, and to allow for replication as appropriate.

NB: This approach can yield local deadlocks in some circumstances, particularly if a single application thread maintains multiple connections to the database in question (due, for instance, to using methods that establish temporary clones of the original connection).

fBOS_SkipLogging 

Definition at line 90 of file dbapi.hpp.

◆ EConnMode

Which connection mode.

Enumerator
eBulkInsert 

Bulk insert mode.

This value is not needed anymore because BCP mode is enabled all the time in all drivers now.

ePasswordEncrypted 

Encrypted password mode.

Definition at line 737 of file dbapi.hpp.

◆ EErrCode

Enumerator
eUnknown 
eInitError 
eNotImplemented 

Definition at line 79 of file sqlite_cache.hpp.

◆ EHints

Type of hint that can be set.

Enumerator
eOrder 
eRowsPerBatch 
eKilobytesPerBatch 
eTabLock 
eCheckConstraints 
eFireTriggers 

Definition at line 680 of file dbapi.hpp.

Function Documentation

◆ Abort()

virtual void IConnection::Abort ( )
pure virtual

Abort connection.

Implemented in CConnection.

◆ AddHint()

virtual void IBulkInsert::AddHint ( EHints  hint,
unsigned int  value = 0 
)
pure virtual

Add hint with value.

Can be used with any hint type except eOrder and with e..PerBatch value should be non-zero. Resets everything that was set by SetHints().

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::AddHint().

◆ AddOrderHint()

virtual void IBulkInsert::AddOrderHint ( CTempString  columns)
pure virtual

Add "ORDER" hint.

Resets everything that was set by SetHints().

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::AddOrderHint().

◆ AddRow()

virtual void IBulkInsert::AddRow ( )
pure virtual

Add row to the batch.

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::EndRow(), and CDbapiTest::Run().

◆ Bind()

virtual void IBulkInsert::Bind ( const CDBParamVariant param,
CVariant v 
)
pure virtual

Bind column.

Parameters
colColumn number.
vVariant value.

Implemented in CDBAPIBulkInsert.

Referenced by CDbapiTest::Run(), and CBulkInsertImpl::x_CheckWriteStarted().

◆ BindBlobToVariant()

virtual void IResultSet::BindBlobToVariant ( bool  b)
pure virtual

Bind blob to variant.

If this mode is true, BLOB data is returned as CVariant False by default.

Note
When binding of blobs to variant is disabled all columns in resultset placed after first blob column must be read with Read() method, GetVariant() method will always return NULL for these columns.
Parameters
Enablesblob binding when set to true.

Implemented in CResultSet.

Referenced by CDbapiTest::Run().

◆ Cancel() [1/3]

virtual void IStatement::Cancel ( )
pure virtual

Cancel statement.

Rolls back current transaction.

Implemented in CStatement.

◆ Cancel() [2/3]

virtual void ICursor::Cancel ( )
pure virtual

Cancel cursor.

Implemented in CCursor.

◆ Cancel() [3/3]

virtual void IBulkInsert::Cancel ( )
pure virtual

Cancel bulk insert.

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::x_CheckCanWrite().

◆ ClearParamList()

virtual void IStatement::ClearParamList ( )
pure virtual

Clear parameter list.

Implemented in CStatement.

Referenced by CQueryImpl::Execute().

◆ CloneConnection()

virtual IConnection* IConnection::CloneConnection ( EOwnership  ownership = eNoOwnership)
pure virtual

Clone existing connection.

All settings are copied except message handlers Set ownership to eTakeOwnership to prevent deleting connection upon deleting parent object

Implemented in CConnection.

◆ Close() [1/5]

virtual void IResultSet::Close ( )
pure virtual

Close resultset.

Implemented in CResultSet.

◆ Close() [2/5]

virtual void IStatement::Close ( )
pure virtual

Close statement.

Implemented in CStatement, and CCallableStatement.

Referenced by CDbapiTest::Run(), and CQueryImpl::x_Close().

◆ Close() [3/5]

virtual void ICursor::Close ( )
pure virtual

Close cursor.

Implemented in CCursor.

◆ Close() [4/5]

virtual void IBulkInsert::Close ( )
pure virtual

Close.

Implemented in CDBAPIBulkInsert.

◆ Close() [5/5]

virtual void IConnection::Close ( )
pure virtual

Close connecti.

Implemented in CConnection.

Referenced by CConnHolder::CloseRef().

◆ Complete()

virtual void IBulkInsert::Complete ( )
pure virtual

Complete batch.

Implemented in CDBAPIBulkInsert.

Referenced by CDbapiTest::Run(), and CBulkInsertImpl::~CBulkInsertImpl().

◆ Connect() [1/2]

virtual void IConnection::Connect ( const CDBConnParams params)
pure virtual

Connect to a database.

Parameters
paramsConnection parameters. Parameters should include all necessary settings because all info set via SetMode() or ResetMode() will be ignored.

Implemented in CConnection.

◆ Connect() [2/2]

virtual void IConnection::Connect ( const string user,
const string password,
const string server,
const string database = kEmptyStr 
)
pure virtual

Connect to a database.

Parameters
userUser name.
passwordUser's password.
serverServer to connect to.
databaseDatabase to connect to.

Implemented in CConnection.

Referenced by python::CConnection::MakeDBConnection().

◆ ConnectValidated()

virtual void IConnection::ConnectValidated ( IConnValidator validator,
const string user,
const string password,
const string server,
const string database = kEmptyStr 
)
pure virtual

Connect to a database using connect validator.

Parameters
validatorValidator implementation class.
userUser name.
passwordUser's password.
serverServer to connect to.
databaseDatabase to connect to.

Implemented in CConnection.

Referenced by CDbapiSimpleApp::SetupDb().

◆ CreateBulkInsert() [1/2]

virtual IBulkInsert* IConnection::CreateBulkInsert ( const string table_name)
pure virtual

Create bulk insert object.

Implemented in CConnection.

Referenced by IConnection::CreateBulkInsert().

◆ CreateBulkInsert() [2/2]

IBulkInsert* IConnection::CreateBulkInsert ( const string table_name,
unsigned int   
)
inline

Definition at line 922 of file dbapi.hpp.

References IConnection::CreateBulkInsert(), and table_name.

◆ CreateConnection()

virtual IConnection* IDataSource::CreateConnection ( EOwnership  ownership = eNoOwnership)
pure virtual

◆ CreateCursor() [1/3]

ICursor* IConnection::CreateCursor ( const string name,
const string sql 
)
inline

Definition at line 905 of file dbapi.hpp.

References IConnection::CreateCursor(), and sql.

◆ CreateCursor() [2/3]

virtual ICursor* IConnection::CreateCursor ( const string name,
const string sql,
int  batchSize 
)
pure virtual

Get cursor object.

Implemented in CConnection.

Referenced by IConnection::CreateCursor().

◆ CreateCursor() [3/3]

ICursor* IConnection::CreateCursor ( const string name,
const string sql,
int  ,
int  batchSize 
)
inline

Definition at line 911 of file dbapi.hpp.

References IConnection::CreateCursor(), and sql.

◆ CreateStatement()

virtual IStatement* IConnection::CreateStatement ( )
pure virtual

Get statement object for regular SQL queries.

Implemented in CConnection.

Referenced by CDbapiSimpleApp::DemoDynamicSql(), and CDbapiSimpleApp::DemoStaticSql().

◆ CSQLITE3_Cache() [1/2]

CSQLITE3_Cache::CSQLITE3_Cache ( )

Definition at line 385 of file sqlite_cache.cpp.

◆ CSQLITE3_Cache() [2/2]

CSQLITE3_Cache::CSQLITE3_Cache ( const CSQLITE3_Cache )
private

◆ CWriterThread() [1/2]

CSQLITE3_Cache::CWriterThread::CWriterThread ( const CWriterThread )
private

◆ CWriterThread() [2/2]

CSQLITE3_Cache::CWriterThread::CWriterThread ( CSQLITE3_Cache cache,
CSQLITE3_Cache::TWriteQueue write_q 
)

Definition at line 49 of file sqlite_cache.cpp.

◆ DBAPI_MakeTrans()

CAutoTrans::CSubject DBAPI_MakeTrans ( IConnection connection)
inline

Definition at line 1017 of file dbapi.hpp.

References IConnection::GetCDB_Connection().

◆ Delete()

virtual void ICursor::Delete ( const string table)
pure virtual

Delete statement for cursor.

Parameters
tabletable name.

Implemented in CCursor.

◆ DisableBind()

virtual void IResultSet::DisableBind ( bool  b)
pure virtual

Disables column binding.

Note
When binding is disabled all columns must be read with Read() method, GetVariant() method will always return NULL in this case.

False by default.

Parameters
Disablescolumn binding when set to true.

Implemented in CResultSet.

◆ Execute() [1/3]

virtual void ICallableStatement::Execute ( )
pure virtual

Execute stored procedure.

Implemented in CCallableStatement.

Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().

◆ Execute() [2/3]

void ICallableStatement::Execute ( const string sql)
protectedvirtual

Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql())

Parameters
sqlSQL statement to execute.
Deprecated:
Use SendSql() instead

Implements IStatement.

Reimplemented in CCallableStatement.

Definition at line 93 of file dbapi.cpp.

◆ Execute() [3/3]

virtual void IStatement::Execute ( const string sql)
pure virtual

Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql())

Parameters
sqlSQL statement to execute.
Deprecated:
Use SendSql() instead

Implemented in CStatement, CCallableStatement, and ICallableStatement.

◆ ExecuteLast()

virtual void IStatement::ExecuteLast ( )
pure virtual

Executes the last command (with changed parameters, if any).

Implemented in CStatement.

◆ ExecuteQuery() [1/2]

IResultSet * ICallableStatement::ExecuteQuery ( const string sql)
protectedvirtual

Exectues SQL statement and returns the first resultset.

If there is more than one resultset, the rest remain pending unless either PurgeResults() is called or next statement is run or the statement is closed. NOTE: Provided only for queries containing a single sql statement returning rows.

Parameters
sqlSQL statement to execute.
Returns
Pointer to result set. Ownership of IResultSet* belongs to IStatement. It is not allowed to use unique_ptr<> or other smart pointers to manage life-time of IResultSet*.

Implements IStatement.

Reimplemented in CCallableStatement.

Definition at line 105 of file dbapi.cpp.

◆ ExecuteQuery() [2/2]

virtual IResultSet* IStatement::ExecuteQuery ( const string sql)
pure virtual

Exectues SQL statement and returns the first resultset.

If there is more than one resultset, the rest remain pending unless either PurgeResults() is called or next statement is run or the statement is closed. NOTE: Provided only for queries containing a single sql statement returning rows.

Parameters
sqlSQL statement to execute.
Returns
Pointer to result set. Ownership of IResultSet* belongs to IStatement. It is not allowed to use unique_ptr<> or other smart pointers to manage life-time of IResultSet*.

Implemented in CStatement, CCallableStatement, and ICallableStatement.

◆ ExecuteUpdate() [1/3]

virtual void ICallableStatement::ExecuteUpdate ( )
pure virtual

Executes stored procedure no results returned.

NOTE: All resultsets are discarded.

Implemented in CCallableStatement.

◆ ExecuteUpdate() [2/3]

void ICallableStatement::ExecuteUpdate ( const string sql)
protectedvirtual

Executes SQL statement with no results returned.

All resultsets are discarded.

Parameters
sqlSQL statement to execute.

Implements IStatement.

Reimplemented in CCallableStatement.

Definition at line 97 of file dbapi.cpp.

◆ ExecuteUpdate() [3/3]

virtual void IStatement::ExecuteUpdate ( const string sql)
pure virtual

Executes SQL statement with no results returned.

All resultsets are discarded.

Parameters
sqlSQL statement to execute.

Implemented in CStatement, CCallableStatement, and ICallableStatement.

Referenced by python::CDMLConnPool::commit(), python::CDMLConnPool::Create(), and python::CDMLConnPool::rollback().

◆ Failed()

virtual bool IStatement::Failed ( )
pure virtual

Check if the statement failed.

Returns
Return true, if the statement failed.

Implemented in CStatement.

◆ ForceSingle()

virtual void IConnection::ForceSingle ( bool  enable)
pure virtual

Force single connection mode, default false.

Disable this mode before using BLOB output streams from IResultSet, because extra connection is needed in this case.

Implemented in CConnection.

◆ GetAccessTime()

time_t CSQLITE3_Cache::GetAccessTime ( const string key,
int  version,
const string subkey 
)
virtual

Return last access time for the specified cache entry.

Class implementation may want to implement access time based aging scheme for cache managed objects. In this case it needs to track time of every request to BLOB data.

Parameters
keyBLOB identification key
subkeyBLOB identification subkey
versionBLOB version
Returns
last access time
See also
TimeStampUpdatePolicy

Implements ICache.

Definition at line 996 of file sqlite_cache.cpp.

References Info(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, NCBI_CURRENT_FUNCTION, s_MakeKeyCondition(), sql, stmt, ncbi::grid::netcache::search::fields::subkey, and dtl::version.

◆ GetApplicationName()

string IDataSource::GetApplicationName ( void  ) const

◆ GetBlobAccess()

void CSQLITE3_Cache::GetBlobAccess ( const string key,
int  version,
const string subkey,
SBlobAccessDescr blob_descr 
)
virtual

◆ GetBlobIStream()

virtual CNcbiIstream& IResultSet::GetBlobIStream ( size_t  buf_size = 0)
pure virtual

Get Blob input stream.

Parameters
buf_sizebuf_size is the size of internal buffer, default 4096.

Implemented in CResultSet.

Referenced by CDbapiTest::Run().

◆ GetBlobOStream() [1/8]

CNcbiOstream & IStatement::GetBlobOStream ( I_BlobDescriptor d,
size_t  blob_size,
EAllowLog  log_it,
size_t  buf_size = 0 
)
virtual

Reimplemented in CStatement.

Definition at line 81 of file dbapi.cpp.

References eDisableLog, fBOS_SkipLogging, and IStatement::GetBlobOStream().

◆ GetBlobOStream() [2/8]

virtual CNcbiOstream& IStatement::GetBlobOStream ( I_BlobDescriptor d,
size_t  blob_size,
TBlobOStreamFlags  flags = 0,
size_t  buf_size = 0 
)
pure virtual

Get an ostream for writing BLOBs using previously created CDB_BlobDescriptor.

Parameters
dDescriptor
blob_sizeSize of BLOB to write
flags
See also
EBlobOStreamFlags.
Parameters
buf_sizeBuffer size, default 4096

Implemented in CStatement.

Referenced by CStatement::GetBlobOStream(), and IStatement::GetBlobOStream().

◆ GetBlobOStream() [3/8]

CNcbiOstream & IResultSet::GetBlobOStream ( IConnection conn,
size_t  blob_size,
EAllowLog  log_it,
size_t  buf_size = 0 
)
virtual

Reimplemented in CResultSet.

Definition at line 122 of file dbapi.cpp.

References conn, eDisableLog, fBOS_SkipLogging, and IResultSet::GetBlobOStream().

◆ GetBlobOStream() [4/8]

virtual CNcbiOstream& IResultSet::GetBlobOStream ( IConnection conn,
size_t  blob_size,
TBlobOStreamFlags  flags = 0,
size_t  buf_size = 0 
)
pure virtual

Get Blob output stream with explicit additional connection.

Parameters
connaddtional connection used for writing blob (the above method clones the existing connection implicitly)
blob_sizeblob_size is the size of the BLOB to be written.
flags
See also
EBlobOStreamFlags.
Parameters
buf_sizeThe size of internal buffer, default 4096.
Deprecated:
Please use IStatement::GetBlobOStream instead.
See also
IStatement::GetBlobOStream

Implemented in CResultSet.

◆ GetBlobOStream() [5/8]

CNcbiOstream & IResultSet::GetBlobOStream ( size_t  blob_size,
EAllowLog  log_it,
size_t  buf_size = 0 
)
virtual

Reimplemented in CResultSet.

Definition at line 114 of file dbapi.cpp.

References eDisableLog, fBOS_SkipLogging, and IResultSet::GetBlobOStream().

◆ GetBlobOStream() [6/8]

virtual CNcbiOstream& IResultSet::GetBlobOStream ( size_t  blob_size,
TBlobOStreamFlags  flags = 0,
size_t  buf_size = 0 
)
pure virtual

Get Blob output stream.

The existing connection is cloned for writing blob.

Parameters
blob_sizeblob_size is the size of the BLOB to be written.
flags
See also
EBlobOStreamFlags.
Parameters
buf_sizeThe size of internal buffer, default 4096.
Deprecated:
Please use IStatement::GetBlobOStream instead.
See also
IStatement::GetBlobOStream

Implemented in CResultSet.

Referenced by CResultSet::GetBlobOStream(), IResultSet::GetBlobOStream(), and CDbapiTest::Run().

◆ GetBlobOStream() [7/8]

CNcbiOstream & ICursor::GetBlobOStream ( unsigned int  col,
size_t  blob_size,
EAllowLog  log_it,
size_t  buf_size = 0 
)
virtual

Reimplemented in CCursor.

Definition at line 152 of file dbapi.cpp.

References eDisableLog, fBOS_SkipLogging, and ICursor::GetBlobOStream().

◆ GetBlobOStream() [8/8]

virtual CNcbiOstream& ICursor::GetBlobOStream ( unsigned int  col,
size_t  blob_size,
TBlobOStreamFlags  flags = 0,
size_t  buf_size = 0 
)
pure virtual

Get output stream for BLOB updates, requires BLOB column number.

Parameters
colColumn number.
blob_sizeblob_size is the size of the BLOB to be written.
flags
See also
EBlobOStreamFlags.
Parameters
buf_sizeThe size of internal buffer, default 4096.
Deprecated:
Please use IStatement::GetBlobOStream instead.
See also
IStatement::GetBlobOStream

Implemented in CCursor.

Referenced by CCursor::GetBlobOStream(), and ICursor::GetBlobOStream().

◆ GetBlobOwner()

void CSQLITE3_Cache::GetBlobOwner ( const string key,
int  version,
const string subkey,
string owner 
)
virtual

Retrieve BLOB owner.

Parameters
ownerBLOB owner (as used by method Store)
See also
Store, GetWriteStream

Implements ICache.

Definition at line 1219 of file sqlite_cache.cpp.

References _ASSERT, Info(), LOG_POST, and NCBI_CURRENT_FUNCTION.

◆ GetBlobReader()

virtual IReader* IResultSet::GetBlobReader ( )
pure virtual

Get a Blob Reader.

Parameters
Pointerto the Blob Reader.

Implemented in CResultSet.

Referenced by CDbapiTest::Run().

◆ GetBlobWriter() [1/4]

IWriter * IStatement::GetBlobWriter ( I_BlobDescriptor d,
size_t  blob_size,
EAllowLog  log_it 
)
virtual

Reimplemented in CStatement.

Definition at line 74 of file dbapi.cpp.

References eDisableLog, fBOS_SkipLogging, and IStatement::GetBlobWriter().

◆ GetBlobWriter() [2/4]

virtual IWriter* IStatement::GetBlobWriter ( I_BlobDescriptor d,
size_t  blob_size,
TBlobOStreamFlags  flags = 0 
)
pure virtual

Get a writer for writing BLOBs using previously created CDB_BlobDescriptor.

Parameters
dDescriptor
blob_sizeSize of BLOB to write
flags
See also
EBlobOStreamFlags.

Implemented in CStatement.

Referenced by IStatement::GetBlobWriter(), and CStatement::GetBlobWriter().

◆ GetBlobWriter() [3/4]

IWriter * ICursor::GetBlobWriter ( unsigned int  col,
size_t  blob_size,
EAllowLog  log_it 
)
virtual

Reimplemented in CCursor.

Definition at line 160 of file dbapi.cpp.

References eDisableLog, fBOS_SkipLogging, and ICursor::GetBlobWriter().

◆ GetBlobWriter() [4/4]

virtual IWriter* ICursor::GetBlobWriter ( unsigned int  col,
size_t  blob_size,
TBlobOStreamFlags  flags = 0 
)
pure virtual

Get Blob Writer.

Implementation of IWriter interface

Parameters
colColumn number.
blob_sizeblob_size is the size of the BLOB to be written.
flags
See also
EBlobOStreamFlags.
Deprecated:
Please use IStatement::GetBlobWriter instead.
See also
IStatement::GetBlobWriter

Implemented in CCursor.

Referenced by ICursor::GetBlobWriter(), and CCursor::GetBlobWriter().

◆ GetBulkInsert() [1/2]

virtual IBulkInsert* IConnection::GetBulkInsert ( const string table_name)
pure virtual

Create bulk insert object.

Parameters
table_nametable name.
nof_colsNumber of columns.

Implemented in CConnection.

Referenced by CBulkInsertImpl::CBulkInsertImpl(), and IConnection::GetBulkInsert().

◆ GetBulkInsert() [2/2]

IBulkInsert* IConnection::GetBulkInsert ( const string table_name,
unsigned int   
)
inline

Definition at line 883 of file dbapi.hpp.

References IConnection::GetBulkInsert(), and table_name.

◆ GetCacheName()

string CSQLITE3_Cache::GetCacheName ( void  ) const
virtual

Implements ICache.

Definition at line 630 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_Database.

◆ GetCallableStatement() [1/2]

virtual ICallableStatement* IConnection::GetCallableStatement ( const string proc)
pure virtual

Get callable statement object for stored procedures.

Parameters
procStored procedure name.
nofArgsNumber of arguments.

Implemented in CConnection.

Referenced by python::CCallableStmtHelper::CreateStmt(), CDbapiSimpleApp::DemoStoredProc(), CQueryImpl::ExecuteSP(), and IConnection::GetCallableStatement().

◆ GetCallableStatement() [2/2]

ICallableStatement* IConnection::GetCallableStatement ( const string proc,
int   
)
inline

Definition at line 852 of file dbapi.hpp.

References IConnection::GetCallableStatement(), and proc.

◆ GetCancelTimeout()

size_t IConnection::GetCancelTimeout ( void  ) const
virtual

Get timeout for command cancellation and connection closing.

Definition at line 64 of file dbapi.cpp.

References CDB_Connection::GetCancelTimeout(), and IConnection::GetCDB_Connection().

◆ GetCDB_Connection()

virtual CDB_Connection* IConnection::GetCDB_Connection ( )
pure virtual

◆ GetColumnNo()

virtual int IResultSet::GetColumnNo ( )
pure virtual

Get column number, currently available for Read()

Returns
Returns current item number we can retrieve (1,2,...) using Read() Returns "0" if no more items left (or available) to read

Implemented in CResultSet.

◆ GetCursor() [1/3]

ICursor* IConnection::GetCursor ( const string name,
const string sql 
)
inline

Definition at line 861 of file dbapi.hpp.

References IConnection::GetCursor(), and sql.

◆ GetCursor() [2/3]

virtual ICursor* IConnection::GetCursor ( const string name,
const string sql,
int  batchSize 
)
pure virtual

Get cursor object.

Implemented in CConnection.

Referenced by IConnection::GetCursor().

◆ GetCursor() [3/3]

ICursor* IConnection::GetCursor ( const string name,
const string sql,
int  ,
int  batchSize 
)
inline

Definition at line 867 of file dbapi.hpp.

References IConnection::GetCursor(), and sql.

◆ GetDatabase() [1/2]

const string& CSQLITE3_Cache::GetDatabase ( void  ) const
inline

Get DB name/path.

Definition at line 237 of file sqlite_cache.hpp.

References CSQLITE3_Cache::m_Database.

◆ GetDatabase() [2/2]

virtual string IConnection::GetDatabase ( )
pure virtual

Get current database.

Implemented in CConnection.

◆ GetDataSource()

virtual IDataSource* IConnection::GetDataSource ( )
pure virtual

Get parent datasource object.

Implemented in CConnection.

◆ GetDirection()

virtual CDBParams::EDirection IResultSetMetaData::GetDirection ( const CDBParamVariant param) const
pure virtual

Get parameter's direction (in/out/inout).

Parameters
paramColumn number or name

Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.

◆ GetDriverContext() [1/2]

virtual const I_DriverContext* IDataSource::GetDriverContext ( ) const
pure virtual

Implemented in CDataSource.

◆ GetDriverContext() [2/2]

virtual I_DriverContext* IDataSource::GetDriverContext ( )
pure virtual

◆ GetErrCodeString()

const char * CSQLITE3_ICacheException::GetErrCodeString ( void  ) const
overridevirtual

Get error code interpreted as text.

Reimplemented from CException.

Definition at line 372 of file sqlite_cache.cpp.

References eUnknown, and CException::GetErrCodeString().

◆ GetErrorAsEx() [1/2]

virtual CDB_MultiEx* IConnection::GetErrorAsEx ( )
pure virtual

Returns all error messages as a CDB_MultiEx object.

Implemented in CConnection.

◆ GetErrorAsEx() [2/2]

virtual CDB_MultiEx* IDataSource::GetErrorAsEx ( )
pure virtual

Returns all server messages as a CDB_MultiEx object.

Implemented in CDataSource.

◆ GetErrorInfo() [1/2]

virtual string IConnection::GetErrorInfo ( )
pure virtual

Returns all error messages as a single string.

Implemented in CConnection.

◆ GetErrorInfo() [2/2]

virtual string IDataSource::GetErrorInfo ( )
pure virtual

Returns all server messages as a single string.

Implemented in CDataSource.

Referenced by CDbapiSimpleApp::DemoStoredProc(), and CDbapiTest::Run().

◆ GetFlags()

virtual TFlags CSQLITE3_Cache::GetFlags ( )
inlinevirtual

Retrieve the effective combination of flags from the underlying storage.

Implements ICache.

Definition at line 225 of file sqlite_cache.hpp.

◆ GetMaxSize()

virtual int IResultSetMetaData::GetMaxSize ( const CDBParamVariant param) const
pure virtual

Get maximum size in bytes for column.

Parameters
colColumn number
Returns
Max number of bytes needed to hold the returned data.

Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.

◆ GetMemBufferSize()

unsigned CSQLITE3_Cache::GetMemBufferSize ( ) const
Returns
Size of the intermediate BLOB memory buffer

◆ GetMetaData()

virtual const IResultSetMetaData* IResultSet::GetMetaData ( EOwnership  ownership = eNoOwnership)
pure virtual

Get Metadata.

Returns
Pointer to result metadata.

Implemented in CResultSet.

Referenced by CQueryImpl::GetColumnType(), python::CRealResultSet::GetMetaData(), CQueryImpl::HasMoreResultSets(), and CQuery::CRow::x_Reset().

◆ GetModeMask()

virtual unsigned int IConnection::GetModeMask ( )
pure virtual

Get mode mask.

Implemented in CConnection.

◆ GetName()

virtual string IResultSetMetaData::GetName ( const CDBParamVariant param) const
pure virtual

◆ GetParamsMetaData()

virtual const IResultSetMetaData& IStatement::GetParamsMetaData ( void  )
pure virtual

Get input parameters metadata.

Returns
Pointer to result metadata.

Implemented in CStatement.

◆ GetParentConn() [1/2]

virtual class IConnection* IStatement::GetParentConn ( )
pure virtual

Get the parent connection.

If the original connections was cloned, returns cloned connection.

Implemented in CStatement.

◆ GetParentConn() [2/2]

virtual class IConnection* ICursor::GetParentConn ( )
pure virtual

Get the parent connection.

NOTE: If the original connections was cloned, returns cloned connection.

Implemented in CCursor.

◆ GetReadStream() [1/2]

IReader * CSQLITE3_Cache::GetReadStream ( const string key,
const string subkey,
int version,
EBlobVersionValidity validity 
)
virtual

Request the latest version of a BLOB.

Parameters
[in]keyBLOB identification key
[in]subkeyBLOB identification subkey
[out]versionVersion of the returned BLOB
[out]validityValidity of the version of the returned BLOB
Returns
Sequential stream interface to read BLOB data. Return NULL if the BLOB data is not found in the cache.
Note
If the BLOB data is not found in the cache, then neither 'version' nor 'validity' values will be set by the method.
See also
SetCurrentBlobVersion()

Implements ICache.

Definition at line 873 of file sqlite_cache.cpp.

References NCBI_THROW.

◆ GetReadStream() [2/2]

IReader * CSQLITE3_Cache::GetReadStream ( const string key,
int  version,
const string subkey 
)
virtual

Return sequential stream interface to read BLOB data.

Parameters
keyBLOB identification key
subkeyBLOB identification subkey
versionBLOB version
Returns
Interface pointer or NULL if BLOB does not exist

Implements ICache.

Definition at line 835 of file sqlite_cache.cpp.

References ICache::fTimeStampOnRead, GetBlobReader(), ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Stmt_GetReadStream, CSQLITE3_Cache::m_TimeStampFlag, NULL, sql, ncbi::grid::netcache::search::fields::subkey, dtl::version, and CSQLITE3_Cache::x_SetTimestamp().

◆ GetResultSet()

virtual IResultSet* IStatement::GetResultSet ( )
pure virtual

Get resulset.

Returns
Pointer to resultset. For statements with no resultset return 0.

Implemented in CStatement.

Referenced by python::CRealSetProxy::DumpResult(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().

◆ GetResultType()

virtual EDB_ResType IResultSet::GetResultType ( )
pure virtual

◆ GetReturnStatus()

virtual int ICallableStatement::GetReturnStatus ( )
pure virtual

Get return status from the stored procedure.

Implemented in CCallableStatement.

Referenced by CQueryImpl::HasMoreResultSets(), and CDbapiTest::Run().

◆ GetRowCount()

virtual int IStatement::GetRowCount ( )
pure virtual

Get total of rows returned.

Valid only after all rows are retrieved from a resultset. Even then, can be -1 if the server didn't indicate a count.

Implemented in CStatement.

◆ GetSize()

size_t CSQLITE3_Cache::GetSize ( const string key,
int  version,
const string subkey 
)
virtual

Check if BLOB exists, return BLOB size.

Parameters
keyBLOB identification key
subkeyBLOB identification subkey
versionBLOB version
Returns
BLOB size or 0 if it doesn't exist or expired

Implements ICache.

Definition at line 788 of file sqlite_cache.cpp.

References Info(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, NCBI_CURRENT_FUNCTION, s_MakeKeyCondition(), sql, stmt, ncbi::grid::netcache::search::fields::subkey, and dtl::version.

◆ GetStatement()

virtual IStatement* IConnection::GetStatement ( )
pure virtual

Get statement object for regular SQL queries.

Implemented in CConnection.

Referenced by CQueryImpl::CQueryImpl(), python::CStmtHelper::CreateStmt(), and CDbapiSimpleApp::DemoParamerizedSql().

◆ GetTimeout() [1/2]

int CSQLITE3_Cache::GetTimeout ( ) const
virtual

Get expiration timeout.

Returns
Expiration timeout in seconds
See also
SetTimeStampPolicy

Implements ICache.

Definition at line 660 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_Timeout.

Referenced by CSQLITE3_Cache::GetBlobAccess(), and CSQLITE3_Cache::Purge().

◆ GetTimeout() [2/2]

size_t IConnection::GetTimeout ( void  ) const
virtual

Get connection timeout.

Definition at line 59 of file dbapi.cpp.

References IConnection::GetCDB_Connection(), and CDB_Connection::GetTimeout().

◆ GetTimeStampPolicy()

CSQLITE3_Cache::TTimeStampFlags CSQLITE3_Cache::GetTimeStampPolicy ( ) const
virtual

Get timestamp policy.

Returns
Timestamp policy

Implements ICache.

Definition at line 653 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_TimeStampFlag.

◆ GetTotalColumns() [1/2]

virtual unsigned int IResultSet::GetTotalColumns ( )
pure virtual

Get total columns.

Returns
Returns total number of columns in the resultset

Implemented in CResultSet.

Referenced by python::CRealResultSet::GetTotalColumns(), CQueryImpl::HasMoreResultSets(), python::MakeTupleFromResult(), and CQuery::CRow::x_Reset().

◆ GetTotalColumns() [2/2]

virtual unsigned int IResultSetMetaData::GetTotalColumns ( void  ) const
pure virtual

Get total number of columns in resultset.

Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.

Referenced by IResultSetMetaData::HasColumn(), CDbapiSimpleApp::RetrieveData(), and CDbapiTest::Run().

◆ GetType()

virtual EDB_Type IResultSetMetaData::GetType ( const CDBParamVariant param) const
pure virtual

Get data type for column in the resultset.

Parameters
paramColumn number or name

Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.

Referenced by CQueryImpl::GetColumnType(), CDbapiTest::Run(), and CQuery::CRow::x_Reset().

◆ GetVariant()

virtual const CVariant& IResultSet::GetVariant ( const CDBParamVariant param)
pure virtual

Retrieve a CVariant class describing the data stored in a given column.

Note that the index supplied is one-based, not zero-based; the first column is column 1.

Parameters
paramColumn number (one-based) or name
Returns
All data (for BLOB data see below) is returned as CVariant.

Implemented in CResultSet.

Referenced by python::CCachedResultSet::CCachedResultSet(), CQueryImpl::GetFieldValue(), python::CRealResultSet::GetVariant(), CQueryImpl::HasMoreResultSets(), python::MakeTupleFromResult(), and CDbapiTest::Run().

◆ GetVersionInfo()

virtual const CVersionInfo& IConnection::GetVersionInfo ( ) const
pure virtual

Implemented in CConnection.

Referenced by CDatabase::GetDriverVersion().

◆ GetVersionRetention()

CSQLITE3_Cache::EKeepVersions CSQLITE3_Cache::GetVersionRetention ( ) const
virtual

Get version retention.

Implements ICache.

Definition at line 674 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_VersionFlag.

◆ GetWriteStream()

IWriter * CSQLITE3_Cache::GetWriteStream ( const string key,
int  version,
const string subkey,
unsigned int  time_to_live = 0,
const string owner = kEmptyStr 
)
virtual

Specifics of this IWriter implementation is that IWriter::Flush here cannot be called twice, because it finalises transaction Also you cannot call Write after Flush...

All this is because MSSQL (and Sybase) wants to know exact BLOB size before writing it to the database Effectively IWriter::Flush in this case works as "Close"...

Implements ICache.

Definition at line 898 of file sqlite_cache.cpp.

References buf, count, eRW_Error, eRW_Success, ncbi::grid::netcache::search::fields::key, ncbi::grid::netcache::search::fields::subkey, dtl::version, and Write().

◆ HasBlobs()

bool CSQLITE3_Cache::HasBlobs ( const string key,
const string subkey 
)
virtual

◆ HasColumn()

bool IResultSetMetaData::HasColumn ( const CDBParamVariant param) const

Convenience method to check whether a column with a given name (or number) actually exists.

Definition at line 134 of file dbapi.cpp.

References IResultSetMetaData::GetName(), CDBParamVariant::GetName(), CDBParamVariant::GetPosition(), IResultSetMetaData::GetTotalColumns(), i, CDBParamVariant::IsPositional(), and n.

◆ HasMoreResults()

virtual bool IStatement::HasMoreResults ( )
pure virtual

Check for more results available.

Each call advances to the next result and the current one will be cancelled it not retrieved before next call. The amount of retured results may be bigger than the expected amount due to auxiliary results returned depending on the driver and server platform.

Returns
Return true, if there are more results available.

Implemented in CStatement, and CCallableStatement.

Referenced by python::CRealSetProxy::DumpResult(), CQueryImpl::IsFinished(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().

◆ HasRows()

virtual bool IStatement::HasRows ( )
pure virtual

Check if resultset has rows.

Returns
Return true, if resultset has rows.

Implemented in CStatement.

Referenced by python::CRealSetProxy::DumpResult(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().

◆ IsAlive()

virtual bool IConnection::IsAlive ( )
pure virtual

Check if the connection is alive.

Implemented in CConnection.

◆ IsAutoClearInParams()

virtual bool IStatement::IsAutoClearInParams ( void  ) const
pure virtual

Get auto-clear input parameter flag value.

Returns
auto-clear input parameter flag value

Implemented in CStatement.

◆ IsOpen()

bool CSQLITE3_Cache::IsOpen ( ) const
virtual
Returns
TRUE if cache is open and operational

Implements ICache.

Definition at line 623 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_DB, and NULL.

◆ Main()

void * CSQLITE3_Cache::CWriterThread::Main ( )
virtual

Derived (user-created) class must provide a real thread function.

Implements CThread.

Definition at line 64 of file sqlite_cache.cpp.

References done, Error(), Info(), LOG_POST, CSQLITE3_Cache::m_WriteQueue, NULL, and CSyncQueue< Type, Container, Traits >::Pop().

◆ MsgToEx()

virtual void IConnection::MsgToEx ( bool  v)
pure virtual

If enabled, redirects all error messages to CDB_MultiEx object (see below).

Implemented in CConnection.

◆ NCBI_EXCEPTION_DEFAULT()

CSQLITE3_ICacheException::NCBI_EXCEPTION_DEFAULT ( CSQLITE3_ICacheException  ,
CException   
)

◆ Next()

virtual bool IResultSet::Next ( )
pure virtual

◆ Open() [1/2]

virtual IResultSet* ICursor::Open ( )
pure virtual

Open cursor and get corresponding resultset.

Implemented in CCursor.

Referenced by CDbapiTest::Run().

◆ Open() [2/2]

void CSQLITE3_Cache::Open ( const string database,
bool  remove = false 
)

Open cache.

Does not take IConnection ownership. Connection should be already logged into the destination server

Implementation uses temporary files to keep local BLOBs. If you temp directory is not specified system default is used

Parameters
databaseDB name with path
removeDelete the database first?

Definition at line 474 of file sqlite_cache.cpp.

References CDir::Create(), database, CStopWatch::Elapsed(), Error(), edirect::Execute(), CDir::Exists(), Info(), LOG_POST, CSQLITE3_Cache::m_Database, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_WriteQueue, CSQLITE3_Cache::m_WriterThread, msg(), NCBI_CURRENT_FUNCTION, NCBI_THROW, NULL, remove(), CDirEntry::Remove(), CDirEntry::SplitPath(), CStopWatch::Start(), stmt, and sw.

◆ operator=() [1/2]

CSQLITE3_Cache& CSQLITE3_Cache::operator= ( const CSQLITE3_Cache )
private

◆ operator=() [2/2]

CWriterThread& CSQLITE3_Cache::CWriterThread::operator= ( const CWriterThread )
private

◆ PrepareCall() [1/2]

virtual ICallableStatement* IConnection::PrepareCall ( const string proc)
pure virtual

Get callable statement object for stored procedures.

Implemented in CConnection.

Referenced by IConnection::PrepareCall().

◆ PrepareCall() [2/2]

ICallableStatement* IConnection::PrepareCall ( const string proc,
int   
)
inline

Definition at line 896 of file dbapi.hpp.

References IConnection::PrepareCall(), and proc.

◆ Purge() [1/2]

void CSQLITE3_Cache::Purge ( const string key,
const string subkey,
time_t  access_timeout 
)
virtual

Delete BLOBs with access time older than specified.

Function finds all BLOB versions with the specified key and removes the old instances.

Parameters
keyBLOB key
subkeyBLOB identification subkey
access_timeoutTime in seconds. All objects older than this are deleted.

Implements ICache.

Definition at line 1038 of file sqlite_cache.cpp.

References count, CTime::eCurrent, CSQLITE3_Cache::GetTimeout(), CTime::GetTimeT(), Info(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, NCBI_CURRENT_FUNCTION, sql, stmt, and ncbi::grid::netcache::search::fields::subkey.

◆ Purge() [2/2]

void CSQLITE3_Cache::Purge ( time_t  access_timeout)
virtual

Delete all BLOBs older than specified.

Parameters
access_timeoutTime in seconds. All objects older than this are deleted.

Implements ICache.

Definition at line 1013 of file sqlite_cache.cpp.

References count, CTime::eCurrent, CSQLITE3_Cache::GetTimeout(), CTime::GetTimeT(), Info(), LOG_POST, CSQLITE3_Cache::m_DB, NCBI_CURRENT_FUNCTION, sql, and stmt.

Referenced by CSQLITE3_Cache::StoreSynchronous().

◆ PurgeResults()

virtual void IStatement::PurgeResults ( )
pure virtual

Purge results.

Calls fetch for every resultset received until finished.

Implemented in CStatement.

Referenced by CQueryImpl::x_Close().

◆ Read() [1/2]

bool CSQLITE3_Cache::Read ( const string key,
int  version,
const string subkey,
void *  buf,
size_t  buf_size 
)
virtual

Fetch the BLOB.

Parameters
keyBLOB identification key
subkeyBLOB identification subkey
versionBLOB version
bufpointer on destination buffer
sizebuffer size in bytes (chars)
Returns
FALSE if BLOB doesn't exist or expired
Note
Throws an exception if provided memory buffer is insufficient to read the BLOB

Implements ICache.

Definition at line 805 of file sqlite_cache.cpp.

References buf, ICache::fTimeStampOnRead, Info(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_TimeStampFlag, min(), NCBI_CURRENT_FUNCTION, s_MakeKeyCondition(), ncbi::grid::netcache::search::fields::size, sql, stmt, ncbi::grid::netcache::search::fields::subkey, dtl::version, and CSQLITE3_Cache::x_SetTimestamp().

◆ Read() [2/2]

virtual size_t IResultSet::Read ( void *  buf,
size_t  size 
)
pure virtual

Read unformatted data.

Reads unformatted data, returns bytes actually read. Advances to next column as soon as data is read from the previous one. Returns 0 when the column data is fully read Valid only when the column binding is off (see DisableBind())

Parameters
bufBuffer to read data.
sizeAmount of data to read.
Returns
Actual number of bytes read.

Implemented in CResultSet.

◆ Remove() [1/2]

void CSQLITE3_Cache::Remove ( const string key)
virtual

◆ Remove() [2/2]

void CSQLITE3_Cache::Remove ( const string key,
int  version,
const string subkey 
)
virtual

Remove specific cache entry.

Parameters
keyBLOB identification key
subkeyBLOB identification subkey
versionBLOB version

Implements ICache.

Definition at line 982 of file sqlite_cache.cpp.

References ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_DB, s_MakeKeyCondition(), sql, stmt, ncbi::grid::netcache::search::fields::subkey, and dtl::version.

◆ ResetMode()

virtual void IConnection::ResetMode ( EConnMode  mode)
pure virtual

Reset connection mode.

Parameters
modeMode to reset to.

Implemented in CConnection.

◆ SameCacheParams()

bool CSQLITE3_Cache::SameCacheParams ( const TCacheParams params) const
virtual

◆ SendSql() [1/2]

void ICallableStatement::SendSql ( const string sql)
protectedvirtual

Sends one or more SQL statements to the SQL server.

Parameters
sqlSQL statement to execute.

Implements IStatement.

Reimplemented in CCallableStatement.

Definition at line 101 of file dbapi.cpp.

◆ SendSql() [2/2]

virtual void IStatement::SendSql ( const string sql)
pure virtual

Sends one or more SQL statements to the SQL server.

Parameters
sqlSQL statement to execute.

Implemented in CStatement, CCallableStatement, and ICallableStatement.

Referenced by CQueryImpl::Execute().

◆ SetApplicationName()

void IDataSource::SetApplicationName ( const string app_name)

◆ SetAutoClearInParams()

virtual void IStatement::SetAutoClearInParams ( bool  flag = true)
pure virtual

Set auto-clear input parameter flag.

Parameters
flagauto-clear input parameter flag In case when flag == true implicitly clear a statement's parameter list after each Execute, ExecuteUpdate and ExecuteQuery call. Default value

Implemented in CStatement.

◆ SetBlobVersionAsValid()

void CSQLITE3_Cache::SetBlobVersionAsValid ( const string key,
const string subkey,
int  version 
)
virtual

Definition at line 886 of file sqlite_cache.cpp.

References NCBI_THROW.

◆ SetCancelTimeout()

virtual void IConnection::SetCancelTimeout ( size_t  )
inlinevirtual

Set timeout for command cancellation and connection closing.

Reimplemented in CConnection.

Definition at line 939 of file dbapi.hpp.

◆ SetDatabase()

virtual void IConnection::SetDatabase ( const string name)
pure virtual

Set current database.

Parameters
nameName of database to set to.

Implemented in CConnection.

◆ SetFlags()

virtual void CSQLITE3_Cache::SetFlags ( TFlags  flags)
inlinevirtual

Pass flags to the underlying storage.

Implements ICache.

Definition at line 226 of file sqlite_cache.hpp.

◆ SetHints()

virtual void IBulkInsert::SetHints ( CTempString  hints)
pure virtual

Set hints by one call. Resets everything that was set by Add*Hint().

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::SetHints().

◆ SetLoginTimeout()

virtual void IDataSource::SetLoginTimeout ( unsigned int  i)
pure virtual

Set login timeout.

Implemented in CDataSource.

◆ SetLogStream()

virtual void IDataSource::SetLogStream ( ostream *  out)
pure virtual

Set the output stream for server messages.

Set it to zero to disable any output and collect messages in CDB_MultiEx (see below).

Parameters
outOutput stream to set to.

Referenced by CDbapiSimpleApp::SetupDb().

◆ SetMemBufferSize()

void CSQLITE3_Cache::SetMemBufferSize ( unsigned int  buf_size)

Set size of the intermidiate BLOB memory buffer.

Definition at line 1229 of file sqlite_cache.cpp.

◆ SetMode()

virtual void IConnection::SetMode ( EConnMode  mode)
pure virtual

Set connection mode.

Parameters
modeMode to set to.

Implemented in CConnection.

◆ SetOutputParam()

virtual void ICallableStatement::SetOutputParam ( const CVariant v,
const CDBParamVariant param 
)
pure virtual

Set output parameter, which will be returned as resultset.

NOTE: Use CVariant(EDB_Type type) constructor or factory method CVariant::<type>(0) to create empty object of a particular type.

Parameters
vParameter value.
nameParameter name.

Implemented in CCallableStatement.

Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().

◆ SetParam() [1/3]

virtual void IStatement::SetParam ( const CVariant v,
const CDBParamVariant param 
)
pure virtual

Set input/output parameter.

Parameters
vParameter value.
nameParameter name.

Implemented in ICallableStatement, CStatement, and CCallableStatement.

Referenced by CQueryImpl::Execute().

◆ SetParam() [2/3]

virtual void ICallableStatement::SetParam ( const CVariant v,
const CDBParamVariant param 
)
pure virtual

Set input parameters.

Parameters
vParameter value.
nameParameter name.

Implements IStatement.

Implemented in CCallableStatement.

Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().

◆ SetParam() [3/3]

virtual void ICursor::SetParam ( const CVariant v,
const CDBParamVariant param 
)
pure virtual

Set input parameter.

Parameters
vParameter value.
nameParameter name.

Implemented in CCursor.

◆ SetTimeout()

virtual void IConnection::SetTimeout ( size_t  nof_secs)
pure virtual

Set connection timeout.

NOTE: if "nof_secs" is zero or is "too big" (depends on the underlying DB API), then set the timeout to infinite.

Implemented in CConnection.

Referenced by CConnHolder::ResetTimeout(), and CConnHolder::SetTimeout().

◆ SetTimeStampPolicy()

void CSQLITE3_Cache::SetTimeStampPolicy ( TTimeStampFlags  policy,
unsigned int  timeout,
unsigned int  max_timeout = 0 
)
virtual

Set timestamp update policy.

Parameters
policyA bitwise combination of "ETimeStampFlags".
timeoutDefault expiration timeout for the stored BLOBs.
max_timeoutMaximum value for individually set BLOB timeouts. If "max_timeout" < "timeout", then it 'll be set to "timeout".

Implements ICache.

Definition at line 637 of file sqlite_cache.cpp.

References CSQLITE3_Cache::kDefaultTimestampPolicy, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Timeout, and CSQLITE3_Cache::m_TimeStampFlag.

◆ SetVersionRetention()

void CSQLITE3_Cache::SetVersionRetention ( EKeepVersions  policy)
virtual

Set version retention policy.

Parameters
policyVersion retention mode

Implements ICache.

Definition at line 667 of file sqlite_cache.cpp.

References CSQLITE3_Cache::m_VersionFlag.

◆ SQLITE3_Register_Cache()

void SQLITE3_Register_Cache ( void  )

Register NCBI_EntryPoint_SQLITE3_BlobCache.

Definition at line 168 of file sqlite_cache_factory.cpp.

References NCBI_EntryPoint_SQLITE3_BlobCache().

◆ Stop()

void CSQLITE3_Cache::CWriterThread::Stop ( void  )

Queue a request to stop the background writer Asyncronous! Thread may not stop yet when it gets back from this call.

Definition at line 57 of file sqlite_cache.cpp.

References Info(), LOG_POST, CSQLITE3_Cache::m_WriteQueue, and CSyncQueue< Type, Container, Traits >::Push().

◆ Store()

void CSQLITE3_Cache::Store ( const string key,
int  version,
const string subkey,
const void *  data,
size_t  size,
unsigned int  time_to_live = 0,
const string owner = kEmptyStr 
)
virtual

Add or replace BLOB.

Parameters
keyBLOB identification key
keyBLOB identification sub-key
versionBLOB version
datapointer on data buffer
sizedata buffer size in bytes (chars)
time_to_liveIndividual timeout. Cannot exceed max timeout.

Implements ICache.

Definition at line 716 of file sqlite_cache.cpp.

References data, ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_WriteQueue, CSyncQueue< Type, Container, Traits >::Push(), ncbi::grid::netcache::search::fields::size, ncbi::grid::netcache::search::fields::subkey, and dtl::version.

◆ StoreBatch()

virtual void IBulkInsert::StoreBatch ( )
pure virtual

Store batch of rows.

Implemented in CDBAPIBulkInsert.

Referenced by CBulkInsertImpl::EndRow().

◆ StoreSynchronous()

void CSQLITE3_Cache::StoreSynchronous ( const string key,
int  version,
const string subkey,
const void *  data,
size_t  size 
)

◆ Update()

virtual void ICursor::Update ( const string table,
const string updateSql 
)
pure virtual

Update statement for cursor.

Parameters
tabletable name.
updateSqlSQL statement.

Implemented in CCursor.

Referenced by CDbapiTest::Run().

◆ Vacuum()

bool CSQLITE3_Cache::Vacuum ( )

Vacuum the database (should be open first)

Returns
true if success

Definition at line 461 of file sqlite_cache.cpp.

References LOG_POST, CSQLITE3_Cache::m_Database, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, stmt, and Warning().

◆ WasNull()

virtual bool IResultSet::WasNull ( )
pure virtual

Determine if last column was NULL.

Valid only when the column binding is off.

Returns
Return true if the last column read was NULL.
See also
DisableBind().

Implemented in CResultSet.

◆ x_SetTimestamp()

void CSQLITE3_Cache::x_SetTimestamp ( const string key,
int  version,
const string subkey 
)
private

◆ ~CSQLITE3_Cache()

CSQLITE3_Cache::~CSQLITE3_Cache ( )
virtual

◆ ~IBulkInsert()

IBulkInsert::~IBulkInsert ( )
virtual

Destructor.

Definition at line 167 of file dbapi.cpp.

◆ ~ICallableStatement()

ICallableStatement::~ICallableStatement ( )
virtual

Destructor.

Definition at line 89 of file dbapi.cpp.

◆ ~IConnection()

IConnection::~IConnection ( )
virtual

Destructor.

Definition at line 55 of file dbapi.cpp.

◆ ~ICursor()

ICursor::~ICursor ( )
virtual

Destructor.

Definition at line 148 of file dbapi.cpp.

◆ ~IDataSource()

IDataSource::~IDataSource ( )
protectedvirtual

Protected Destructor.

Prohibits explicit deletion. Use CDriverManager::DestroyDs() call, instead.

Definition at line 39 of file dbapi.cpp.

◆ ~IResultSet()

IResultSet::~IResultSet ( )
virtual

Destructor.

Clean up the resultset.

Definition at line 110 of file dbapi.cpp.

◆ ~IResultSetMetaData()

IResultSetMetaData::~IResultSetMetaData ( void  )
virtual

Destructor.

Clean up the metadata for the resultset.

Definition at line 130 of file dbapi.cpp.

◆ ~IStatement()

IStatement::~IStatement ( )
virtual

Destructor.

Definition at line 70 of file dbapi.cpp.

Variable Documentation

◆ buffer

CSimpleBuffer CSQLITE3_Cache::SWriteRequest::buffer

Definition at line 248 of file sqlite_cache.hpp.

◆ key

string CSQLITE3_Cache::SWriteRequest::key

Definition at line 244 of file sqlite_cache.hpp.

◆ kSQLITE3_BlobCacheDriverName

const string kSQLITE3_BlobCacheDriverName
extern

◆ m_Cache

CSQLITE3_Cache& CSQLITE3_Cache::CWriterThread::m_Cache
private

Definition at line 271 of file sqlite_cache.hpp.

◆ m_Database

string CSQLITE3_Cache::m_Database
private

◆ m_DB

TSqliteDb* CSQLITE3_Cache::m_DB
private

◆ m_Mutex

CMutex CSQLITE3_Cache::m_Mutex
private

◆ m_ReadOnly

bool CSQLITE3_Cache::m_ReadOnly
private

Definition at line 279 of file sqlite_cache.hpp.

◆ m_Stmt_GetBlobAccess

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_GetBlobAccess
private

◆ m_Stmt_GetReadStream

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_GetReadStream
private

◆ m_Stmt_HasBlobs_key

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_HasBlobs_key
private

Definition at line 302 of file sqlite_cache.hpp.

Referenced by CSQLITE3_Cache::HasBlobs(), and CSQLITE3_Cache::~CSQLITE3_Cache().

◆ m_Stmt_HasBlobs_key_subkey

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_HasBlobs_key_subkey
private

Definition at line 303 of file sqlite_cache.hpp.

Referenced by CSQLITE3_Cache::HasBlobs(), and CSQLITE3_Cache::~CSQLITE3_Cache().

◆ m_Stmt_SetTimestamp

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_SetTimestamp
private

◆ m_Stmt_Store

unique_ptr<CSQLITE3_Statement> CSQLITE3_Cache::m_Stmt_Store
private

precompiled statements these are used to speed up time-critical accesses

AK: looks like keeping this statements for a long time is incorrect because it also holds locks and prevents multi-process access to the database :(

Definition at line 301 of file sqlite_cache.hpp.

Referenced by CSQLITE3_Cache::StoreSynchronous(), and CSQLITE3_Cache::~CSQLITE3_Cache().

◆ m_StopRequest

CRef<SWriteRequest> CSQLITE3_Cache::CWriterThread::m_StopRequest
private

Definition at line 270 of file sqlite_cache.hpp.

◆ m_Timeout

unsigned int CSQLITE3_Cache::m_Timeout
private

◆ m_TimeStampFlag

TTimeStampFlags CSQLITE3_Cache::m_TimeStampFlag
private

◆ m_VersionFlag

EKeepVersions CSQLITE3_Cache::m_VersionFlag
private

◆ m_WriteQueue [1/2]

TWriteQueue CSQLITE3_Cache::m_WriteQueue
private

◆ m_WriteQueue [2/2]

TWriteQueue& CSQLITE3_Cache::CWriterThread::m_WriteQueue
private

Definition at line 272 of file sqlite_cache.hpp.

◆ m_WriterThread

CRef<CWriterThread> CSQLITE3_Cache::m_WriterThread
private

Definition at line 275 of file sqlite_cache.hpp.

Referenced by CSQLITE3_Cache::Open(), and CSQLITE3_Cache::~CSQLITE3_Cache().

◆ subkey

string CSQLITE3_Cache::SWriteRequest::subkey

Definition at line 246 of file sqlite_cache.hpp.

◆ timestamp

int CSQLITE3_Cache::SWriteRequest::timestamp

Definition at line 247 of file sqlite_cache.hpp.

◆ version

int CSQLITE3_Cache::SWriteRequest::version

Definition at line 245 of file sqlite_cache.hpp.

Friends

◆ CDriverManager

friend class CDriverManager
friend

Definition at line 972 of file dbapi.hpp.

Modified on Fri Sep 20 14:58:32 2024 by modify_doxy.py rev. 669887