SourceMod SDK  1.7
SourceMod::IDBDriver Class Referenceabstract

Describes an SQL driver. More...

#include <public/IDBDriver.h>

Public Member Functions

virtual unsigned int GetDBIVersion ()
 
virtual IDatabaseConnect (const DatabaseInfo *info, bool persistent, char *error, size_t maxlength)=0
 Initiates a database connection. More...
 
virtual const char * GetIdentifier ()=0
 Returns a case insensitive database identifier string. More...
 
virtual const char * GetProductName ()=0
 Returns a case sensitive implementation name. More...
 
virtual Handle_t GetHandle ()=0
 Retrieves a Handle_t handle of the IDBDriver type. More...
 
virtual IdentityToken_t * GetIdentity ()=0
 Returns the driver's controlling identity (must be the same as from IExtension::GetIdentity). More...
 
virtual bool IsThreadSafe ()=0
 Returns whether the driver is thread safe. More...
 
virtual bool InitializeThreadSafety ()=0
 Initializes thread safety for the calling thread. More...
 
virtual void ShutdownThreadSafety ()=0
 Shuts down thread safety for the calling thread.
 

Detailed Description

Describes an SQL driver.

Member Function Documentation

virtual IDatabase* SourceMod::IDBDriver::Connect ( const DatabaseInfo info,
bool  persistent,
char *  error,
size_t  maxlength 
)
pure virtual

Initiates a database connection.

Note: Persistent connections should never be created from a thread.

Parameters
infoDatabase connection info pointer.
persistentIf true, a previous persistent connection will be re-used if possible.
errorBuffer to store error message.
maxlengthMaximum size of the error buffer.
Returns
A new IDatabase pointer, or NULL on failure.
virtual Handle_t SourceMod::IDBDriver::GetHandle ( )
pure virtual

Retrieves a Handle_t handle of the IDBDriver type.

Returns
A Handle_t handle.
virtual const char* SourceMod::IDBDriver::GetIdentifier ( )
pure virtual

Returns a case insensitive database identifier string.

Returns
String containing an identifier.
virtual IdentityToken_t* SourceMod::IDBDriver::GetIdentity ( )
pure virtual

Returns the driver's controlling identity (must be the same as from IExtension::GetIdentity).

Returns
An IdentityToken_t identity.
virtual const char* SourceMod::IDBDriver::GetProductName ( )
pure virtual

Returns a case sensitive implementation name.

Returns
String containing an implementation name.
virtual bool SourceMod::IDBDriver::InitializeThreadSafety ( )
pure virtual

Initializes thread safety for the calling thread.

Returns
True on success, false otherwise.
virtual bool SourceMod::IDBDriver::IsThreadSafe ( )
pure virtual

Returns whether the driver is thread safe.

Returns
True if thread safe, false otherwise.

The documentation for this class was generated from the following file: