#include <database.mod/core.mod/.bmx/core.bmx.release.win32.x86.h>
struct BBString_2{BBClass_String* clas;BBULONG hash;int length;BBChar buf[2];};
struct BBString_3{BBClass_String* clas;BBULONG hash;int length;BBChar buf[3];};
struct BBString_1{BBClass_String* clas;BBULONG hash;int length;BBChar buf[1];};
struct BBString_30{BBClass_String* clas;BBULONG hash;int length;BBChar buf[30];};
struct BBString_26{BBClass_String* clas;BBULONG hash;int length;BBChar buf[26];};
static struct BBString_2 _s4={
	&bbStringClass,
	0xb3d306f1da4cd9f0,
	2,
	{32,40}
};
static struct BBString_3 _s0={
	&bbStringClass,
	0xbea3f92bcaaf0b1d,
	3,
	{32,58,32}
};
static struct BBString_1 _s6={
	&bbStringClass,
	0x8a44f19b176dda60,
	1,
	{40}
};
static struct BBString_2 _s5={
	&bbStringClass,
	0xf763be77595cfe8d,
	2,
	{41,32}
};
static struct BBString_1 _s7={
	&bbStringClass,
	0x8439ccbd1c202210,
	1,
	{48}
};
static struct BBString_1 _s8={
	&bbStringClass,
	0xfdc4d37c65200cd0,
	1,
	{49}
};
static struct BBString_1 _s9={
	&bbStringClass,
	0x6bd73b99053ed236,
	1,
	{50}
};
static struct BBString_1 _s10={
	&bbStringClass,
	0x8c9b4fbc092099db,
	1,
	{51}
};
static struct BBString_1 _s11={
	&bbStringClass,
	0xfe87825f1bdc84d9,
	1,
	{52}
};
static struct BBString_30 _s3={
	&bbStringClass,
	0xecb6b1a8fc42380f,
	30,
	{67,97,110,110,111,116,32,101,120,101,99,117,116,101,32,101,109
	,112,116,121,32,115,116,97,116,101,109,101,110,116}
};
static struct BBString_30 _s1={
	&bbStringClass,
	0xcad5f072e9cc2281,
	30,
	{67,97,110,110,111,116,32,112,114,101,112,97,114,101,32,101,109
	,112,116,121,32,115,116,97,116,101,109,101,110,116}
};
static struct BBString_26 _s2={
	&bbStringClass,
	0x84467918b4b7e76,
	26,
	{84,104,101,32,99,111,110,110,101,99,116,105,111,110,32,105,115
	,32,110,111,116,32,111,112,101,110}
};
struct BBDebugScope_12{int kind; const char *name; BBDebugDecl decls[13]; };
struct BBDebugScope_15{int kind; const char *name; BBDebugDecl decls[16]; };
struct BBDebugScope_22{int kind; const char *name; BBDebugDecl decls[23]; };
struct BBDebugScope_25{int kind; const char *name; BBDebugDecl decls[26]; };
struct BBDebugScope_27{int kind; const char *name; BBDebugDecl decls[28]; };
struct BBDebugScope_28{int kind; const char *name; BBDebugDecl decls[29]; };
struct BBDebugScope_3{int kind; const char *name; BBDebugDecl decls[4]; };
struct BBDebugScope_5{int kind; const char *name; BBDebugDecl decls[6]; };
struct BBDebugScope_6{int kind; const char *name; BBDebugDecl decls[7]; };
struct database_core_TDatabaseLoader_obj* database_core__loaders=(struct database_core_TDatabaseLoader_obj*)((struct database_core_TDatabaseLoader_obj*)&bbNullObject);
void _database_core_TDatabaseLoader_New(struct database_core_TDatabaseLoader_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDatabaseLoader;
	o->_database_core_tdatabaseloader__type = ((BBString*)&bbEmptyString);
	o->_database_core_tdatabaseloader__succ = (struct database_core_TDatabaseLoader_obj*)((struct database_core_TDatabaseLoader_obj*)&bbNullObject);
}
struct database_core_TDBConnection_obj* _database_core_TDatabaseLoader_LoadDatabase_SSiSSSS(struct database_core_TDatabaseLoader_obj* o,BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	brl_blitz_NullMethodError();
	return (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
}
struct BBDebugScope_3 database_core_TDatabaseLoader_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDatabaseLoader",
	{
		{
			BBDEBUGDECL_FIELD,
			"_type",
			"$",
			.field_offset=offsetof(struct database_core_TDatabaseLoader_obj,_database_core_tdatabaseloader__type)
		},
		{
			BBDEBUGDECL_FIELD,
			"_succ",
			":TDatabaseLoader",
			.field_offset=offsetof(struct database_core_TDatabaseLoader_obj,_database_core_tdatabaseloader__succ)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseLoader_New
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDatabaseLoader database_core_TDatabaseLoader={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDatabaseLoader_scope,
	sizeof(struct database_core_TDatabaseLoader_obj),
	(void (*)(BBOBJECT))_database_core_TDatabaseLoader_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDatabaseLoader_obj,_database_core_tdatabaseloader__succ) - offsetof(struct database_core_TDatabaseLoader_obj,_database_core_tdatabaseloader__type) + sizeof(struct database_core_TDatabaseLoader_obj*)
	,0
	,offsetof(struct database_core_TDatabaseLoader_obj,_database_core_tdatabaseloader__type)
	,_database_core_TDatabaseLoader_LoadDatabase_SSiSSSS
};

void _database_core_TDBConnection_New(struct database_core_TDBConnection_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDBConnection;
	o->_database_core_tdbconnection_handle = 0;
	o->_database_core_tdbconnection__dbname = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__host = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__port = 0;
	o->_database_core_tdbconnection__user = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__password = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__options = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__server = ((BBString*)&bbEmptyString);
	o->_database_core_tdbconnection__isopen = 0;
	o->_database_core_tdbconnection__lasterror = (struct database_core_TDatabaseError_obj*)((struct database_core_TDatabaseError_obj*)&bbNullObject);
}
void _database_core_TDBConnection_Delete(struct database_core_TDBConnection_obj* o) {
	((struct database_core_TDBConnection_obj*)o)->clas->m_free((struct database_core_TDBConnection_obj*)o);
	BBRELEASE(o->_database_core_tdbconnection__dbname )
	BBRELEASE(o->_database_core_tdbconnection__host )
	BBRELEASE(o->_database_core_tdbconnection__user )
	BBRELEASE(o->_database_core_tdbconnection__password )
	BBRELEASE(o->_database_core_tdbconnection__options )
	BBRELEASE(o->_database_core_tdbconnection__server )
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TDBConnection_obj* database_core_TDBConnection_Create_TTDBConnection_SSiSSSS(BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	brl_blitz_NullMethodError();
	return (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
}
void _database_core_TDBConnection_Init_SSiSSSS(struct database_core_TDBConnection_obj* o,BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	o->_database_core_tdbconnection__dbname =bbt_dbname;
	o->_database_core_tdbconnection__host =bbt_host;
	o->_database_core_tdbconnection__port =bbt_port;
	o->_database_core_tdbconnection__user =bbt_user;
	o->_database_core_tdbconnection__password =bbt_password;
	o->_database_core_tdbconnection__options =bbt_options;
	o->_database_core_tdbconnection__server =bbt_server;
}
void _database_core_TDBConnection_close(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
}
BBINT _database_core_TDBConnection_commit(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBARRAY _database_core_TDBConnection_getTables(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return (&bbEmptyArray);
}
struct database_core_TDBTable_obj* _database_core_TDBConnection_getTableInfo_Si(struct database_core_TDBConnection_obj* o,BBSTRING bbt_tableName,BBINT bbt_withDDL){
	brl_blitz_NullMethodError();
	return (struct database_core_TDBTable_obj*)((struct database_core_TDBTable_obj*)&bbNullObject);
}
BBINT _database_core_TDBConnection_open_SS(struct database_core_TDBConnection_obj* o,BBSTRING bbt_user,BBSTRING bbt_pass){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TDBConnection_rollback(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TDBConnection_startTransaction(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
struct database_core_TDatabaseQuery_obj* _database_core_TDBConnection_executeQuery_S(struct database_core_TDBConnection_obj* o,BBSTRING bbt_sql){
	((struct database_core_TDBConnection_obj*)o)->clas->m_resetError((struct database_core_TDBConnection_obj*)o);
	struct database_core_TDatabaseQuery_obj* bbt_query=(struct database_core_TDatabaseQuery_obj*)database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection((struct database_core_TDBConnection_obj*)o);
	if((bbt_sql!= &bbEmptyString) && ((bbt_sql->length)>0)){
		if((bbt_query)->clas->m_execute_S((struct database_core_TDatabaseQuery_obj*)bbt_query,bbt_sql)!=0){
			((struct database_core_TDBConnection_obj*)o)->clas->m_resetError((struct database_core_TDBConnection_obj*)o);
		}
	}
	return (struct database_core_TDatabaseQuery_obj*)bbt_query;
}
BBINT _database_core_TDBConnection_isOpen(struct database_core_TDBConnection_obj* o){
	return o->_database_core_tdbconnection__isopen ;
}
BBSTRING _database_core_TDBConnection_getDatabaseName(struct database_core_TDBConnection_obj* o){
	return o->_database_core_tdbconnection__dbname ;
}
BBSTRING _database_core_TDBConnection_getHost(struct database_core_TDBConnection_obj* o){
	return o->_database_core_tdbconnection__dbname ;
}
BBINT _database_core_TDBConnection_getPortNumber(struct database_core_TDBConnection_obj* o){
	return o->_database_core_tdbconnection__port ;
}
struct database_core_TDatabaseError_obj* _database_core_TDBConnection_error(struct database_core_TDBConnection_obj* o){
	if(!(((BBObject*)o->_database_core_tdbconnection__lasterror )!= &bbNullObject)){
		o->_database_core_tdbconnection__lasterror =(struct database_core_TDatabaseError_obj*)(struct database_core_TDatabaseError_obj*)bbObjectNew((BBClass *)&database_core_TDatabaseError);
	}
	return (struct database_core_TDatabaseError_obj*)o->_database_core_tdbconnection__lasterror ;
}
void _database_core_TDBConnection_resetError(struct database_core_TDBConnection_obj* o){
	if(((BBObject*)o->_database_core_tdbconnection__lasterror )!= &bbNullObject){
		(o->_database_core_tdbconnection__lasterror )->clas->m_reset((struct database_core_TDatabaseError_obj*)o->_database_core_tdbconnection__lasterror );
	}
}
BBINT _database_core_TDBConnection_hasError(struct database_core_TDBConnection_obj* o){
	if(((BBObject*)o->_database_core_tdbconnection__lasterror )!= &bbNullObject){
		return (o->_database_core_tdbconnection__lasterror )->clas->m_isSet((struct database_core_TDatabaseError_obj*)o->_database_core_tdbconnection__lasterror );
	}
	return 0;
}
void _database_core_TDBConnection_setError_SSii(struct database_core_TDBConnection_obj* o,BBSTRING bbt_error,BBSTRING bbt_append,BBINT bbt_eType,BBINT bbt_errorValue){
	if(!(((BBObject*)o->_database_core_tdbconnection__lasterror )!= &bbNullObject)){
		o->_database_core_tdbconnection__lasterror =(struct database_core_TDatabaseError_obj*)database_core_TDatabaseError_Create_TTDatabaseError_TTDBConnectionSSii((struct database_core_TDBConnection_obj*)o,bbt_error,bbt_append,bbt_eType,bbt_errorValue);
	}else{
		o->_database_core_tdbconnection__lasterror ->_database_core_tdatabaseerror_error =bbt_error;
		if(bbt_append!= &bbEmptyString){
			o->_database_core_tdbconnection__lasterror ->_database_core_tdatabaseerror_error =bbStringConcat(o->_database_core_tdbconnection__lasterror ->_database_core_tdatabaseerror_error ,(bbStringConcat(((BBString*)&_s0),bbt_append)));
		}
		o->_database_core_tdbconnection__lasterror ->_database_core_tdatabaseerror_errorvalue =bbt_errorValue;
		o->_database_core_tdbconnection__lasterror ->_database_core_tdatabaseerror_errortype =bbt_eType;
	}
}
BBBYTE* _database_core_TDBConnection_databaseHandle(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
struct database_core_TQueryResultSet_obj* _database_core_TDBConnection_createResultSet(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return (struct database_core_TQueryResultSet_obj*)((struct database_core_TQueryResultSet_obj*)&bbNullObject);
}
BBSTRING _database_core_TDBConnection_nativeErrorMessage_i(struct database_core_TDBConnection_obj* o,BBINT bbt_err){
	brl_blitz_NullMethodError();
	return ((BBString*)&bbEmptyString);
}
BBINT _database_core_TDBConnection_hasPrepareSupport(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TDBConnection_hasTransactionSupport(struct database_core_TDBConnection_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
void _database_core_TDBConnection_free(struct database_core_TDBConnection_obj* o){
	if(((BBObject*)o->_database_core_tdbconnection__lasterror )!= &bbNullObject){
		o->_database_core_tdbconnection__lasterror =(struct database_core_TDatabaseError_obj*)&bbNullObject;
	}
}
struct BBDebugScope_22 database_core_TDBConnection_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDBConnection",
	{
		{
			BBDEBUGDECL_FIELD,
			"handle",
			"*b",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection_handle)
		},
		{
			BBDEBUGDECL_FIELD,
			"_dbname",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__dbname)
		},
		{
			BBDEBUGDECL_FIELD,
			"_host",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__host)
		},
		{
			BBDEBUGDECL_FIELD,
			"_port",
			"i",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__port)
		},
		{
			BBDEBUGDECL_FIELD,
			"_user",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__user)
		},
		{
			BBDEBUGDECL_FIELD,
			"_password",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__password)
		},
		{
			BBDEBUGDECL_FIELD,
			"_options",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__options)
		},
		{
			BBDEBUGDECL_FIELD,
			"_server",
			"$",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__server)
		},
		{
			BBDEBUGDECL_FIELD,
			"_isOpen",
			"i",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__isopen)
		},
		{
			BBDEBUGDECL_FIELD,
			"_lastError",
			":TDatabaseError",
			.field_offset=offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__lasterror)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"Init",
			"($,$,i,$,$,$,$)",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_Init_SSiSSSS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"executeQuery",
			"($):TDatabaseQuery",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_executeQuery_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isOpen",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_isOpen
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getDatabaseName",
			"()$",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_getDatabaseName
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getHost",
			"()$",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_getHost
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getPortNumber",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_getPortNumber
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"error",
			"():TDatabaseError",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_error
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"resetError",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_resetError
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"hasError",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_hasError
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setError",
			"($,$,i,i)",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_setError_SSii
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"free",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDBConnection_free
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDBConnection database_core_TDBConnection={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDBConnection_scope,
	sizeof(struct database_core_TDBConnection_obj),
	(void (*)(BBOBJECT))_database_core_TDBConnection_New,
	(void (*)(BBOBJECT))_database_core_TDBConnection_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection__lasterror) - offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection_handle) + sizeof(struct database_core_TDatabaseError_obj*)
	,0
	,offsetof(struct database_core_TDBConnection_obj,_database_core_tdbconnection_handle)
	,database_core_TDBConnection_Create_TTDBConnection_SSiSSSS
	,_database_core_TDBConnection_Init_SSiSSSS
	,_database_core_TDBConnection_close
	,_database_core_TDBConnection_commit
	,_database_core_TDBConnection_getTables
	,_database_core_TDBConnection_getTableInfo_Si
	,_database_core_TDBConnection_open_SS
	,_database_core_TDBConnection_rollback
	,_database_core_TDBConnection_startTransaction
	,_database_core_TDBConnection_executeQuery_S
	,_database_core_TDBConnection_isOpen
	,_database_core_TDBConnection_getDatabaseName
	,_database_core_TDBConnection_getHost
	,_database_core_TDBConnection_getPortNumber
	,_database_core_TDBConnection_error
	,_database_core_TDBConnection_resetError
	,_database_core_TDBConnection_hasError
	,_database_core_TDBConnection_setError_SSii
	,_database_core_TDBConnection_databaseHandle
	,_database_core_TDBConnection_createResultSet
	,_database_core_TDBConnection_nativeErrorMessage_i
	,_database_core_TDBConnection_hasPrepareSupport
	,_database_core_TDBConnection_hasTransactionSupport
	,_database_core_TDBConnection_free
};

void _database_core_TDatabaseQuery_New(struct database_core_TDatabaseQuery_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDatabaseQuery;
	o->_database_core_tdatabasequery_conn = (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
	o->_database_core_tdatabasequery_resultset = (struct database_core_TQueryResultSet_obj*)((struct database_core_TQueryResultSet_obj*)&bbNullObject);
}
void _database_core_TDatabaseQuery_Delete(struct database_core_TDatabaseQuery_obj* o) {
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_free((struct database_core_TDatabaseQuery_obj*)o);
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TDatabaseQuery_obj* database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection(struct database_core_TDBConnection_obj* bbt_connection){
	struct database_core_TDatabaseQuery_obj* bbt_this=(struct database_core_TDatabaseQuery_obj*)(struct database_core_TDatabaseQuery_obj*)bbObjectNew((BBClass *)&database_core_TDatabaseQuery);
	bbt_this->_database_core_tdatabasequery_conn =(struct database_core_TDBConnection_obj*)bbt_connection;
	return (struct database_core_TDatabaseQuery_obj*)bbt_this;
}
BBINT _database_core_TDatabaseQuery_prepare_S(struct database_core_TDatabaseQuery_obj* o,BBSTRING bbt_statement){
	if(!(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject)){
		o->_database_core_tdatabasequery_resultset =(struct database_core_TQueryResultSet_obj*)(o->_database_core_tdatabasequery_conn )->clas->m_createResultSet((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn );
	}else{
		(o->_database_core_tdatabasequery_resultset )->clas->m_clear((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
		o->_database_core_tdatabasequery_resultset ->_database_core_tqueryresultset__isactive =0;
	}
	if(bbStringEquals(bbt_statement, (&bbEmptyString))==1 || ((bbt_statement->length)==0)){
		(o->_database_core_tdatabasequery_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn ,((BBString*)&_s1),(&bbEmptyString),3,0);
		return 0;
	}
	o->_database_core_tdatabasequery_resultset ->_database_core_tqueryresultset_query =bbStringTrim((BBSTRING)bbt_statement);
	if(!((o->_database_core_tdatabasequery_conn )->clas->m_isOpen((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn )!=0)){
		(o->_database_core_tdatabasequery_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn ,((BBString*)&_s2),(&bbEmptyString),2,0);
		return 0;
	}
	if((o->_database_core_tdatabasequery_resultset )->clas->m_prepare_S((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,bbt_statement)!=0){
		if(((BBObject*)o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror )!= &bbNullObject){
			struct database_core_TDatabaseError_obj* bbt_;
			(((struct database_core_TDatabaseError_obj*)(bbt_ = o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror ))->clas)->m_reset((struct database_core_TDatabaseError_obj*)bbt_);
		}
		return 1;
	}else{
		return 0;
	}
}
BBINT _database_core_TDatabaseQuery_execute_S(struct database_core_TDatabaseQuery_obj* o,BBSTRING bbt_statement){
	if(bbt_statement!= &bbEmptyString){
		if(!(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject)){
			o->_database_core_tdatabasequery_resultset =(struct database_core_TQueryResultSet_obj*)(o->_database_core_tdatabasequery_conn )->clas->m_createResultSet((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn );
		}else{
			(o->_database_core_tdatabasequery_resultset )->clas->m_clear((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
			o->_database_core_tdatabasequery_resultset ->_database_core_tqueryresultset__isactive =0;
		}
		if((bbStringTrim((BBSTRING)bbt_statement)->length)==0){
			(o->_database_core_tdatabasequery_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn ,((BBString*)&_s3),(&bbEmptyString),3,0);
			return 0;
		}
		o->_database_core_tdatabasequery_resultset ->_database_core_tqueryresultset_query =bbStringTrim((BBSTRING)bbt_statement);
		if(!((o->_database_core_tdatabasequery_conn )->clas->m_isOpen((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn )!=0)){
			(o->_database_core_tdatabasequery_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn ,((BBString*)&_s2),(&bbEmptyString),2,0);
			return 0;
		}
		if((o->_database_core_tdatabasequery_resultset )->clas->m_executeQuery_S((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,bbt_statement)!=0){
			if(((BBObject*)o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror )!= &bbNullObject){
				struct database_core_TDatabaseError_obj* bbt_;
				(((struct database_core_TDatabaseError_obj*)(bbt_ = o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror ))->clas)->m_reset((struct database_core_TDatabaseError_obj*)bbt_);
			}
			return 1;
		}else{
			return 0;
		}
	}else{
		if(!((o->_database_core_tdatabasequery_conn )->clas->m_isOpen((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn )!=0)){
			(o->_database_core_tdatabasequery_conn )->clas->m_setError_SSii((struct database_core_TDBConnection_obj*)o->_database_core_tdatabasequery_conn ,((BBString*)&_s2),(&bbEmptyString),2,0);
			return 0;
		}
		if((o->_database_core_tdatabasequery_resultset )->clas->m_execute((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset )!=0){
			if(((BBObject*)o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror )!= &bbNullObject){
				struct database_core_TDatabaseError_obj* bbt_2;
				(((struct database_core_TDatabaseError_obj*)(bbt_2 = o->_database_core_tdatabasequery_conn ->_database_core_tdbconnection__lasterror ))->clas)->m_reset((struct database_core_TDatabaseError_obj*)bbt_2);
			}
			return 1;
		}else{
			return 0;
		}
	}
}
struct database_core_dbtypes_TDBType_obj* _database_core_TDatabaseQuery_value_i(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_index){
	if((((struct database_core_TDatabaseQuery_obj*)o)->clas->m_isActive((struct database_core_TDatabaseQuery_obj*)o)!=0) && (bbt_index>-1)){
		return (struct database_core_dbtypes_TDBType_obj*)(o->_database_core_tdatabasequery_resultset )->clas->m_dataValue_i((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,bbt_index);
	}
	return (struct database_core_dbtypes_TDBType_obj*)&bbNullObject;
}
BBINT _database_core_TDatabaseQuery_nextRow(struct database_core_TDatabaseQuery_obj* o){
	if(!(((struct database_core_TDatabaseQuery_obj*)o)->clas->m_isActive((struct database_core_TDatabaseQuery_obj*)o)!=0)){
		return 0;
	}
	BBINT bbt_result=0;
	BBINT bbt_=((struct database_core_TDatabaseQuery_obj*)o)->clas->m_rowIndex((struct database_core_TDatabaseQuery_obj*)o);
	if(bbt_==-1){
		bbt_result=(o->_database_core_tdatabasequery_resultset )->clas->m_firstRow((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
		return bbt_result;
	}else{
		if(bbt_==-2){
			return 0;
		}else{
			if(!((o->_database_core_tdatabasequery_resultset )->clas->m_nextRow((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset )!=0)){
				(o->_database_core_tdatabasequery_resultset )->clas->m_setRowIndex_i((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,-2);
				(o->_database_core_tdatabasequery_resultset )->clas->m_reset((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
				return 0;
			}
		}
	}
	return 1;
}
BBINT _database_core_TDatabaseQuery_isActive(struct database_core_TDatabaseQuery_obj* o){
	return ((((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject) && ((o->_database_core_tdatabasequery_resultset )->clas->m_isActive((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset )!=0));
}
BBINT _database_core_TDatabaseQuery_rowIndex(struct database_core_TDatabaseQuery_obj* o){
	return (o->_database_core_tdatabasequery_resultset )->clas->m_rowIndex((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
}
struct database_core_TQueryRecord_obj* _database_core_TDatabaseQuery_rowRecord(struct database_core_TDatabaseQuery_obj* o){
	struct database_core_TQueryRecord_obj* bbt_r=(struct database_core_TQueryRecord_obj*)(o->_database_core_tdatabasequery_resultset )->clas->m_rowRecord((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
	if((o->_database_core_tdatabasequery_resultset )->clas->m_isValid((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset )!=0){
		BBINT bbt_c=(bbt_r)->clas->m_count((struct database_core_TQueryRecord_obj*)bbt_r);
		{
			BBINT bbt_i=0;
			BBINT bbt_=bbt_c;
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				(bbt_r)->clas->m_setValue_iTObject((struct database_core_TQueryRecord_obj*)bbt_r,bbt_i,(BBOBJECT)((struct database_core_TDatabaseQuery_obj*)o)->clas->m_value_i((struct database_core_TDatabaseQuery_obj*)o,bbt_i));
			}
		}
	}
	return (struct database_core_TQueryRecord_obj*)bbt_r;
}
void _database_core_TDatabaseQuery_bindValue_iTTDBType(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,struct database_core_dbtypes_TDBType_obj* bbt_value){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		(o->_database_core_tdatabasequery_resultset )->clas->m_bindValue_iTTDBType((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,bbt_position,(struct database_core_dbtypes_TDBType_obj*)bbt_value);
	}
}
void _database_core_TDatabaseQuery_addBindValue_TTDBType(struct database_core_TDatabaseQuery_obj* o,struct database_core_dbtypes_TDBType_obj* bbt_value){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		(o->_database_core_tdatabasequery_resultset )->clas->m_addBindValue_TTDBType((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset ,(struct database_core_dbtypes_TDBType_obj*)bbt_value);
	}
}
void _database_core_TDatabaseQuery_setString_iS(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,BBSTRING bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TDatabaseQuery_obj*)o,bbt_position,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBString_Set_TTDBString_S(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_setInt_ii(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,BBINT bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TDatabaseQuery_obj*)o,bbt_position,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBInt_Set_TTDBInt_i(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_setLong_il(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,BBLONG bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TDatabaseQuery_obj*)o,bbt_position,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBLong_Set_TTDBLong_l(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_setFloat_if(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,BBFLOAT bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TDatabaseQuery_obj*)o,bbt_position,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBFloat_Set_TTDBFloat_f(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_setDouble_id(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_position,BBDOUBLE bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TDatabaseQuery_obj*)o,bbt_position,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDouble_Set_TTDBDouble_d(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_addString_S(struct database_core_TDatabaseQuery_obj* o,BBSTRING bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_addBindValue_TTDBType((struct database_core_TDatabaseQuery_obj*)o,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBString_Set_TTDBString_S(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_addInt_i(struct database_core_TDatabaseQuery_obj* o,BBINT bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_addBindValue_TTDBType((struct database_core_TDatabaseQuery_obj*)o,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBInt_Set_TTDBInt_i(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_addLong_l(struct database_core_TDatabaseQuery_obj* o,BBLONG bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_addBindValue_TTDBType((struct database_core_TDatabaseQuery_obj*)o,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBLong_Set_TTDBLong_l(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_addFloat_f(struct database_core_TDatabaseQuery_obj* o,BBFLOAT bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_addBindValue_TTDBType((struct database_core_TDatabaseQuery_obj*)o,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBFloat_Set_TTDBFloat_f(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_addDouble_d(struct database_core_TDatabaseQuery_obj* o,BBDOUBLE bbt_value){
	((struct database_core_TDatabaseQuery_obj*)o)->clas->m_addBindValue_TTDBType((struct database_core_TDatabaseQuery_obj*)o,(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)database_core_dbtypes_TDBDouble_Set_TTDBDouble_d(bbt_value),(BBClass*)&database_core_dbtypes_TDBType)));
}
void _database_core_TDatabaseQuery_clearBindValues(struct database_core_TDatabaseQuery_obj* o){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		(o->_database_core_tdatabasequery_resultset )->clas->m_clearBindValues((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
	}
}
BBLONG _database_core_TDatabaseQuery_lastInsertedId(struct database_core_TDatabaseQuery_obj* o){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		return (o->_database_core_tdatabasequery_resultset )->clas->m_lastInsertedId((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
	}
	return 0LL;
}
BBINT _database_core_TDatabaseQuery_rowsAffected(struct database_core_TDatabaseQuery_obj* o){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		return (o->_database_core_tdatabasequery_resultset )->clas->m_rowsAffected((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
	}
	return -1;
}
struct database_core_TRowEnumerator_obj* _database_core_TDatabaseQuery_ObjectEnumerator(struct database_core_TDatabaseQuery_obj* o){
	struct database_core_TRowEnumerator_obj* bbt_enumerator=(struct database_core_TRowEnumerator_obj*)(struct database_core_TRowEnumerator_obj*)bbObjectNew((BBClass *)&database_core_TRowEnumerator);
	bbt_enumerator->_database_core_trowenumerator_query =(struct database_core_TDatabaseQuery_obj*)o;
	return (struct database_core_TRowEnumerator_obj*)bbt_enumerator;
}
void _database_core_TDatabaseQuery_free(struct database_core_TDatabaseQuery_obj* o){
	if(((BBObject*)o->_database_core_tdatabasequery_resultset )!= &bbNullObject){
		(o->_database_core_tdatabasequery_resultset )->clas->m_free((struct database_core_TQueryResultSet_obj*)o->_database_core_tdatabasequery_resultset );
		o->_database_core_tdatabasequery_resultset =(struct database_core_TQueryResultSet_obj*)&bbNullObject;
	}
	if(((BBObject*)o->_database_core_tdatabasequery_conn )!= &bbNullObject){
		o->_database_core_tdatabasequery_conn =(struct database_core_TDBConnection_obj*)&bbNullObject;
	}
}
struct BBDebugScope_28 database_core_TDatabaseQuery_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDatabaseQuery",
	{
		{
			BBDEBUGDECL_FIELD,
			"conn",
			":TDBConnection",
			.field_offset=offsetof(struct database_core_TDatabaseQuery_obj,_database_core_tdatabasequery_conn)
		},
		{
			BBDEBUGDECL_FIELD,
			"resultSet",
			":TQueryResultSet",
			.field_offset=offsetof(struct database_core_TDatabaseQuery_obj,_database_core_tdatabasequery_resultset)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"(:TDBConnection):TDatabaseQuery",
			.func_ptr=(BBFuncPtr)&database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"prepare",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_prepare_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"execute",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_execute_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"value",
			"(i):TDBType",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_value_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nextRow",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_nextRow
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isActive",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_isActive
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowIndex",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_rowIndex
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowRecord",
			"():TQueryRecord",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_rowRecord
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"bindValue",
			"(i,:TDBType)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_bindValue_iTTDBType
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addBindValue",
			"(:TDBType)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addBindValue_TTDBType
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setString",
			"(i,$)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_setString_iS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setInt",
			"(i,i)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_setInt_ii
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setLong",
			"(i,l)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_setLong_il
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setFloat",
			"(i,f)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_setFloat_if
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setDouble",
			"(i,d)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_setDouble_id
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addString",
			"($)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addString_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addInt",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addInt_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addLong",
			"(l)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addLong_l
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addFloat",
			"(f)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addFloat_f
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addDouble",
			"(d)",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_addDouble_d
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clearBindValues",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_clearBindValues
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"lastInsertedId",
			"()l",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_lastInsertedId
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowsAffected",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_rowsAffected
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"ObjectEnumerator",
			"():TRowEnumerator",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_ObjectEnumerator
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"free",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseQuery_free
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDatabaseQuery database_core_TDatabaseQuery={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDatabaseQuery_scope,
	sizeof(struct database_core_TDatabaseQuery_obj),
	(void (*)(BBOBJECT))_database_core_TDatabaseQuery_New,
	(void (*)(BBOBJECT))_database_core_TDatabaseQuery_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDatabaseQuery_obj,_database_core_tdatabasequery_resultset) - offsetof(struct database_core_TDatabaseQuery_obj,_database_core_tdatabasequery_conn) + sizeof(struct database_core_TQueryResultSet_obj*)
	,0
	,offsetof(struct database_core_TDatabaseQuery_obj,_database_core_tdatabasequery_conn)
	,database_core_TDatabaseQuery_Create_TTDatabaseQuery_TTDBConnection
	,_database_core_TDatabaseQuery_prepare_S
	,_database_core_TDatabaseQuery_execute_S
	,_database_core_TDatabaseQuery_value_i
	,_database_core_TDatabaseQuery_nextRow
	,_database_core_TDatabaseQuery_isActive
	,_database_core_TDatabaseQuery_rowIndex
	,_database_core_TDatabaseQuery_rowRecord
	,_database_core_TDatabaseQuery_bindValue_iTTDBType
	,_database_core_TDatabaseQuery_addBindValue_TTDBType
	,_database_core_TDatabaseQuery_setString_iS
	,_database_core_TDatabaseQuery_setInt_ii
	,_database_core_TDatabaseQuery_setLong_il
	,_database_core_TDatabaseQuery_setFloat_if
	,_database_core_TDatabaseQuery_setDouble_id
	,_database_core_TDatabaseQuery_addString_S
	,_database_core_TDatabaseQuery_addInt_i
	,_database_core_TDatabaseQuery_addLong_l
	,_database_core_TDatabaseQuery_addFloat_f
	,_database_core_TDatabaseQuery_addDouble_d
	,_database_core_TDatabaseQuery_clearBindValues
	,_database_core_TDatabaseQuery_lastInsertedId
	,_database_core_TDatabaseQuery_rowsAffected
	,_database_core_TDatabaseQuery_ObjectEnumerator
	,_database_core_TDatabaseQuery_free
};

void _database_core_TRowEnumerator_New(struct database_core_TRowEnumerator_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TRowEnumerator;
	o->_database_core_trowenumerator_query = (struct database_core_TDatabaseQuery_obj*)((struct database_core_TDatabaseQuery_obj*)&bbNullObject);
	o->_database_core_trowenumerator_record = (struct database_core_TQueryRecord_obj*)((struct database_core_TQueryRecord_obj*)&bbNullObject);
}
void _database_core_TRowEnumerator_Delete(struct database_core_TRowEnumerator_obj* o) {
	o->_database_core_trowenumerator_query =(struct database_core_TDatabaseQuery_obj*)&bbNullObject;
	o->_database_core_trowenumerator_record =(struct database_core_TQueryRecord_obj*)&bbNullObject;
	bbObjectDtor((BBOBJECT)o);
}
BBINT _database_core_TRowEnumerator_HasNext(struct database_core_TRowEnumerator_obj* o){
	BBINT bbt_result=(o->_database_core_trowenumerator_query )->clas->m_nextRow((struct database_core_TDatabaseQuery_obj*)o->_database_core_trowenumerator_query );
	if(bbt_result!=0){
		o->_database_core_trowenumerator_record =(struct database_core_TQueryRecord_obj*)(o->_database_core_trowenumerator_query )->clas->m_rowRecord((struct database_core_TDatabaseQuery_obj*)o->_database_core_trowenumerator_query );
		if(o->_database_core_trowenumerator_record ->_database_core_tqueryrecord__isemptyset !=0){
			return 0;
		}
	}
	return bbt_result;
}
BBOBJECT _database_core_TRowEnumerator_NextObject(struct database_core_TRowEnumerator_obj* o){
	return (BBOBJECT)o->_database_core_trowenumerator_record ;
}
struct BBDebugScope_5 database_core_TRowEnumerator_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TRowEnumerator",
	{
		{
			BBDEBUGDECL_FIELD,
			"query",
			":TDatabaseQuery",
			.field_offset=offsetof(struct database_core_TRowEnumerator_obj,_database_core_trowenumerator_query)
		},
		{
			BBDEBUGDECL_FIELD,
			"record",
			":TQueryRecord",
			.field_offset=offsetof(struct database_core_TRowEnumerator_obj,_database_core_trowenumerator_record)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TRowEnumerator_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"HasNext",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TRowEnumerator_HasNext
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"NextObject",
			"():Object",
			.func_ptr=(BBFuncPtr)&_database_core_TRowEnumerator_NextObject
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TRowEnumerator database_core_TRowEnumerator={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TRowEnumerator_scope,
	sizeof(struct database_core_TRowEnumerator_obj),
	(void (*)(BBOBJECT))_database_core_TRowEnumerator_New,
	(void (*)(BBOBJECT))_database_core_TRowEnumerator_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TRowEnumerator_obj,_database_core_trowenumerator_record) - offsetof(struct database_core_TRowEnumerator_obj,_database_core_trowenumerator_query) + sizeof(struct database_core_TQueryRecord_obj*)
	,0
	,offsetof(struct database_core_TRowEnumerator_obj,_database_core_trowenumerator_query)
	,_database_core_TRowEnumerator_HasNext
	,_database_core_TRowEnumerator_NextObject
};

void _database_core_TQueryResultSet_New(struct database_core_TQueryResultSet_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TQueryResultSet;
	o->_database_core_tqueryresultset_conn = (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
	o->_database_core_tqueryresultset_stmthandle = 0;
	o->_database_core_tqueryresultset_query = ((BBString*)&bbEmptyString);
	o->_database_core_tqueryresultset__isactive = 0;
	o->_database_core_tqueryresultset_index = -1;
	o->_database_core_tqueryresultset_values = (&bbEmptyArray);
	o->_database_core_tqueryresultset_bindcount = 0;
	o->_database_core_tqueryresultset_boundvalues = (&bbEmptyArray);
	o->_database_core_tqueryresultset_rec = (struct database_core_TQueryRecord_obj*)((struct database_core_TQueryRecord_obj*)&bbNullObject);
}
void _database_core_TQueryResultSet_Delete(struct database_core_TQueryResultSet_obj* o) {
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_free((struct database_core_TQueryResultSet_obj*)o);
	BBRELEASE(o->_database_core_tqueryresultset_query )
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TQueryResultSet_obj* database_core_TQueryResultSet_Create_TTQueryResultSet_TTDBConnectionS(struct database_core_TDBConnection_obj* bbt_db,BBSTRING bbt_sql){
	brl_blitz_NullMethodError();
	return (struct database_core_TQueryResultSet_obj*)((struct database_core_TQueryResultSet_obj*)&bbNullObject);
}
void _database_core_TQueryResultSet_Init_TTDBConnectionS(struct database_core_TQueryResultSet_obj* o,struct database_core_TDBConnection_obj* bbt_db,BBSTRING bbt_sql){
	o->_database_core_tqueryresultset_conn =(struct database_core_TDBConnection_obj*)bbt_db;
	o->_database_core_tqueryresultset_query =bbt_sql;
}
void _database_core_TQueryResultSet_clearBindValues(struct database_core_TQueryResultSet_obj* o){
	if(o->_database_core_tqueryresultset_boundvalues != &bbEmptyArray){
		{
			BBINT bbt_i=0;
			BBINT bbt_=(o->_database_core_tqueryresultset_boundvalues ->scales[0]);
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_i)])!= &bbNullObject){
					struct database_core_dbtypes_TDBType_obj* bbt_2;
					((bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_i)])->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_2);
				}
			}
		}
		o->_database_core_tqueryresultset_bindcount =0;
	}
	if(o->_database_core_tqueryresultset_values != &bbEmptyArray){
		{
			BBINT bbt_i2=0;
			BBINT bbt_3=(o->_database_core_tqueryresultset_values ->scales[0]);
			for(;(bbt_i2<bbt_3);bbt_i2=(bbt_i2+1)){
				if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i2)])!= &bbNullObject){
					struct database_core_dbtypes_TDBType_obj* bbt_4;
					((bbt_4 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i2)])->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_4);
				}
			}
		}
	}
}
void _database_core_TQueryResultSet_clear(struct database_core_TQueryResultSet_obj* o){
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_clearBindValues((struct database_core_TQueryResultSet_obj*)o);
}
BBINT _database_core_TQueryResultSet_executeQuery_S(struct database_core_TQueryResultSet_obj* o,BBSTRING bbt_statement){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TQueryResultSet_prepare_S(struct database_core_TQueryResultSet_obj* o,BBSTRING bbt_statement){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TQueryResultSet_execute(struct database_core_TQueryResultSet_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TQueryResultSet_firstRow(struct database_core_TQueryResultSet_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT _database_core_TQueryResultSet_nextRow(struct database_core_TQueryResultSet_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBLONG _database_core_TQueryResultSet_lastInsertedId(struct database_core_TQueryResultSet_obj* o){
	brl_blitz_NullMethodError();
	return 0LL;
}
BBINT _database_core_TQueryResultSet_rowsAffected(struct database_core_TQueryResultSet_obj* o){
	brl_blitz_NullMethodError();
	return 0;
}
BBINT database_core_TQueryResultSet_dbTypeFromNative_i_Sii(BBSTRING bbt_name,BBINT bbt__type,BBINT bbt__flags){
	brl_blitz_NullMethodError();
	return 0;
}
struct database_core_TQueryRecord_obj* _database_core_TQueryResultSet_rowRecord(struct database_core_TQueryResultSet_obj* o){
	if(!(((struct database_core_TQueryResultSet_obj*)o)->clas->m_isActive((struct database_core_TQueryResultSet_obj*)o)!=0)){
		return (struct database_core_TQueryRecord_obj*)database_core_TQueryRecord_Create_TTQueryRecord();
	}
	return (struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec ;
}
struct database_core_dbtypes_TDBType_obj* _database_core_TQueryResultSet_dataValue_i(struct database_core_TQueryResultSet_obj* o,BBINT bbt_index){
	if(((((struct database_core_TQueryResultSet_obj*)o)->clas->m_isActive((struct database_core_TQueryResultSet_obj*)o)!=0) && (((BBObject*)o->_database_core_tqueryresultset_rec )!= &bbNullObject)) && !((o->_database_core_tqueryresultset_rec )->clas->m_isEmpty((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec )!=0)){
		if((bbt_index>=0) && (bbt_index<(o->_database_core_tqueryresultset_rec )->clas->m_count((struct database_core_TQueryRecord_obj*)o->_database_core_tqueryresultset_rec ))){
			return (struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_index)];
		}
	}
	return (struct database_core_dbtypes_TDBType_obj*)&bbNullObject;
}
BBINT _database_core_TQueryResultSet_rowIndex(struct database_core_TQueryResultSet_obj* o){
	return o->_database_core_tqueryresultset_index ;
}
void _database_core_TQueryResultSet_setRowIndex_i(struct database_core_TQueryResultSet_obj* o,BBINT bbt_i){
	o->_database_core_tqueryresultset_index =bbt_i;
}
BBINT _database_core_TQueryResultSet_isActive(struct database_core_TQueryResultSet_obj* o){
	return o->_database_core_tqueryresultset__isactive ;
}
BBINT _database_core_TQueryResultSet_isValid(struct database_core_TQueryResultSet_obj* o){
	return ((o->_database_core_tqueryresultset_index !=-1) && (o->_database_core_tqueryresultset_index !=-2));
}
void _database_core_TQueryResultSet_resetValues_i(struct database_core_TQueryResultSet_obj* o,BBINT bbt_size){
	if(o->_database_core_tqueryresultset_values != &bbEmptyArray){
		{
			BBINT bbt_i=0;
			BBINT bbt_=(o->_database_core_tqueryresultset_values ->scales[0]);
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])!= &bbNullObject){
					struct database_core_dbtypes_TDBType_obj* bbt_2;
					((bbt_2 = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_values ,1))[((BBUINT)bbt_i)])->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_2);
				}
			}
		}
		o->_database_core_tqueryresultset_values =(&bbEmptyArray);
	}
	o->_database_core_tqueryresultset_values =bbArrayNew1D(":TDBType", bbt_size);
}
void _database_core_TQueryResultSet_resetBindCount(struct database_core_TQueryResultSet_obj* o){
	o->_database_core_tqueryresultset_bindcount =0;
}
void _database_core_TQueryResultSet_addBindValue_TTDBType(struct database_core_TQueryResultSet_obj* o,struct database_core_dbtypes_TDBType_obj* bbt_value){
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_bindValue_iTTDBType((struct database_core_TQueryResultSet_obj*)o,o->_database_core_tqueryresultset_bindcount ,(struct database_core_dbtypes_TDBType_obj*)bbt_value);
}
void _database_core_TQueryResultSet_bindValue_iTTDBType(struct database_core_TQueryResultSet_obj* o,BBINT bbt_index,struct database_core_dbtypes_TDBType_obj* bbt_value){
	if(!(o->_database_core_tqueryresultset_boundvalues != &bbEmptyArray)){
		o->_database_core_tqueryresultset_boundvalues =bbArrayNew1D(":TDBType", (bbt_index+1));
	}
	if((o->_database_core_tqueryresultset_boundvalues ->scales[0])<=bbt_index){
		o->_database_core_tqueryresultset_boundvalues =bbArraySlice(":TDBType",o->_database_core_tqueryresultset_boundvalues ,0,(bbt_index+1));
	}
	if(bbt_index>o->_database_core_tqueryresultset_bindcount ){
		o->_database_core_tqueryresultset_bindcount =bbt_index;
	}
	if(bbt_index==o->_database_core_tqueryresultset_bindcount ){
		o->_database_core_tqueryresultset_bindcount +=1;
	}
	if(((BBObject*)((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_index)])!= &bbNullObject){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		((bbt_ = ((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_index)])->clas)->m_clear((struct database_core_dbtypes_TDBType_obj*)bbt_);
		((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_index)]=(struct database_core_dbtypes_TDBType_obj*)&bbNullObject;
	}
	((struct database_core_dbtypes_TDBType_obj**)BBARRAYDATA(o->_database_core_tqueryresultset_boundvalues ,1))[((BBUINT)bbt_index)]=(struct database_core_dbtypes_TDBType_obj*)bbt_value;
}
void _database_core_TQueryResultSet_reset(struct database_core_TQueryResultSet_obj* o){
}
void _database_core_TQueryResultSet_free(struct database_core_TQueryResultSet_obj* o){
	((struct database_core_TQueryResultSet_obj*)o)->clas->m_clear((struct database_core_TQueryResultSet_obj*)o);
	o->_database_core_tqueryresultset_values =(&bbEmptyArray);
	o->_database_core_tqueryresultset_boundvalues =(&bbEmptyArray);
	o->_database_core_tqueryresultset_rec =(struct database_core_TQueryRecord_obj*)&bbNullObject;
}
struct BBDebugScope_25 database_core_TQueryResultSet_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TQueryResultSet",
	{
		{
			BBDEBUGDECL_FIELD,
			"conn",
			":TDBConnection",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_conn)
		},
		{
			BBDEBUGDECL_FIELD,
			"stmtHandle",
			"*b",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_stmthandle)
		},
		{
			BBDEBUGDECL_FIELD,
			"query",
			"$",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_query)
		},
		{
			BBDEBUGDECL_FIELD,
			"_isActive",
			"i",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset__isactive)
		},
		{
			BBDEBUGDECL_FIELD,
			"index",
			"i",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_index)
		},
		{
			BBDEBUGDECL_FIELD,
			"values",
			"[]:TDBType",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_values)
		},
		{
			BBDEBUGDECL_FIELD,
			"bindCount",
			"i",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_bindcount)
		},
		{
			BBDEBUGDECL_FIELD,
			"boundValues",
			"[]:TDBType",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_boundvalues)
		},
		{
			BBDEBUGDECL_FIELD,
			"rec",
			":TQueryRecord",
			.field_offset=offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_rec)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"Init",
			"(:TDBConnection,$)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_Init_TTDBConnectionS
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clearBindValues",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_clearBindValues
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clear",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_clear
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowRecord",
			"():TQueryRecord",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_rowRecord
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"dataValue",
			"(i):TDBType",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_dataValue_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"rowIndex",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_rowIndex
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setRowIndex",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_setRowIndex_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isActive",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_isActive
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isValid",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_isValid
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"resetValues",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_resetValues_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"resetBindCount",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_resetBindCount
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"addBindValue",
			"(:TDBType)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_addBindValue_TTDBType
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"bindValue",
			"(i,:TDBType)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_bindValue_iTTDBType
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"reset",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_reset
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"free",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryResultSet_free
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TQueryResultSet database_core_TQueryResultSet={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TQueryResultSet_scope,
	sizeof(struct database_core_TQueryResultSet_obj),
	(void (*)(BBOBJECT))_database_core_TQueryResultSet_New,
	(void (*)(BBOBJECT))_database_core_TQueryResultSet_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_rec) - offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_conn) + sizeof(struct database_core_TQueryRecord_obj*)
	,0
	,offsetof(struct database_core_TQueryResultSet_obj,_database_core_tqueryresultset_conn)
	,database_core_TQueryResultSet_Create_TTQueryResultSet_TTDBConnectionS
	,_database_core_TQueryResultSet_Init_TTDBConnectionS
	,_database_core_TQueryResultSet_clearBindValues
	,_database_core_TQueryResultSet_clear
	,_database_core_TQueryResultSet_executeQuery_S
	,_database_core_TQueryResultSet_prepare_S
	,_database_core_TQueryResultSet_execute
	,_database_core_TQueryResultSet_firstRow
	,_database_core_TQueryResultSet_nextRow
	,_database_core_TQueryResultSet_lastInsertedId
	,_database_core_TQueryResultSet_rowsAffected
	,database_core_TQueryResultSet_dbTypeFromNative_i_Sii
	,_database_core_TQueryResultSet_rowRecord
	,_database_core_TQueryResultSet_dataValue_i
	,_database_core_TQueryResultSet_rowIndex
	,_database_core_TQueryResultSet_setRowIndex_i
	,_database_core_TQueryResultSet_isActive
	,_database_core_TQueryResultSet_isValid
	,_database_core_TQueryResultSet_resetValues_i
	,_database_core_TQueryResultSet_resetBindCount
	,_database_core_TQueryResultSet_addBindValue_TTDBType
	,_database_core_TQueryResultSet_bindValue_iTTDBType
	,_database_core_TQueryResultSet_reset
	,_database_core_TQueryResultSet_free
};

void _database_core_TQueryRecord_New(struct database_core_TQueryRecord_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TQueryRecord;
	o->_database_core_tqueryrecord__empty = 1;
	o->_database_core_tqueryrecord__isemptyset = 0;
	o->_database_core_tqueryrecord_fields = (&bbEmptyArray);
	o->_database_core_tqueryrecord_fieldsmap = (struct brl_map_TMap_obj*)((struct brl_map_TMap_obj*)&bbNullObject);
}
void _database_core_TQueryRecord_Delete(struct database_core_TQueryRecord_obj* o) {
	((struct database_core_TQueryRecord_obj*)o)->clas->m_clear((struct database_core_TQueryRecord_obj*)o);
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TQueryRecord_obj* database_core_TQueryRecord_Create_TTQueryRecord(){
	struct database_core_TQueryRecord_obj* bbt_this=(struct database_core_TQueryRecord_obj*)(struct database_core_TQueryRecord_obj*)bbObjectNew((BBClass *)&database_core_TQueryRecord);
	return (struct database_core_TQueryRecord_obj*)bbt_this;
}
struct database_core_TQueryField_obj* _database_core_TQueryRecord_getField_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	return (struct database_core_TQueryField_obj*)((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_index)];
}
struct database_core_TQueryField_obj* _database_core_TQueryRecord_getFieldByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	return (struct database_core_TQueryField_obj*)((struct database_core_TQueryField_obj*)bbObjectDowncast((BBOBJECT)(o->_database_core_tqueryrecord_fieldsmap )->clas->m_ValueForKey_TObject((struct brl_map_TMap_obj*)o->_database_core_tqueryrecord_fieldsmap ,(BBOBJECT)bbt_name),(BBClass*)&database_core_TQueryField));
}
BBINT _database_core_TQueryRecord_indexOf_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	{
		BBINT bbt_i=0;
		BBINT bbt_=(o->_database_core_tqueryrecord_fields ->scales[0]);
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			if(bbStringEquals(bbt_name, ((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_i)]->_database_core_tqueryfield_name )==1){
				return bbt_i;
			}
		}
	}
	return -1;
}
BBINT _database_core_TQueryRecord_count(struct database_core_TQueryRecord_obj* o){
	return (o->_database_core_tqueryrecord_fields ->scales[0]);
}
BBINT _database_core_TQueryRecord_isEmpty(struct database_core_TQueryRecord_obj* o){
	return o->_database_core_tqueryrecord__empty ;
}
void _database_core_TQueryRecord_setValue_iTObject(struct database_core_TQueryRecord_obj* o,BBINT bbt_index,BBOBJECT bbt_value){
	if((bbt_index>=0) && (bbt_index<(o->_database_core_tqueryrecord_fields ->scales[0]))){
		struct database_core_TQueryField_obj* bbt_;
		((bbt_ = ((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_index)])->clas)->m_setValue_TObject((struct database_core_TQueryField_obj*)bbt_,(BBOBJECT)bbt_value);
	}
}
struct database_core_dbtypes_TDBType_obj* _database_core_TQueryRecord_value_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	if(o->_database_core_tqueryrecord_fields != &bbEmptyArray){
		if((bbt_index>=0) && (bbt_index<(o->_database_core_tqueryrecord_fields ->scales[0]))){
			return (struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_index)]->_database_core_tqueryfield_value ;
		}
	}
	return (struct database_core_dbtypes_TDBType_obj*)&bbNullObject;
}
BBSTRING _database_core_TQueryRecord_getString_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	struct database_core_dbtypes_TDBType_obj* bbt_v=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_value_i((struct database_core_TQueryRecord_obj*)o,bbt_index);
	if(((BBObject*)bbt_v)!= &bbNullObject){
		return (bbt_v)->clas->m_getString((struct database_core_dbtypes_TDBType_obj*)bbt_v);
	}
	return ((BBString*)&bbEmptyString);
}
BBSTRING _database_core_TQueryRecord_getStringByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	struct database_core_TQueryField_obj* bbt_f=(struct database_core_TQueryField_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_getFieldByName_S((struct database_core_TQueryRecord_obj*)o,bbt_name);
	if((((BBObject*)bbt_f)!= &bbNullObject) && (((BBObject*)bbt_f->_database_core_tqueryfield_value )!= &bbNullObject)){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		return (((struct database_core_dbtypes_TDBType_obj*)(bbt_ = bbt_f->_database_core_tqueryfield_value ))->clas)->m_getString((struct database_core_dbtypes_TDBType_obj*)bbt_);
	}
	return ((BBString*)&bbEmptyString);
}
BBINT _database_core_TQueryRecord_getInt_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	struct database_core_dbtypes_TDBType_obj* bbt_v=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_value_i((struct database_core_TQueryRecord_obj*)o,bbt_index);
	if(((BBObject*)bbt_v)!= &bbNullObject){
		return (bbt_v)->clas->m_getInt((struct database_core_dbtypes_TDBType_obj*)bbt_v);
	}
	return 0;
}
BBINT _database_core_TQueryRecord_getIntByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	struct database_core_TQueryField_obj* bbt_f=(struct database_core_TQueryField_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_getFieldByName_S((struct database_core_TQueryRecord_obj*)o,bbt_name);
	if((((BBObject*)bbt_f)!= &bbNullObject) && (((BBObject*)bbt_f->_database_core_tqueryfield_value )!= &bbNullObject)){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		return (((struct database_core_dbtypes_TDBType_obj*)(bbt_ = bbt_f->_database_core_tqueryfield_value ))->clas)->m_getInt((struct database_core_dbtypes_TDBType_obj*)bbt_);
	}
	return 0;
}
BBLONG _database_core_TQueryRecord_getLong_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	struct database_core_dbtypes_TDBType_obj* bbt_v=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_value_i((struct database_core_TQueryRecord_obj*)o,bbt_index);
	if(((BBObject*)bbt_v)!= &bbNullObject){
		return (bbt_v)->clas->m_getLong((struct database_core_dbtypes_TDBType_obj*)bbt_v);
	}
	return 0LL;
}
BBLONG _database_core_TQueryRecord_getLongByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	struct database_core_TQueryField_obj* bbt_f=(struct database_core_TQueryField_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_getFieldByName_S((struct database_core_TQueryRecord_obj*)o,bbt_name);
	if((((BBObject*)bbt_f)!= &bbNullObject) && (((BBObject*)bbt_f->_database_core_tqueryfield_value )!= &bbNullObject)){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		return (((struct database_core_dbtypes_TDBType_obj*)(bbt_ = bbt_f->_database_core_tqueryfield_value ))->clas)->m_getLong((struct database_core_dbtypes_TDBType_obj*)bbt_);
	}
	return 0LL;
}
BBFLOAT _database_core_TQueryRecord_getFloat_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	struct database_core_dbtypes_TDBType_obj* bbt_v=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_value_i((struct database_core_TQueryRecord_obj*)o,bbt_index);
	if(((BBObject*)bbt_v)!= &bbNullObject){
		return (bbt_v)->clas->m_getFloat((struct database_core_dbtypes_TDBType_obj*)bbt_v);
	}
	return .00000000f;
}
BBFLOAT _database_core_TQueryRecord_getFloatByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	struct database_core_TQueryField_obj* bbt_f=(struct database_core_TQueryField_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_getFieldByName_S((struct database_core_TQueryRecord_obj*)o,bbt_name);
	if((((BBObject*)bbt_f)!= &bbNullObject) && (((BBObject*)bbt_f->_database_core_tqueryfield_value )!= &bbNullObject)){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		return (((struct database_core_dbtypes_TDBType_obj*)(bbt_ = bbt_f->_database_core_tqueryfield_value ))->clas)->m_getFloat((struct database_core_dbtypes_TDBType_obj*)bbt_);
	}
	return .00000000f;
}
BBDOUBLE _database_core_TQueryRecord_getDouble_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_index){
	struct database_core_dbtypes_TDBType_obj* bbt_v=(struct database_core_dbtypes_TDBType_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_value_i((struct database_core_TQueryRecord_obj*)o,bbt_index);
	if(((BBObject*)bbt_v)!= &bbNullObject){
		return (bbt_v)->clas->m_getDouble((struct database_core_dbtypes_TDBType_obj*)bbt_v);
	}
	return .0000000000000000;
}
BBSTRING _database_core_TQueryRecord_getDoubleByName_S(struct database_core_TQueryRecord_obj* o,BBSTRING bbt_name){
	struct database_core_TQueryField_obj* bbt_f=(struct database_core_TQueryField_obj*)((struct database_core_TQueryRecord_obj*)o)->clas->m_getFieldByName_S((struct database_core_TQueryRecord_obj*)o,bbt_name);
	if((((BBObject*)bbt_f)!= &bbNullObject) && (((BBObject*)bbt_f->_database_core_tqueryfield_value )!= &bbNullObject)){
		struct database_core_dbtypes_TDBType_obj* bbt_;
		return bbStringFromDouble((((struct database_core_dbtypes_TDBType_obj*)(bbt_ = bbt_f->_database_core_tqueryfield_value ))->clas)->m_getDouble((struct database_core_dbtypes_TDBType_obj*)bbt_));
	}
	return ((BBString*)&bbEmptyString);
}
void _database_core_TQueryRecord_clear(struct database_core_TQueryRecord_obj* o){
	if(o->_database_core_tqueryrecord_fields != &bbEmptyArray){
		{
			BBINT bbt_i=0;
			BBINT bbt_=(o->_database_core_tqueryrecord_fields ->scales[0]);
			for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
				if(((BBObject*)((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_i)])!= &bbNullObject){
					struct database_core_TQueryField_obj* bbt_2;
					((bbt_2 = ((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_i)])->clas)->m_clear((struct database_core_TQueryField_obj*)bbt_2);
				}
			}
		}
		o->_database_core_tqueryrecord_fields =(&bbEmptyArray);
		(o->_database_core_tqueryrecord_fieldsmap )->clas->m_Clear((struct brl_map_TMap_obj*)o->_database_core_tqueryrecord_fieldsmap );
		o->_database_core_tqueryrecord_fieldsmap =(struct brl_map_TMap_obj*)&bbNullObject;
	}
	o->_database_core_tqueryrecord__empty =1;
	o->_database_core_tqueryrecord__isemptyset =1;
}
void _database_core_TQueryRecord_Init_i(struct database_core_TQueryRecord_obj* o,BBINT bbt_size){
	if(o->_database_core_tqueryrecord_fields != &bbEmptyArray){
		((struct database_core_TQueryRecord_obj*)o)->clas->m_clear((struct database_core_TQueryRecord_obj*)o);
	}
	o->_database_core_tqueryrecord_fields =bbArrayNew1D(":TQueryField", bbt_size);
	o->_database_core_tqueryrecord_fieldsmap =(struct brl_map_TMap_obj*)(struct brl_map_TMap_obj*)bbObjectNew((BBClass *)&brl_map_TMap);
	o->_database_core_tqueryrecord__empty =0;
	o->_database_core_tqueryrecord__isemptyset =0;
}
void _database_core_TQueryRecord_setField_iTTQueryField(struct database_core_TQueryRecord_obj* o,BBINT bbt_index,struct database_core_TQueryField_obj* bbt_theField){
	if(o->_database_core_tqueryrecord_fields != &bbEmptyArray){
		((struct database_core_TQueryField_obj**)BBARRAYDATA(o->_database_core_tqueryrecord_fields ,1))[((BBUINT)bbt_index)]=(struct database_core_TQueryField_obj*)bbt_theField;
		(o->_database_core_tqueryrecord_fieldsmap )->clas->m_Insert_TObjectTObject((struct brl_map_TMap_obj*)o->_database_core_tqueryrecord_fieldsmap ,(BBOBJECT)bbt_theField->_database_core_tqueryfield_name ,(BBOBJECT)bbt_theField);
	}
}
void _database_core_TQueryRecord_setIsEmptySet(struct database_core_TQueryRecord_obj* o){
	o->_database_core_tqueryrecord__isemptyset =1;
}
struct BBDebugScope_27 database_core_TQueryRecord_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TQueryRecord",
	{
		{
			BBDEBUGDECL_FIELD,
			"_empty",
			"i",
			.field_offset=offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord__empty)
		},
		{
			BBDEBUGDECL_FIELD,
			"_isEmptySet",
			"i",
			.field_offset=offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord__isemptyset)
		},
		{
			BBDEBUGDECL_FIELD,
			"fields",
			"[]:TQueryField",
			.field_offset=offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord_fields)
		},
		{
			BBDEBUGDECL_FIELD,
			"fieldsMap",
			":TMap",
			.field_offset=offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord_fieldsmap)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"():TQueryRecord",
			.func_ptr=(BBFuncPtr)&database_core_TQueryRecord_Create_TTQueryRecord
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getField",
			"(i):TQueryField",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getField_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getFieldByName",
			"($):TQueryField",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getFieldByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"indexOf",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_indexOf_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"count",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_count
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isEmpty",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_isEmpty
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setValue",
			"(i,:Object)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_setValue_iTObject
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"value",
			"(i):TDBType",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_value_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getString",
			"(i)$",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getString_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getStringByName",
			"($)$",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getStringByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getInt",
			"(i)i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getInt_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getIntByName",
			"($)i",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getIntByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getLong",
			"(i)l",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getLong_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getLongByName",
			"($)l",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getLongByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getFloat",
			"(i)f",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getFloat_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getFloatByName",
			"($)f",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getFloatByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getDouble",
			"(i)d",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getDouble_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"getDoubleByName",
			"($)$",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_getDoubleByName_S
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clear",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_clear
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"Init",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_Init_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setField",
			"(i,:TQueryField)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_setField_iTTQueryField
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setIsEmptySet",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryRecord_setIsEmptySet
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TQueryRecord database_core_TQueryRecord={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TQueryRecord_scope,
	sizeof(struct database_core_TQueryRecord_obj),
	(void (*)(BBOBJECT))_database_core_TQueryRecord_New,
	(void (*)(BBOBJECT))_database_core_TQueryRecord_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord_fieldsmap) - offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord__empty) + sizeof(struct brl_map_TMap_obj*)
	,0
	,offsetof(struct database_core_TQueryRecord_obj,_database_core_tqueryrecord__empty)
	,database_core_TQueryRecord_Create_TTQueryRecord
	,_database_core_TQueryRecord_getField_i
	,_database_core_TQueryRecord_getFieldByName_S
	,_database_core_TQueryRecord_indexOf_S
	,_database_core_TQueryRecord_count
	,_database_core_TQueryRecord_isEmpty
	,_database_core_TQueryRecord_setValue_iTObject
	,_database_core_TQueryRecord_value_i
	,_database_core_TQueryRecord_getString_i
	,_database_core_TQueryRecord_getStringByName_S
	,_database_core_TQueryRecord_getInt_i
	,_database_core_TQueryRecord_getIntByName_S
	,_database_core_TQueryRecord_getLong_i
	,_database_core_TQueryRecord_getLongByName_S
	,_database_core_TQueryRecord_getFloat_i
	,_database_core_TQueryRecord_getFloatByName_S
	,_database_core_TQueryRecord_getDouble_i
	,_database_core_TQueryRecord_getDoubleByName_S
	,_database_core_TQueryRecord_clear
	,_database_core_TQueryRecord_Init_i
	,_database_core_TQueryRecord_setField_iTTQueryField
	,_database_core_TQueryRecord_setIsEmptySet
};

void _database_core_TQueryField_New(struct database_core_TQueryField_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TQueryField;
	o->_database_core_tqueryfield_name = ((BBString*)&bbEmptyString);
	o->_database_core_tqueryfield_ftype = 0;
	o->_database_core_tqueryfield_length = -1;
	o->_database_core_tqueryfield_precision = -1;
	o->_database_core_tqueryfield_value = (struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)&bbNullObject);
	o->_database_core_tqueryfield_nullable = -1;
	o->_database_core_tqueryfield_dtype = 0;
	o->_database_core_tqueryfield_dflags = 0;
}
void _database_core_TQueryField_Delete(struct database_core_TQueryField_obj* o) {
	((struct database_core_TQueryField_obj*)o)->clas->m_clear((struct database_core_TQueryField_obj*)o);
	BBRELEASE(o->_database_core_tqueryfield_name )
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TQueryField_obj* database_core_TQueryField_Create_TTQueryField_Si(BBSTRING bbt_name,BBINT bbt_fType){
	struct database_core_TQueryField_obj* bbt_this=(struct database_core_TQueryField_obj*)(struct database_core_TQueryField_obj*)bbObjectNew((BBClass *)&database_core_TQueryField);
	bbt_this->_database_core_tqueryfield_name =bbt_name;
	bbt_this->_database_core_tqueryfield_ftype =bbt_fType;
	return (struct database_core_TQueryField_obj*)bbt_this;
}
void _database_core_TQueryField_clear(struct database_core_TQueryField_obj* o){
	o->_database_core_tqueryfield_value =(struct database_core_dbtypes_TDBType_obj*)&bbNullObject;
}
void _database_core_TQueryField_setValue_TObject(struct database_core_TQueryField_obj* o,BBOBJECT bbt_v){
	if(((BBObject*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)bbt_v,(BBClass*)&database_core_dbtypes_TDBType)))!= &bbNullObject){
		o->_database_core_tqueryfield_value =(struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)bbObjectDowncast((BBOBJECT)bbt_v,(BBClass*)&database_core_dbtypes_TDBType));
	}
}
struct BBDebugScope_12 database_core_TQueryField_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TQueryField",
	{
		{
			BBDEBUGDECL_FIELD,
			"name",
			"$",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_name)
		},
		{
			BBDEBUGDECL_FIELD,
			"fType",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_ftype)
		},
		{
			BBDEBUGDECL_FIELD,
			"length",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_length)
		},
		{
			BBDEBUGDECL_FIELD,
			"precision",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_precision)
		},
		{
			BBDEBUGDECL_FIELD,
			"value",
			":TDBType",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_value)
		},
		{
			BBDEBUGDECL_FIELD,
			"nullable",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_nullable)
		},
		{
			BBDEBUGDECL_FIELD,
			"dtype",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_dtype)
		},
		{
			BBDEBUGDECL_FIELD,
			"dflags",
			"i",
			.field_offset=offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_dflags)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryField_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"($,i):TQueryField",
			.func_ptr=(BBFuncPtr)&database_core_TQueryField_Create_TTQueryField_Si
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"clear",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryField_clear
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"setValue",
			"(:Object)",
			.func_ptr=(BBFuncPtr)&_database_core_TQueryField_setValue_TObject
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TQueryField database_core_TQueryField={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TQueryField_scope,
	sizeof(struct database_core_TQueryField_obj),
	(void (*)(BBOBJECT))_database_core_TQueryField_New,
	(void (*)(BBOBJECT))_database_core_TQueryField_Delete,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_dflags) - offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_name) + sizeof(BBINT)
	,0
	,offsetof(struct database_core_TQueryField_obj,_database_core_tqueryfield_name)
	,database_core_TQueryField_Create_TTQueryField_Si
	,_database_core_TQueryField_clear
	,_database_core_TQueryField_setValue_TObject
};

void _database_core_TDatabaseError_New(struct database_core_TDatabaseError_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDatabaseError;
	o->_database_core_tdatabaseerror_db = (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
	o->_database_core_tdatabaseerror_error = ((BBString*)&bbEmptyString);
	o->_database_core_tdatabaseerror_errortype = 0;
	o->_database_core_tdatabaseerror_errorvalue = 0;
}
void _database_core_TDatabaseError_Delete(struct database_core_TDatabaseError_obj* o) {
	o->_database_core_tdatabaseerror_db =(struct database_core_TDBConnection_obj*)&bbNullObject;
	BBRELEASE(o->_database_core_tdatabaseerror_error )
	bbObjectDtor((BBOBJECT)o);
}
struct database_core_TDatabaseError_obj* database_core_TDatabaseError_Create_TTDatabaseError_TTDBConnectionSSii(struct database_core_TDBConnection_obj* bbt_db,BBSTRING bbt_error,BBSTRING bbt_append,BBINT bbt_errorType,BBINT bbt_errorValue){
	struct database_core_TDatabaseError_obj* bbt_this=(struct database_core_TDatabaseError_obj*)(struct database_core_TDatabaseError_obj*)bbObjectNew((BBClass *)&database_core_TDatabaseError);
	bbt_this->_database_core_tdatabaseerror_db =(struct database_core_TDBConnection_obj*)bbt_db;
	bbt_this->_database_core_tdatabaseerror_error =bbt_error;
	if(bbt_append!= &bbEmptyString){
		bbt_this->_database_core_tdatabaseerror_error =bbStringConcat(bbt_this->_database_core_tdatabaseerror_error ,(bbStringConcat(((BBString*)&_s0),bbt_append)));
	}
	if(bbt_errorValue!=0){
		bbt_this->_database_core_tdatabaseerror_error =bbStringConcat(bbt_this->_database_core_tdatabaseerror_error ,(bbStringConcat(bbStringConcat(((BBString*)&_s4),bbStringFromInt(bbt_errorValue)),((BBString*)&_s5))));
	}
	bbt_this->_database_core_tdatabaseerror_errorvalue =bbt_errorValue;
	bbt_this->_database_core_tdatabaseerror_errortype =bbt_errorType;
	return (struct database_core_TDatabaseError_obj*)bbt_this;
}
void _database_core_TDatabaseError_reset(struct database_core_TDatabaseError_obj* o){
	o->_database_core_tdatabaseerror_error =(&bbEmptyString);
	o->_database_core_tdatabaseerror_errorvalue =0;
	o->_database_core_tdatabaseerror_errortype =0;
}
BBINT _database_core_TDatabaseError_isSet(struct database_core_TDatabaseError_obj* o){
	return (bbStringEquals(o->_database_core_tdatabaseerror_error , (&bbEmptyString))!=1 && ((o->_database_core_tdatabaseerror_error ->length)>0));
}
BBSTRING _database_core_TDatabaseError_ToString(struct database_core_TDatabaseError_obj* o){
	return bbStringConcat(bbStringConcat(bbStringConcat(bbStringConcat(bbStringConcat(((BBString*)&_s6),bbStringFromInt(o->_database_core_tdatabaseerror_errortype )),((BBString*)&_s5)),o->_database_core_tdatabaseerror_error ),((BBString*)&_s0)),((struct database_core_TDatabaseError_obj*)o)->clas->m_nativeError((struct database_core_TDatabaseError_obj*)o));
}
BBSTRING _database_core_TDatabaseError_nativeError(struct database_core_TDatabaseError_obj* o){
	if(((BBObject*)o->_database_core_tdatabaseerror_db )!= &bbNullObject){
		return (o->_database_core_tdatabaseerror_db )->clas->m_nativeErrorMessage_i((struct database_core_TDBConnection_obj*)o->_database_core_tdatabaseerror_db ,o->_database_core_tdatabaseerror_errorvalue );
	}
	return ((BBString*)&bbEmptyString);
}
struct BBDebugScope_15 database_core_TDatabaseError_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDatabaseError",
	{
		{
			BBDEBUGDECL_CONST,
			"ERROR_NONE",
			"i",
			.const_value=(BBString*)&_s7
		},
		{
			BBDEBUGDECL_CONST,
			"ERROR_TRANSACTION",
			"i",
			.const_value=(BBString*)&_s8
		},
		{
			BBDEBUGDECL_CONST,
			"ERROR_CONNECTION",
			"i",
			.const_value=(BBString*)&_s9
		},
		{
			BBDEBUGDECL_CONST,
			"ERROR_STATEMENT",
			"i",
			.const_value=(BBString*)&_s10
		},
		{
			BBDEBUGDECL_CONST,
			"ERROR_UNKOWN",
			"i",
			.const_value=(BBString*)&_s11
		},
		{
			BBDEBUGDECL_FIELD,
			"db",
			":TDBConnection",
			.field_offset=offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_db)
		},
		{
			BBDEBUGDECL_FIELD,
			"error",
			"$",
			.field_offset=offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_error)
		},
		{
			BBDEBUGDECL_FIELD,
			"errorType",
			"i",
			.field_offset=offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_errortype)
		},
		{
			BBDEBUGDECL_FIELD,
			"errorValue",
			"i",
			.field_offset=offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_errorvalue)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseError_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"ToString",
			"()$",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseError_ToString
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"(:TDBConnection,$,$,i,i):TDatabaseError",
			.func_ptr=(BBFuncPtr)&database_core_TDatabaseError_Create_TTDatabaseError_TTDBConnectionSSii
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"reset",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseError_reset
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"isSet",
			"()i",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseError_isSet
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"nativeError",
			"()$",
			.func_ptr=(BBFuncPtr)&_database_core_TDatabaseError_nativeError
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDatabaseError database_core_TDatabaseError={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDatabaseError_scope,
	sizeof(struct database_core_TDatabaseError_obj),
	(void (*)(BBOBJECT))_database_core_TDatabaseError_New,
	(void (*)(BBOBJECT))_database_core_TDatabaseError_Delete,
	_database_core_TDatabaseError_ToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_errorvalue) - offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_db) + sizeof(BBINT)
	,0
	,offsetof(struct database_core_TDatabaseError_obj,_database_core_tdatabaseerror_db)
	,database_core_TDatabaseError_Create_TTDatabaseError_TTDBConnectionSSii
	,_database_core_TDatabaseError_reset
	,_database_core_TDatabaseError_isSet
	,_database_core_TDatabaseError_nativeError
};

void _database_core_TDBTable_New(struct database_core_TDBTable_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDBTable;
	o->_database_core_tdbtable_name = ((BBString*)&bbEmptyString);
	o->_database_core_tdbtable_columns = (&bbEmptyArray);
	o->_database_core_tdbtable_ddl = ((BBString*)&bbEmptyString);
}
void _database_core_TDBTable_SetCountColumns_i(struct database_core_TDBTable_obj* o,BBINT bbt_count){
	o->_database_core_tdbtable_columns =bbArrayNew1D(":TDBColumn", bbt_count);
}
void _database_core_TDBTable_SetColumn_iTTDBColumn(struct database_core_TDBTable_obj* o,BBINT bbt_index,struct database_core_TDBColumn_obj* bbt_col){
	((struct database_core_TDBColumn_obj**)BBARRAYDATA(o->_database_core_tdbtable_columns ,1))[((BBUINT)bbt_index)]=(struct database_core_TDBColumn_obj*)bbt_col;
}
struct BBDebugScope_6 database_core_TDBTable_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDBTable",
	{
		{
			BBDEBUGDECL_FIELD,
			"name",
			"$",
			.field_offset=offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_name)
		},
		{
			BBDEBUGDECL_FIELD,
			"columns",
			"[]:TDBColumn",
			.field_offset=offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_columns)
		},
		{
			BBDEBUGDECL_FIELD,
			"ddl",
			"$",
			.field_offset=offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_ddl)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDBTable_New
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"SetCountColumns",
			"(i)",
			.func_ptr=(BBFuncPtr)&_database_core_TDBTable_SetCountColumns_i
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"SetColumn",
			"(i,:TDBColumn)",
			.func_ptr=(BBFuncPtr)&_database_core_TDBTable_SetColumn_iTTDBColumn
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDBTable database_core_TDBTable={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDBTable_scope,
	sizeof(struct database_core_TDBTable_obj),
	(void (*)(BBOBJECT))_database_core_TDBTable_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_ddl) - offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_name) + sizeof(BBSTRING)
	,0
	,offsetof(struct database_core_TDBTable_obj,_database_core_tdbtable_name)
	,_database_core_TDBTable_SetCountColumns_i
	,_database_core_TDBTable_SetColumn_iTTDBColumn
};

void _database_core_TDBColumn_New(struct database_core_TDBColumn_obj* o) {
	bbObjectCtor((BBOBJECT)o);
	o->clas = &database_core_TDBColumn;
	o->_database_core_tdbcolumn_name = ((BBString*)&bbEmptyString);
	o->_database_core_tdbcolumn_dbtype = 0;
	o->_database_core_tdbcolumn_nullable = 0;
	o->_database_core_tdbcolumn_defaultvalue = (struct database_core_dbtypes_TDBType_obj*)((struct database_core_dbtypes_TDBType_obj*)&bbNullObject);
}
struct database_core_TDBColumn_obj* database_core_TDBColumn_Create_TTDBColumn_SiiTTDBType(BBSTRING bbt_name,BBINT bbt_dbType,BBINT bbt_nullable,struct database_core_dbtypes_TDBType_obj* bbt_defaultValue){
	struct database_core_TDBColumn_obj* bbt_this=(struct database_core_TDBColumn_obj*)(struct database_core_TDBColumn_obj*)bbObjectNew((BBClass *)&database_core_TDBColumn);
	bbt_this->_database_core_tdbcolumn_name =bbt_name;
	bbt_this->_database_core_tdbcolumn_dbtype =bbt_dbType;
	bbt_this->_database_core_tdbcolumn_nullable =bbt_nullable;
	bbt_this->_database_core_tdbcolumn_defaultvalue =(struct database_core_dbtypes_TDBType_obj*)bbt_defaultValue;
	return (struct database_core_TDBColumn_obj*)bbt_this;
}
struct BBDebugScope_6 database_core_TDBColumn_scope ={
	BBDEBUGSCOPE_USERTYPE,
	"TDBColumn",
	{
		{
			BBDEBUGDECL_FIELD,
			"name",
			"$",
			.field_offset=offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_name)
		},
		{
			BBDEBUGDECL_FIELD,
			"dbType",
			"i",
			.field_offset=offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_dbtype)
		},
		{
			BBDEBUGDECL_FIELD,
			"nullable",
			"i",
			.field_offset=offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_nullable)
		},
		{
			BBDEBUGDECL_FIELD,
			"defaultValue",
			":TDBType",
			.field_offset=offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_defaultvalue)
		},
		{
			BBDEBUGDECL_TYPEMETHOD,
			"New",
			"()",
			.func_ptr=(BBFuncPtr)&_database_core_TDBColumn_New
		},
		{
			BBDEBUGDECL_TYPEFUNCTION,
			"Create",
			"($,i,i,:TDBType):TDBColumn",
			.func_ptr=(BBFuncPtr)&database_core_TDBColumn_Create_TTDBColumn_SiiTTDBType
		},
		{
			BBDEBUGDECL_END
		}
	}
};
struct BBClass_database_core_TDBColumn database_core_TDBColumn={
	&bbObjectClass,
	bbObjectFree,
	(BBDebugScope*)&database_core_TDBColumn_scope,
	sizeof(struct database_core_TDBColumn_obj),
	(void (*)(BBOBJECT))_database_core_TDBColumn_New,
	bbObjectDtor,
	bbObjectToString,
	bbObjectCompare,
	bbObjectSendMessage,
	0,
	0,
	offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_defaultvalue) - offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_name) + sizeof(struct database_core_dbtypes_TDBType_obj*)
	,0
	,offsetof(struct database_core_TDBColumn_obj,_database_core_tdbcolumn_name)
	,database_core_TDBColumn_Create_TTDBColumn_SiiTTDBType
};

BBSTRING database_core_convertISO8859toUTF8(BBSTRING bbt_text){
	if(!(bbt_text!= &bbEmptyString)){
		return ((BBString*)&bbEmptyString);
	}
	BBINT bbt_l=(bbt_text->length);
	if(bbt_l==0){
		return ((BBString*)&bbEmptyString);
	}
	BBINT bbt_count=0;
	BBARRAY bbt_s=bbArrayNew1D("b", (bbt_l*3));
	{
		BBINT bbt_i=0;
		BBINT bbt_=bbt_l;
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			BBINT bbt_char=(bbt_text)->buf[((BBUINT)bbt_i)];
			if(bbt_char<128){
				((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)bbt_char);
				bbt_count+=1;
				continue;
			}else{
				if(bbt_char<2048){
					((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)((unsigned int)((bbt_char/64))|(unsigned int)(192)));
					bbt_count+=1;
					((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)((unsigned int)((bbt_char % 64))|(unsigned int)(128)));
					bbt_count+=1;
					continue;
				}else{
					((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)((unsigned int)((bbt_char/4096))|(unsigned int)(224)));
					bbt_count+=1;
					((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)((unsigned int)(((bbt_char/64) % 64))|(unsigned int)(128)));
					bbt_count+=1;
					((BBBYTE*)BBARRAYDATA(bbt_s,1))[((BBUINT)bbt_count)]=((BBBYTE)((unsigned int)((bbt_char % 64))|(unsigned int)(128)));
					bbt_count+=1;
					continue;
				}
			}
		}
	}
	return bbStringFromBytes(((BBBYTE*)BBARRAYDATA(bbt_s,1)),bbt_count);
}
BBSTRING database_core_convertUTF8toISO8859(BBBYTE* bbt_s){
	BBINT bbt_l=strlen(bbt_s);
	BBARRAY bbt_b=bbArrayNew1D("s", bbt_l);
	BBINT bbt_bc=-1;
	BBINT bbt_c=0;
	BBINT bbt_d=0;
	BBINT bbt_e=0;
	{
		BBINT bbt_i=0;
		BBINT bbt_=bbt_l;
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			bbt_bc+=1;
			bbt_c=((BBINT)bbt_s[bbt_i]);
			if(bbt_c<128){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)bbt_c);
				continue;
			}
			bbt_i+=1;
			bbt_d=((BBINT)bbt_s[bbt_i]);
			if(bbt_c<224){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)(((bbt_c-192)*64)+(bbt_d-128)));
				continue;
			}
			bbt_i+=1;
			bbt_e=((BBINT)bbt_s[bbt_i]);
			if(bbt_c<240){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)((((bbt_c-224)*4096)+((bbt_d-128)*64))+(bbt_e-128)));
				if(((BBINT)((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)])==8233){
					((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=10;
				}
				continue;
			}
		}
	}
	return bbStringFromShorts(((BBSHORT*)BBARRAYDATA(bbt_b,1)),(bbt_bc+1));
}
BBSTRING database_core_sizedUTF8toISO8859(BBBYTE* bbt_s,BBINT bbt_size){
	BBINT bbt_l=bbt_size;
	BBARRAY bbt_b=bbArrayNew1D("s", bbt_l);
	BBINT bbt_bc=-1;
	BBINT bbt_c=0;
	BBINT bbt_d=0;
	BBINT bbt_e=0;
	{
		BBINT bbt_i=0;
		BBINT bbt_=bbt_l;
		for(;(bbt_i<bbt_);bbt_i=(bbt_i+1)){
			bbt_c=((BBINT)bbt_s[bbt_i]);
			if(bbt_c==0){
				continue;
			}
			bbt_bc+=1;
			if(bbt_c<128){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)bbt_c);
				continue;
			}
			bbt_i+=1;
			bbt_d=((BBINT)bbt_s[bbt_i]);
			if(bbt_c<224){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)(((bbt_c-192)*64)+(bbt_d-128)));
				continue;
			}
			bbt_i+=1;
			bbt_e=((BBINT)bbt_s[bbt_i]);
			if(bbt_c<240){
				((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=((BBSHORT)((((bbt_c-224)*4096)+((bbt_d-128)*64))+(bbt_e-128)));
				if(((BBINT)((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)])==8233){
					((BBSHORT*)BBARRAYDATA(bbt_b,1))[((BBUINT)bbt_bc)]=10;
				}
				continue;
			}
		}
	}
	return bbStringFromShorts(((BBSHORT*)BBARRAYDATA(bbt_b,1)),(bbt_bc+1));
}
void database_core_AddDatabaseLoader(struct database_core_TDatabaseLoader_obj* bbt_loader){
	if(((BBObject*)bbt_loader->_database_core_tdatabaseloader__succ )!= &bbNullObject){
		return;
	}
	bbt_loader->_database_core_tdatabaseloader__succ =(struct database_core_TDatabaseLoader_obj*)database_core__loaders;
	database_core__loaders=(struct database_core_TDatabaseLoader_obj*)bbt_loader;
}
struct database_core_TDBConnection_obj* database_core_LoadDatabase(BBSTRING bbt_dbType,BBSTRING bbt_dbname,BBSTRING bbt_host,BBINT bbt_port,BBSTRING bbt_user,BBSTRING bbt_password,BBSTRING bbt_server,BBSTRING bbt_options){
	struct database_core_TDatabaseLoader_obj* bbt_loader=(struct database_core_TDatabaseLoader_obj*)database_core__loaders;
	while(((BBObject*)bbt_loader)!= &bbNullObject){
		if(bbStringEquals(bbt_loader->_database_core_tdatabaseloader__type , bbt_dbType)==1){
			struct database_core_TDBConnection_obj* bbt_db=(struct database_core_TDBConnection_obj*)(bbt_loader)->clas->m_LoadDatabase_SSiSSSS((struct database_core_TDatabaseLoader_obj*)bbt_loader,bbt_dbname,bbt_host,bbt_port,bbt_user,bbt_password,bbt_server,bbt_options);
			if(((BBObject*)bbt_db)!= &bbNullObject){
				return (struct database_core_TDBConnection_obj*)bbt_db;
			}
		}
		bbt_loader=(struct database_core_TDatabaseLoader_obj*)bbt_loader->_database_core_tdatabaseloader__succ ;
	}
	return (struct database_core_TDBConnection_obj*)((struct database_core_TDBConnection_obj*)&bbNullObject);
}
static int __bb_database_core_core_inited = 0;
int __bb_database_core_core(){
	if (!__bb_database_core_core_inited) {
		__bb_database_core_core_inited = 1;
		GC_add_roots(&database_core__loaders, &database_core__loaders + 1);
		__bb_brl_blitz_blitz();
		__bb_brl_linkedlist_linkedlist();
		__bb_brl_map_map();
		_bb_database_core_dbtypes();
		bbObjectRegisterType((BBCLASS)&database_core_TDatabaseLoader);
		bbObjectRegisterType((BBCLASS)&database_core_TDBConnection);
		bbObjectRegisterType((BBCLASS)&database_core_TDatabaseQuery);
		bbObjectRegisterType((BBCLASS)&database_core_TRowEnumerator);
		bbObjectRegisterType((BBCLASS)&database_core_TQueryResultSet);
		bbObjectRegisterType((BBCLASS)&database_core_TQueryRecord);
		bbObjectRegisterType((BBCLASS)&database_core_TQueryField);
		bbObjectRegisterType((BBCLASS)&database_core_TDatabaseError);
		bbObjectRegisterType((BBCLASS)&database_core_TDBTable);
		bbObjectRegisterType((BBCLASS)&database_core_TDBColumn);
		return 0;
	}
	return 0;
}