#include <public/IDBDriver.h>
Public Member Functions | |
| virtual bool | Close ()=0 |
| Disconnects the database and frees its associated memory. Note that the actual object will not be freed until all open references have been closed. | |
| virtual const char * | GetError (int *errorCode=NULL)=0 |
| Error code and string returned by the last operation on this connection. | |
| virtual bool | DoSimpleQuery (const char *query)=0 |
| Prepares and executes a query in one step, and discards any return data. | |
| virtual IQuery * | DoQuery (const char *query)=0 |
| Prepares and executes a query in one step, and returns the resultant data set. | |
| virtual IPreparedQuery * | PrepareQuery (const char *query, char *error, size_t maxlength, int *errCode=NULL)=0 |
| Prepares a query statement for multiple executions and/or binding marked parameters (? in MySQL/sqLite, $n in PostgreSQL). | |
| virtual bool | QuoteString (const char *str, char buffer[], size_t maxlen, size_t *newSize)=0 |
| virtual unsigned int | GetAffectedRows ()=0 |
| Number of rows affected by the last execute. | |
| virtual unsigned int | GetInsertID ()=0 |
| Retrieves the last insert ID on this database connection. | |
| virtual bool | LockForFullAtomicOperation ()=0 |
| Locks the database for an atomic query+retrieval operation. | |
| virtual void | UnlockFromFullAtomicOperation ()=0 |
| Unlocks a locked atomic fetch. | |
| virtual void | IncReferenceCount ()=0 |
| Increases the reference count on the database. | |
| virtual IDBDriver * | GetDriver ()=0 |
| Returns the parent driver. | |
| virtual bool | DoSimpleQueryEx (const char *query, size_t len)=0 |
| Prepares and executes a binary query in one step, and discards any return data. | |
| virtual IQuery * | DoQueryEx (const char *query, size_t len)=0 |
| Prepares and executes a binary query in one step, and returns the resultant data set. | |
Definition at line 425 of file IDBDriver.h.
| virtual bool SourceMod::IDatabase::Close | ( | ) | [pure virtual] |
Disconnects the database and frees its associated memory. Note that the actual object will not be freed until all open references have been closed.
It is guaranteed that an IDatabase pointer won't be destroyed until all open IQuery or IPreparedQuery pointers are closed.
This function is thread safe.
| virtual const char* SourceMod::IDatabase::GetError | ( | int * | errorCode = NULL |
) | [pure virtual] |
Error code and string returned by the last operation on this connection.
This function is not thread safe and must be included in any locks.
| errorCode | Optional pointer to retrieve an error code. |
| virtual bool SourceMod::IDatabase::DoSimpleQuery | ( | const char * | query | ) | [pure virtual] |
Prepares and executes a query in one step, and discards any return data.
This function is not thread safe and must be included in any locks.
| query | Query string. |
| virtual IQuery* SourceMod::IDatabase::DoQuery | ( | const char * | query | ) | [pure virtual] |
Prepares and executes a query in one step, and returns the resultant data set.
Note: If a query contains more than one result set, each result set must be processed before a new query is started.
This function is not thread safe and must be included in any locks.
| query | Query string. |
| virtual IPreparedQuery* SourceMod::IDatabase::PrepareQuery | ( | const char * | query, | |
| char * | error, | |||
| size_t | maxlength, | |||
| int * | errCode = NULL | |||
| ) | [pure virtual] |
Prepares a query statement for multiple executions and/or binding marked parameters (? in MySQL/sqLite, $n in PostgreSQL).
This function is not thread safe and must be included in any locks.
| query | Query string. | |
| error | Error buffer. | |
| maxlength | Maximum length of the error buffer. | |
| errCode | Optional pointer to store a driver-specific error code. |
| virtual bool SourceMod::IDatabase::QuoteString | ( | const char * | str, | |
| char | buffer[], | |||
| size_t | maxlen, | |||
| size_t * | newSize | |||
| ) | [pure virtual] |
Quotes a string for insertion into a query.
| str | Source string. | |
| buffer | Buffer to store new string (should not overlap source string). | |
| maxlen | Maximum length of the output buffer. | |
| newSize | Pointer to store the output size. |
| virtual unsigned int SourceMod::IDatabase::GetAffectedRows | ( | ) | [pure virtual] |
Number of rows affected by the last execute.
This function is not thread safe and must be included in any locks.
| virtual unsigned int SourceMod::IDatabase::GetInsertID | ( | ) | [pure virtual] |
Retrieves the last insert ID on this database connection.
This function is not thread safe and must be included in any locks.
| virtual bool SourceMod::IDatabase::LockForFullAtomicOperation | ( | ) | [pure virtual] |
Locks the database for an atomic query+retrieval operation.
| virtual void SourceMod::IDatabase::IncReferenceCount | ( | ) | [pure virtual] |
Increases the reference count on the database.
This function is thread safe.
| virtual IDBDriver* SourceMod::IDatabase::GetDriver | ( | ) | [pure virtual] |
Returns the parent driver.
This function is thread safe.
| virtual bool SourceMod::IDatabase::DoSimpleQueryEx | ( | const char * | query, | |
| size_t | len | |||
| ) | [pure virtual] |
Prepares and executes a binary query in one step, and discards any return data.
This function is not thread safe and must be included in any locks.
| query | Query string. | |
| length | Length of query string. |
| virtual IQuery* SourceMod::IDatabase::DoQueryEx | ( | const char * | query, | |
| size_t | len | |||
| ) | [pure virtual] |
Prepares and executes a binary query in one step, and returns the resultant data set.
Note: If a query contains more than one result set, each result set must be processed before a new query is started.
This function is not thread safe and must be included in any locks.
| query | Query string. |
1.5.1