NCBI C++ ToolKit
|
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 ¶m) 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 ¶m) const =0 |
Get data type for column in the resultset. More... | |
virtual int | IResultSetMetaData::GetMaxSize (const CDBParamVariant ¶m) const =0 |
Get maximum size in bytes for column. More... | |
virtual string | IResultSetMetaData::GetName (const CDBParamVariant ¶m) const =0 |
Get name of column. More... | |
virtual CDBParams::EDirection | IResultSetMetaData::GetDirection (const CDBParamVariant ¶m) 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 CVariant & | IResultSet::GetVariant (const CDBParamVariant ¶m)=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 CNcbiIstream & | IResultSet::GetBlobIStream (size_t buf_size=0)=0 |
Get Blob input stream. More... | |
virtual CNcbiOstream & | IResultSet::GetBlobOStream (size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0 |
Get Blob output stream. More... | |
virtual CNcbiOstream & | IResultSet::GetBlobOStream (size_t blob_size, EAllowLog log_it, size_t buf_size=0) |
virtual CNcbiOstream & | IResultSet::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 CNcbiOstream & | IResultSet::GetBlobOStream (IConnection *conn, size_t blob_size, EAllowLog log_it, size_t buf_size=0) |
virtual IReader * | IResultSet::GetBlobReader ()=0 |
Get a Blob Reader. More... | |
virtual void | IResultSet::Close ()=0 |
Close resultset. More... | |
virtual const IResultSetMetaData * | IResultSet::GetMetaData (EOwnership ownership=eNoOwnership)=0 |
Get Metadata. More... | |
virtual | IStatement::~IStatement () |
Destructor. More... | |
virtual IResultSet * | IStatement::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 IResultSet * | IStatement::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 ¶m)=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 IWriter * | IStatement::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 IWriter * | IStatement::GetBlobWriter (I_BlobDescriptor &d, size_t blob_size, EAllowLog log_it) |
virtual CNcbiOstream & | IStatement::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 CNcbiOstream & | IStatement::GetBlobOStream (I_BlobDescriptor &d, size_t blob_size, EAllowLog log_it, size_t buf_size=0) |
virtual class IConnection * | IStatement::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 IResultSetMetaData & | IStatement::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 ¶m)=0 |
Set input parameters. More... | |
virtual void | ICallableStatement::SetOutputParam (const CVariant &v, const CDBParamVariant ¶m)=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 IResultSet * | ICallableStatement::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 ¶m)=0 |
Set input parameter. More... | |
virtual IResultSet * | ICursor::Open ()=0 |
Open cursor and get corresponding resultset. More... | |
virtual CNcbiOstream & | ICursor::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 CNcbiOstream & | ICursor::GetBlobOStream (unsigned int col, size_t blob_size, EAllowLog log_it, size_t buf_size=0) |
virtual IWriter * | ICursor::GetBlobWriter (unsigned int col, size_t blob_size, TBlobOStreamFlags flags=0)=0 |
Get Blob Writer. More... | |
virtual IWriter * | ICursor::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 IConnection * | ICursor::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 ¶m, 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 IDataSource * | IConnection::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 ¶ms)=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 IConnection * | IConnection::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 IStatement * | IConnection::GetStatement ()=0 |
Get statement object for regular SQL queries. More... | |
virtual ICallableStatement * | IConnection::GetCallableStatement (const string &proc)=0 |
Get callable statement object for stored procedures. More... | |
ICallableStatement * | IConnection::GetCallableStatement (const string &proc, int) |
virtual ICursor * | IConnection::GetCursor (const string &name, const string &sql, int batchSize)=0 |
Get cursor object. More... | |
ICursor * | IConnection::GetCursor (const string &name, const string &sql) |
ICursor * | IConnection::GetCursor (const string &name, const string &sql, int, int batchSize) |
virtual IBulkInsert * | IConnection::GetBulkInsert (const string &table_name)=0 |
Create bulk insert object. More... | |
IBulkInsert * | IConnection::GetBulkInsert (const string &table_name, unsigned int) |
virtual IStatement * | IConnection::CreateStatement ()=0 |
Get statement object for regular SQL queries. More... | |
virtual ICallableStatement * | IConnection::PrepareCall (const string &proc)=0 |
Get callable statement object for stored procedures. More... | |
ICallableStatement * | IConnection::PrepareCall (const string &proc, int) |
virtual ICursor * | IConnection::CreateCursor (const string &name, const string &sql, int batchSize)=0 |
Get cursor object. More... | |
ICursor * | IConnection::CreateCursor (const string &name, const string &sql) |
ICursor * | IConnection::CreateCursor (const string &name, const string &sql, int, int batchSize) |
virtual IBulkInsert * | IConnection::CreateBulkInsert (const string &table_name)=0 |
Create bulk insert object. More... | |
IBulkInsert * | IConnection::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_MultiEx * | IConnection::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 CVersionInfo & | IConnection::GetVersionInfo () const =0 |
virtual CDB_Connection * | IConnection::GetCDB_Connection ()=0 |
Returns the internal driver connection object. More... | |
virtual | IDataSource::~IDataSource () |
Protected Destructor. More... | |
virtual IConnection * | IDataSource::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_MultiEx * | IDataSource::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_DriverContext * | IDataSource::GetDriverContext ()=0 |
Returns the pointer to the general driver interface. More... | |
virtual const I_DriverContext * | IDataSource::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 string & | CSQLITE3_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 &) | |
CWriterThread & | CSQLITE3_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_Cache & | CSQLITE3_Cache::operator= (const CSQLITE3_Cache &) |
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 IReader * | CSQLITE3_Cache::GetReadStream (const string &key, int version, const string &subkey) |
Return sequential stream interface to read BLOB data. More... | |
virtual IReader * | CSQLITE3_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 IWriter * | CSQLITE3_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... | |
typedef int TBlobOStreamFlags |
|
private |
sqlite3 database handle
Definition at line 288 of file sqlite_cache.hpp.
|
private |
queue for delayed writes
Definition at line 252 of file sqlite_cache.hpp.
anonymous enum |
Enumerator | |
---|---|
kDefaultTimestampPolicy |
Definition at line 103 of file sqlite_cache.hpp.
enum EAllowLog |
enum 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 |
Enumerator | |
---|---|
eUnknown | |
eInitError | |
eNotImplemented |
Definition at line 79 of file sqlite_cache.hpp.
enum IBulkInsert::EHints |
|
pure virtual |
Abort connection.
Implemented in CConnection.
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().
|
pure virtual |
Add "ORDER" hint.
Resets everything that was set by SetHints().
Implemented in CDBAPIBulkInsert.
Referenced by CBulkInsertImpl::AddOrderHint().
|
pure virtual |
Add row to the batch.
Implemented in CDBAPIBulkInsert.
Referenced by CBulkInsertImpl::EndRow(), and CDbapiTest::Run().
|
pure virtual |
Bind column.
col | Column number. |
v | Variant value. |
Implemented in CDBAPIBulkInsert.
Referenced by CDbapiTest::Run(), and CBulkInsertImpl::x_CheckWriteStarted().
|
pure virtual |
Bind blob to variant.
If this mode is true, BLOB data is returned as CVariant False by default.
Enables | blob binding when set to true. |
Implemented in CResultSet.
Referenced by CDbapiTest::Run().
|
pure virtual |
|
pure virtual |
Cancel cursor.
Implemented in CCursor.
|
pure virtual |
Cancel bulk insert.
Implemented in CDBAPIBulkInsert.
Referenced by CBulkInsertImpl::x_CheckCanWrite().
|
pure virtual |
|
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.
|
pure virtual |
Close resultset.
Implemented in CResultSet.
|
pure virtual |
Close statement.
Implemented in CStatement, and CCallableStatement.
Referenced by CDbapiTest::Run(), and CQueryImpl::x_Close().
|
pure virtual |
Close cursor.
Implemented in CCursor.
|
pure virtual |
Close.
Implemented in CDBAPIBulkInsert.
|
pure virtual |
|
pure virtual |
Complete batch.
Implemented in CDBAPIBulkInsert.
Referenced by CDbapiTest::Run(), and CBulkInsertImpl::~CBulkInsertImpl().
|
pure virtual |
Connect to a database.
params | Connection parameters. Parameters should include all necessary settings because all info set via SetMode() or ResetMode() will be ignored. |
Implemented in CConnection.
|
pure virtual |
Connect to a database.
user | User name. |
password | User's password. |
server | Server to connect to. |
database | Database to connect to. |
Implemented in CConnection.
Referenced by python::CConnection::MakeDBConnection().
|
pure virtual |
Connect to a database using connect validator.
validator | Validator implementation class. |
user | User name. |
password | User's password. |
server | Server to connect to. |
database | Database to connect to. |
Implemented in CConnection.
Referenced by CDbapiSimpleApp::SetupDb().
|
pure virtual |
Create bulk insert object.
Implemented in CConnection.
Referenced by IConnection::CreateBulkInsert().
|
inline |
Definition at line 922 of file dbapi.hpp.
References IConnection::CreateBulkInsert(), and table_name.
|
pure virtual |
Implemented in CDataSource.
Referenced by CDatabaseImpl::Connect(), python::CConnection::MakeDBConnection(), CDbapiTest::Run(), CDbCopyApp::Run(), CDbapiSimpleApp::SetupDb(), and CSDBAPI::UpdateMirror().
Definition at line 905 of file dbapi.hpp.
References IConnection::CreateCursor(), and sql.
|
inline |
Definition at line 911 of file dbapi.hpp.
References IConnection::CreateCursor(), and sql.
|
pure virtual |
Get statement object for regular SQL queries.
Implemented in CConnection.
Referenced by CDbapiSimpleApp::DemoDynamicSql(), and CDbapiSimpleApp::DemoStaticSql().
CSQLITE3_Cache::CSQLITE3_Cache | ( | ) |
Definition at line 385 of file sqlite_cache.cpp.
|
private |
|
private |
CSQLITE3_Cache::CWriterThread::CWriterThread | ( | CSQLITE3_Cache & | cache, |
CSQLITE3_Cache::TWriteQueue & | write_q | ||
) |
Definition at line 49 of file sqlite_cache.cpp.
|
inline |
Definition at line 1017 of file dbapi.hpp.
References IConnection::GetCDB_Connection().
|
pure virtual |
Disables column binding.
False by default.
Disables | column binding when set to true. |
Implemented in CResultSet.
|
pure virtual |
Execute stored procedure.
Implemented in CCallableStatement.
Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().
Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql())
sql | SQL statement to execute. |
Implements IStatement.
Reimplemented in CCallableStatement.
Sends one or more SQL statements to the SQL server (NOTE: replaced by the SendSql())
sql | SQL statement to execute. |
Implemented in CStatement, CCallableStatement, and ICallableStatement.
|
pure virtual |
Executes the last command (with changed parameters, if any).
Implemented in CStatement.
|
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.
sql | SQL statement to execute. |
Implements IStatement.
Reimplemented in CCallableStatement.
|
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.
sql | SQL statement to execute. |
Implemented in CStatement, CCallableStatement, and ICallableStatement.
|
pure virtual |
Executes stored procedure no results returned.
NOTE: All resultsets are discarded.
Implemented in CCallableStatement.
Executes SQL statement with no results returned.
All resultsets are discarded.
sql | SQL statement to execute. |
Implements IStatement.
Reimplemented in CCallableStatement.
Executes SQL statement with no results returned.
All resultsets are discarded.
sql | SQL statement to execute. |
Implemented in CStatement, CCallableStatement, and ICallableStatement.
Referenced by python::CDMLConnPool::commit(), python::CDMLConnPool::Create(), and python::CDMLConnPool::rollback().
|
pure virtual |
Check if the statement failed.
Implemented in CStatement.
|
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.
|
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.
key | BLOB identification key |
subkey | BLOB identification subkey |
version | BLOB version |
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.
string IDataSource::GetApplicationName | ( | void | ) | const |
Definition at line 48 of file dbapi.cpp.
References I_DriverContext::GetApplicationName(), and IDataSource::GetDriverContext().
Referenced by CSDBAPI::GetApplicationName().
|
virtual |
Get BLOB access using BlobAccessDescr.
Method fills blob_descr parameter. If provided buffer has sufficient capacity for BLOB storage, BLOB is saved into the buffer, otherwise IReader is created.
Implements ICache.
Definition at line 1145 of file sqlite_cache.cpp.
References ICache::SBlobAccessDescr::blob_found, ICache::SBlobAccessDescr::blob_size, ICache::SBlobAccessDescr::buf, ICache::SBlobAccessDescr::buf_size, CTime::eCurrent, ICache::fTimeStampOnRead, GetBlobReader(), CSQLITE3_Cache::GetTimeout(), CTime::GetTimeT(), ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Stmt_GetBlobAccess, CSQLITE3_Cache::m_TimeStampFlag, ICache::SBlobAccessDescr::reader, CSQLITE3_Cache::Remove(), sql, ncbi::grid::netcache::search::fields::subkey, dtl::version, and CSQLITE3_Cache::x_SetTimestamp().
|
pure virtual |
Get Blob input stream.
buf_size | buf_size is the size of internal buffer, default 4096. |
Implemented in CResultSet.
Referenced by CDbapiTest::Run().
|
virtual |
Reimplemented in CStatement.
Definition at line 81 of file dbapi.cpp.
References eDisableLog, fBOS_SkipLogging, and IStatement::GetBlobOStream().
|
pure virtual |
Get an ostream for writing BLOBs using previously created CDB_BlobDescriptor.
d | Descriptor |
blob_size | Size of BLOB to write |
flags |
buf_size | Buffer size, default 4096 |
Implemented in CStatement.
Referenced by CStatement::GetBlobOStream(), and IStatement::GetBlobOStream().
|
virtual |
Reimplemented in CResultSet.
Definition at line 122 of file dbapi.cpp.
References conn, eDisableLog, fBOS_SkipLogging, and IResultSet::GetBlobOStream().
|
pure virtual |
Get Blob output stream with explicit additional connection.
conn | addtional connection used for writing blob (the above method clones the existing connection implicitly) |
blob_size | blob_size is the size of the BLOB to be written. |
flags |
buf_size | The size of internal buffer, default 4096. |
Implemented in CResultSet.
|
virtual |
Reimplemented in CResultSet.
Definition at line 114 of file dbapi.cpp.
References eDisableLog, fBOS_SkipLogging, and IResultSet::GetBlobOStream().
|
pure virtual |
Get Blob output stream.
The existing connection is cloned for writing blob.
blob_size | blob_size is the size of the BLOB to be written. |
flags |
buf_size | The size of internal buffer, default 4096. |
Implemented in CResultSet.
Referenced by CResultSet::GetBlobOStream(), IResultSet::GetBlobOStream(), and CDbapiTest::Run().
|
virtual |
Reimplemented in CCursor.
Definition at line 152 of file dbapi.cpp.
References eDisableLog, fBOS_SkipLogging, and ICursor::GetBlobOStream().
|
pure virtual |
Get output stream for BLOB updates, requires BLOB column number.
col | Column number. |
blob_size | blob_size is the size of the BLOB to be written. |
flags |
buf_size | The size of internal buffer, default 4096. |
Implemented in CCursor.
Referenced by CCursor::GetBlobOStream(), and ICursor::GetBlobOStream().
|
virtual |
Retrieve BLOB owner.
owner | BLOB owner (as used by method Store) |
Implements ICache.
Definition at line 1219 of file sqlite_cache.cpp.
References _ASSERT, Info(), LOG_POST, and NCBI_CURRENT_FUNCTION.
|
pure virtual |
Get a Blob Reader.
Pointer | to the Blob Reader. |
Implemented in CResultSet.
Referenced by CDbapiTest::Run().
|
virtual |
Reimplemented in CStatement.
Definition at line 74 of file dbapi.cpp.
References eDisableLog, fBOS_SkipLogging, and IStatement::GetBlobWriter().
|
pure virtual |
Get a writer for writing BLOBs using previously created CDB_BlobDescriptor.
d | Descriptor |
blob_size | Size of BLOB to write |
flags |
Implemented in CStatement.
Referenced by IStatement::GetBlobWriter(), and CStatement::GetBlobWriter().
Reimplemented in CCursor.
Definition at line 160 of file dbapi.cpp.
References eDisableLog, fBOS_SkipLogging, and ICursor::GetBlobWriter().
|
pure virtual |
Get Blob Writer.
Implementation of IWriter interface
col | Column number. |
blob_size | blob_size is the size of the BLOB to be written. |
flags |
Implemented in CCursor.
Referenced by ICursor::GetBlobWriter(), and CCursor::GetBlobWriter().
|
pure virtual |
Create bulk insert object.
table_name | table name. |
nof_cols | Number of columns. |
Implemented in CConnection.
Referenced by CBulkInsertImpl::CBulkInsertImpl(), and IConnection::GetBulkInsert().
|
inline |
Definition at line 883 of file dbapi.hpp.
References IConnection::GetBulkInsert(), and table_name.
|
virtual |
Implements ICache.
Definition at line 630 of file sqlite_cache.cpp.
References CSQLITE3_Cache::m_Database.
|
pure virtual |
Get callable statement object for stored procedures.
proc | Stored procedure name. |
nofArgs | Number of arguments. |
Implemented in CConnection.
Referenced by python::CCallableStmtHelper::CreateStmt(), CDbapiSimpleApp::DemoStoredProc(), CQueryImpl::ExecuteSP(), and IConnection::GetCallableStatement().
|
inline |
Definition at line 852 of file dbapi.hpp.
References IConnection::GetCallableStatement(), and proc.
|
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().
|
pure virtual |
Returns the internal driver connection object.
Implemented in CConnection.
Referenced by CConnHolder::CloseRef(), DBAPI_MakeTrans(), IConnection::GetCancelTimeout(), CBlobBookmarkImpl::GetOStream(), IConnection::GetTimeout(), and CDatabase::NewBlobStore().
|
pure virtual |
Get column number, currently available for Read()
Implemented in CResultSet.
Definition at line 861 of file dbapi.hpp.
References IConnection::GetCursor(), and sql.
|
inline |
Definition at line 867 of file dbapi.hpp.
References IConnection::GetCursor(), and sql.
Get DB name/path.
Definition at line 237 of file sqlite_cache.hpp.
References CSQLITE3_Cache::m_Database.
|
pure virtual |
Get current database.
Implemented in CConnection.
|
pure virtual |
Get parent datasource object.
Implemented in CConnection.
|
pure virtual |
Get parameter's direction (in/out/inout).
param | Column number or name |
Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.
|
pure virtual |
Implemented in CDataSource.
|
pure virtual |
Returns the pointer to the general driver interface.
Implemented in CDataSource.
Referenced by python::CConnection::CConnection(), CDataSourceInitializer::CDataSourceInitializer(), IDataSource::GetApplicationName(), CDbCopyApp::Run(), s_GetDBContext(), IDataSource::SetApplicationName(), CDbapiSimpleApp::SetupDb(), and CDriverManager::~CDriverManager().
|
overridevirtual |
Get error code interpreted as text.
Reimplemented from CException.
Definition at line 372 of file sqlite_cache.cpp.
References eUnknown, and CException::GetErrCodeString().
|
pure virtual |
Returns all error messages as a CDB_MultiEx object.
Implemented in CConnection.
|
pure virtual |
Returns all server messages as a CDB_MultiEx object.
Implemented in CDataSource.
|
pure virtual |
Returns all error messages as a single string.
Implemented in CConnection.
|
pure virtual |
Returns all server messages as a single string.
Implemented in CDataSource.
Referenced by CDbapiSimpleApp::DemoStoredProc(), and CDbapiTest::Run().
|
inlinevirtual |
Retrieve the effective combination of flags from the underlying storage.
Implements ICache.
Definition at line 225 of file sqlite_cache.hpp.
|
pure virtual |
Get maximum size in bytes for column.
col | Column number |
Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.
unsigned CSQLITE3_Cache::GetMemBufferSize | ( | ) | const |
|
pure virtual |
Get Metadata.
Implemented in CResultSet.
Referenced by CQueryImpl::GetColumnType(), python::CRealResultSet::GetMetaData(), CQueryImpl::HasMoreResultSets(), and CQuery::CRow::x_Reset().
|
pure virtual |
Get mode mask.
Implemented in CConnection.
|
pure virtual |
Get name of column.
param | Column number or name |
Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.
Referenced by python::CCursor::callproc(), IResultSetMetaData::HasColumn(), CQueryImpl::HasMoreResultSets(), CDbapiSimpleApp::RetrieveData(), CDbapiTest::Run(), and CQuery::CRow::x_Reset().
|
pure virtual |
|
pure virtual |
Get the parent connection.
If the original connections was cloned, returns cloned connection.
Implemented in CStatement.
|
pure virtual |
Get the parent connection.
NOTE: If the original connections was cloned, returns cloned connection.
Implemented in CCursor.
|
virtual |
Request the latest version of a BLOB.
[in] | key | BLOB identification key |
[in] | subkey | BLOB identification subkey |
[out] | version | Version of the returned BLOB |
[out] | validity | Validity of the version of the returned BLOB |
Implements ICache.
Definition at line 873 of file sqlite_cache.cpp.
References NCBI_THROW.
|
virtual |
Return sequential stream interface to read BLOB data.
key | BLOB identification key |
subkey | BLOB identification subkey |
version | BLOB version |
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().
|
pure virtual |
Get resulset.
Implemented in CStatement.
Referenced by python::CRealSetProxy::DumpResult(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().
|
pure virtual |
Get result type.
Implemented in CResultSet.
Referenced by python::CRealResultSet::GetResultType(), CQueryImpl::HasMoreResultSets(), and CDbapiTest::Run().
|
pure virtual |
Get return status from the stored procedure.
Implemented in CCallableStatement.
Referenced by CQueryImpl::HasMoreResultSets(), and CDbapiTest::Run().
|
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.
Check if BLOB exists, return BLOB size.
key | BLOB identification key |
subkey | BLOB identification subkey |
version | BLOB version |
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.
|
pure virtual |
Get statement object for regular SQL queries.
Implemented in CConnection.
Referenced by CQueryImpl::CQueryImpl(), python::CStmtHelper::CreateStmt(), and CDbapiSimpleApp::DemoParamerizedSql().
|
virtual |
Get expiration timeout.
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().
|
virtual |
Get connection timeout.
Definition at line 59 of file dbapi.cpp.
References IConnection::GetCDB_Connection(), and CDB_Connection::GetTimeout().
|
virtual |
Get timestamp policy.
Implements ICache.
Definition at line 653 of file sqlite_cache.cpp.
References CSQLITE3_Cache::m_TimeStampFlag.
|
pure virtual |
Get total columns.
Implemented in CResultSet.
Referenced by python::CRealResultSet::GetTotalColumns(), CQueryImpl::HasMoreResultSets(), python::MakeTupleFromResult(), and CQuery::CRow::x_Reset().
|
pure virtual |
Get total number of columns in resultset.
Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.
Referenced by IResultSetMetaData::HasColumn(), CDbapiSimpleApp::RetrieveData(), and CDbapiTest::Run().
|
pure virtual |
Get data type for column in the resultset.
param | Column number or name |
Implemented in CStatement::CStmtParamsMetaData, and CResultSetMetaData.
Referenced by CQueryImpl::GetColumnType(), CDbapiTest::Run(), and CQuery::CRow::x_Reset().
|
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.
param | Column number (one-based) or name |
Implemented in CResultSet.
Referenced by python::CCachedResultSet::CCachedResultSet(), CQueryImpl::GetFieldValue(), python::CRealResultSet::GetVariant(), CQueryImpl::HasMoreResultSets(), python::MakeTupleFromResult(), and CDbapiTest::Run().
|
pure virtual |
Implemented in CConnection.
Referenced by CDatabase::GetDriverVersion().
|
virtual |
Get version retention.
Implements ICache.
Definition at line 674 of file sqlite_cache.cpp.
References CSQLITE3_Cache::m_VersionFlag.
|
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().
Check if any BLOB exists (any version)
Implements ICache.
Definition at line 1109 of file sqlite_cache.cpp.
References ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Stmt_HasBlobs_key, CSQLITE3_Cache::m_Stmt_HasBlobs_key_subkey, NULL, stmt, and ncbi::grid::netcache::search::fields::subkey.
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.
|
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.
Implemented in CStatement, and CCallableStatement.
Referenced by python::CRealSetProxy::DumpResult(), CQueryImpl::IsFinished(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().
|
pure virtual |
Check if resultset has rows.
Implemented in CStatement.
Referenced by python::CRealSetProxy::DumpResult(), python::CRealSetProxy::MoveToNextRS(), and CDbapiTest::Run().
|
pure virtual |
Check if the connection is alive.
Implemented in CConnection.
|
pure virtual |
Get auto-clear input parameter flag value.
Implemented in CStatement.
|
virtual |
Implements ICache.
Definition at line 623 of file sqlite_cache.cpp.
References CSQLITE3_Cache::m_DB, and NULL.
|
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().
|
pure virtual |
If enabled, redirects all error messages to CDB_MultiEx object (see below).
Implemented in CConnection.
CSQLITE3_ICacheException::NCBI_EXCEPTION_DEFAULT | ( | CSQLITE3_ICacheException | , |
CException | |||
) |
|
pure virtual |
Get next row.
NOTE: no results are fetched before first call to this function.
Implemented in CResultSet.
Referenced by python::CCachedResultSet::CCachedResultSet(), python::CCursor::fetchall(), python::CCursor::fetchmany(), python::CCursor::fetchone(), CQueryImpl::HasMoreResultSets(), python::CRealResultSet::Next(), CDbapiTest::Run(), and CQueryImpl::x_Fetch().
|
pure virtual |
Open cursor and get corresponding resultset.
Implemented in CCursor.
Referenced by CDbapiTest::Run().
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
database | DB name with path |
remove | Delete 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.
|
private |
|
private |
|
pure virtual |
Get callable statement object for stored procedures.
Implemented in CConnection.
Referenced by IConnection::PrepareCall().
|
inline |
Definition at line 896 of file dbapi.hpp.
References IConnection::PrepareCall(), and proc.
|
virtual |
Delete BLOBs with access time older than specified.
Function finds all BLOB versions with the specified key and removes the old instances.
key | BLOB key |
subkey | BLOB identification subkey |
access_timeout | Time 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.
|
virtual |
Delete all BLOBs older than specified.
access_timeout | Time 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().
|
pure virtual |
Purge results.
Calls fetch for every resultset received until finished.
Implemented in CStatement.
Referenced by CQueryImpl::x_Close().
|
virtual |
Fetch the BLOB.
key | BLOB identification key |
subkey | BLOB identification subkey |
version | BLOB version |
buf | pointer on destination buffer |
size | buffer size in bytes (chars) |
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().
|
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())
buf | Buffer to read data. |
size | Amount of data to read. |
Implemented in CResultSet.
Definition at line 969 of file sqlite_cache.cpp.
References ncbi::grid::netcache::search::fields::key, CSQLITE3_Cache::m_DB, sql, and stmt.
Referenced by CSQLITE3_Cache::GetBlobAccess().
Remove specific cache entry.
key | BLOB identification key |
subkey | BLOB identification subkey |
version | BLOB 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.
|
pure virtual |
|
virtual |
Implements ICache.
Definition at line 1079 of file sqlite_cache.cpp.
References database, CTreeNode< TValue, TKeyGetterP >::FindNode(), CTreeNode< TValue, TKeyGetterP >::GetValue(), kSQLITE3_BlobCacheDriverName, CSQLITE3_Cache::m_Database, and CDirEntry::SplitPath().
Sends one or more SQL statements to the SQL server.
sql | SQL statement to execute. |
Implements IStatement.
Reimplemented in CCallableStatement.
Sends one or more SQL statements to the SQL server.
sql | SQL statement to execute. |
Implemented in CStatement, CCallableStatement, and ICallableStatement.
Referenced by CQueryImpl::Execute().
Definition at line 43 of file dbapi.cpp.
References IDataSource::GetDriverContext(), and I_DriverContext::SetApplicationName().
Referenced by CSDBAPI::SetApplicationName().
Set auto-clear input parameter flag.
flag | auto-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.
|
virtual |
Definition at line 886 of file sqlite_cache.cpp.
References NCBI_THROW.
|
inlinevirtual |
Set timeout for command cancellation and connection closing.
Reimplemented in CConnection.
|
inlinevirtual |
Pass flags to the underlying storage.
Implements ICache.
Definition at line 226 of file sqlite_cache.hpp.
|
pure virtual |
Set hints by one call. Resets everything that was set by Add*Hint().
Implemented in CDBAPIBulkInsert.
Referenced by CBulkInsertImpl::SetHints().
|
pure virtual |
Set login timeout.
Implemented in CDataSource.
|
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).
out | Output stream to set to. |
Referenced by CDbapiSimpleApp::SetupDb().
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.
|
pure virtual |
|
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.
v | Parameter value. |
name | Parameter name. |
Implemented in CCallableStatement.
Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().
|
pure virtual |
Set input/output parameter.
v | Parameter value. |
name | Parameter name. |
Implemented in ICallableStatement, CStatement, and CCallableStatement.
Referenced by CQueryImpl::Execute().
|
pure virtual |
Set input parameters.
v | Parameter value. |
name | Parameter name. |
Implements IStatement.
Implemented in CCallableStatement.
Referenced by CQueryImpl::ExecuteSP(), and CDbapiTest::Run().
|
pure virtual |
|
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().
|
virtual |
Set timestamp update policy.
policy | A bitwise combination of "ETimeStampFlags". |
timeout | Default expiration timeout for the stored BLOBs. |
max_timeout | Maximum 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.
|
virtual |
Set version retention policy.
policy | Version retention mode |
Implements ICache.
Definition at line 667 of file sqlite_cache.cpp.
References CSQLITE3_Cache::m_VersionFlag.
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().
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().
|
virtual |
Add or replace BLOB.
key | BLOB identification key |
key | BLOB identification sub-key |
version | BLOB version |
data | pointer on data buffer |
size | data buffer size in bytes (chars) |
time_to_live | Individual 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.
|
pure virtual |
void CSQLITE3_Cache::StoreSynchronous | ( | const string & | key, |
int | version, | ||
const string & | subkey, | ||
const void * | data, | ||
size_t | size | ||
) |
Definition at line 739 of file sqlite_cache.cpp.
References _ASSERT, data, CTime::eCurrent, ICache::eDropAll, ICache::eDropOlder, Error(), CTime::GetTimeT(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Stmt_Store, CSQLITE3_Cache::m_VersionFlag, CSQLITE3_Cache::Purge(), ncbi::grid::netcache::search::fields::size, sql, ncbi::grid::netcache::search::fields::subkey, and dtl::version.
Update statement for cursor.
table | table name. |
updateSql | SQL statement. |
Implemented in CCursor.
Referenced by CDbapiTest::Run().
bool CSQLITE3_Cache::Vacuum | ( | ) |
Vacuum the database (should be open first)
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().
|
pure virtual |
Determine if last column was NULL.
Valid only when the column binding is off.
Implemented in CResultSet.
|
private |
Definition at line 681 of file sqlite_cache.cpp.
References CTime::eCurrent, Error(), CTime::GetTimeT(), ncbi::grid::netcache::search::fields::key, LOG_POST, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Mutex, CSQLITE3_Cache::m_Stmt_SetTimestamp, sql, ncbi::grid::netcache::search::fields::subkey, and dtl::version.
Referenced by CSQLITE3_Cache::GetBlobAccess(), CSQLITE3_Cache::GetReadStream(), and CSQLITE3_Cache::Read().
|
virtual |
Definition at line 395 of file sqlite_cache.cpp.
References _ASSERT, _TRACE, SStats::bytes_read, count, Error(), CAtomicCounter::Get(), Info(), LOG_POST, CSQLITE3_Cache::m_Database, CSQLITE3_Cache::m_DB, CSQLITE3_Cache::m_Stmt_GetBlobAccess, CSQLITE3_Cache::m_Stmt_GetReadStream, CSQLITE3_Cache::m_Stmt_HasBlobs_key, CSQLITE3_Cache::m_Stmt_HasBlobs_key_subkey, CSQLITE3_Cache::m_Stmt_SetTimestamp, CSQLITE3_Cache::m_Stmt_Store, CSQLITE3_Cache::m_WriterThread, NCBI_CURRENT_FUNCTION, NULL, SStats::objects_read, s_CacheStats, stmt, SStats::total_time, and Warning().
|
virtual |
|
protectedvirtual |
Protected Destructor.
Prohibits explicit deletion. Use CDriverManager::DestroyDs() call, instead.
|
virtual |
|
virtual |
CSimpleBuffer CSQLITE3_Cache::SWriteRequest::buffer |
Definition at line 248 of file sqlite_cache.hpp.
string CSQLITE3_Cache::SWriteRequest::key |
Definition at line 244 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::SameCacheParams().
|
private |
Definition at line 271 of file sqlite_cache.hpp.
|
private |
filename of the database
Definition at line 286 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetCacheName(), CSQLITE3_Cache::GetDatabase(), CSQLITE3_Cache::Open(), CSQLITE3_Cache::SameCacheParams(), CSQLITE3_Cache::Vacuum(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 292 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetAccessTime(), CSQLITE3_Cache::GetBlobAccess(), CSQLITE3_Cache::GetReadStream(), CSQLITE3_Cache::GetSize(), CSQLITE3_Cache::HasBlobs(), CSQLITE3_Cache::IsOpen(), CSQLITE3_Cache::Open(), CSQLITE3_Cache::Purge(), CSQLITE3_Cache::Read(), CSQLITE3_Cache::Remove(), CSQLITE3_Cache::StoreSynchronous(), CSQLITE3_Cache::Vacuum(), CSQLITE3_Statement::x_Log(), CSQLITE3_Cache::x_SetTimestamp(), CSQLITE3_Statement::x_Throw(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 288 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetBlobAccess(), CSQLITE3_Cache::GetReadStream(), CSQLITE3_Cache::HasBlobs(), CSQLITE3_Cache::SetTimeStampPolicy(), CSQLITE3_Cache::StoreSynchronous(), CSQLITE3_Cache::Vacuum(), and CSQLITE3_Cache::x_SetTimestamp().
|
private |
Definition at line 279 of file sqlite_cache.hpp.
|
private |
Definition at line 304 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetBlobAccess(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 305 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetReadStream(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 302 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::HasBlobs(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 303 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::HasBlobs(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
private |
Definition at line 306 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::x_SetTimestamp(), and CSQLITE3_Cache::~CSQLITE3_Cache().
|
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().
|
private |
Definition at line 270 of file sqlite_cache.hpp.
|
private |
Definition at line 281 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetTimeout(), and CSQLITE3_Cache::SetTimeStampPolicy().
|
private |
Definition at line 282 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetBlobAccess(), CSQLITE3_Cache::GetReadStream(), CSQLITE3_Cache::GetTimeStampPolicy(), CSQLITE3_Cache::Read(), and CSQLITE3_Cache::SetTimeStampPolicy().
|
private |
Definition at line 283 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::GetVersionRetention(), CSQLITE3_Cache::SetVersionRetention(), and CSQLITE3_Cache::StoreSynchronous().
|
private |
Definition at line 253 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::CWriterThread::Main(), CSQLITE3_Cache::Open(), CSQLITE3_Cache::CWriterThread::Stop(), and CSQLITE3_Cache::Store().
|
private |
Definition at line 272 of file sqlite_cache.hpp.
|
private |
Definition at line 275 of file sqlite_cache.hpp.
Referenced by CSQLITE3_Cache::Open(), and CSQLITE3_Cache::~CSQLITE3_Cache().
string CSQLITE3_Cache::SWriteRequest::subkey |
Definition at line 246 of file sqlite_cache.hpp.
int CSQLITE3_Cache::SWriteRequest::timestamp |
Definition at line 247 of file sqlite_cache.hpp.
int CSQLITE3_Cache::SWriteRequest::version |
Definition at line 245 of file sqlite_cache.hpp.
|
friend |