C# Class ALFA.MySQLDatabaseInternal

This wrapper class shields callers of MySQLDatabase from needing to immediately demand that the MySql.Data.dll assembly be loaded.
Inheritance: IDisposable
Datei anzeigen Open project: ALandFarAway/ALFA-Base-Resources Class Usage Examples

Public Methods

Method Description
ACR_SQLEncodeSpecialChars ( string s ) : string

This routine escapes characters for a SQL query.

ACR_SQLExecute ( string SQL ) : void

This routine performs a synchronous SQL query. If there were pending asynchronous queries in the queue, the pending queries are drained first. The query must not return any results.

ACR_SQLFetch ( ) : bool

This routine fetches the next rowset from the database.

ACR_SQLGetAffectedRows ( ) : int

This routine returns the number of rows affected by a query.

ACR_SQLGetData ( ) : string

This routine returns the first column of data from the current SQL rowset.

ACR_SQLGetData ( int ColumnIndex ) : string

This routine returns the specified column of data from the current SQL rowset.

ACR_SQLQuery ( string SQL ) : void

This routine performs a synchronous SQL query. If there were pending asynchronous queries in the queue, the pending queries are drained first.

Dispose ( ) : void

Dispose the object.

Private Methods

Method Description
ACR_SQLNextResult ( ) : bool

This routine advances to the next result set of a multi-result query.

ConnectDatabase ( ) : void

Connect a dedicated connection to the database.

Dispose ( bool Disposing ) : void

Dispose the object.

MySQLDatabaseInternal ( string ConnectionString = null, bool Dedicated = false ) : System

Create a new MySQLDatabaseInternal object.

PrepareSQL ( string SQL ) : string

Prepare a query string for execution. Currently, this prepends a USE DatabaseName; statement to improve latency (see discussion below with DatabaseName).

SetupConnectionString ( ) : void

This method sets up the database connection string based on the default connection information set for the MySQL plugin. The pool size of 3 is based on : - One connection for polling for input by the GameWorldManager synchronization thread. - One connection for background ad-hoc queries kicked off by the server communicator on work items (account record lookup, etc.). - One connection for miscellaneous use.

Method Details

ACR_SQLEncodeSpecialChars() public method

This routine escapes characters for a SQL query.
public ACR_SQLEncodeSpecialChars ( string s ) : string
s string Supplies the string to escape.
return string

ACR_SQLExecute() public method

This routine performs a synchronous SQL query. If there were pending asynchronous queries in the queue, the pending queries are drained first. The query must not return any results.
public ACR_SQLExecute ( string SQL ) : void
SQL string Supplies the SQL query text to execute.
return void

ACR_SQLFetch() public method

This routine fetches the next rowset from the database.
public ACR_SQLFetch ( ) : bool
return bool

ACR_SQLGetAffectedRows() public method

This routine returns the number of rows affected by a query.
public ACR_SQLGetAffectedRows ( ) : int
return int

ACR_SQLGetData() public method

This routine returns the first column of data from the current SQL rowset.
public ACR_SQLGetData ( ) : string
return string

ACR_SQLGetData() public method

This routine returns the specified column of data from the current SQL rowset.
public ACR_SQLGetData ( int ColumnIndex ) : string
ColumnIndex int Supplies the zero-based column index to /// retrieve.
return string

ACR_SQLQuery() public method

This routine performs a synchronous SQL query. If there were pending asynchronous queries in the queue, the pending queries are drained first.
public ACR_SQLQuery ( string SQL ) : void
SQL string Supplies the SQL query text to execute.
return void

Dispose() public method

Dispose the object.
public Dispose ( ) : void
return void