class SqlManager expands Object native;


/*
SqlManager - read/write to SQL databases
Created by Chris

NOTE:
When this class is about to be compiled, it will ask to update the native header file, always chose NO.
Otherwise it will render the native code uncompileable
Please check the test class for examples.
*/
var native const  bool bInitialized;				//Set to true when properly initialized.
var native const  bool bConnected;					//Set to true when sucessfully connected
var native bool bLogErrors;							//Set to true in order to show errors in console

const CON_OK 	= 0x00;
const CON_WRUSR = 0x02;
const CON_WRPSW = 0x04;
const CON_NODB  = 0x08;
const QUR_UNK	= 0x10;
const QUR_NORES	= 0x20;
const CON_NOINIT= 0x40;
const CON_UNK	= 0x80;
const CON_NOCON = 0xFF;

//Returns a string with the format COUNTRY:ISO, for example SWEDEN:SE
//No other function has to be called before, in order to call this.
native(2050) final function string GetIpToCountry(string IP);

//Call this first of all
native(2051) final function Init();

//Call this to connect to the SQL server.
native(2052) final function byte Connect(string Address,int Port/*default 3306*/, string Username, string Password);

//Call this to select database.
native(2053) final function byte SetDatabase(string Database);

//Call this to execute a command on the database.
native(2054) final function byte Query(string Command);

//To be used in the iterator to return a result from a specific column.
native(2057) final function String GetColumn(int Column);

//Get number of columns
native(2058) final function int GetNumColumns();

//Get number of rows
native(2059) final function int GetNumRows();

//Iterate through the results.
native(2055) final function iterator Results(out int Row);

