
public sqlite_init()
{
	static database[128],integrity_check[64],error_num;
	get_pcvar_string(cvar_sql_database,database,127);
	
	g_sql_tuple = SQL_MakeDbTuple("","","",database);
	g_sql_connect = SQL_Connect(g_sql_tuple,error_num,g_sql_error,255);
	
	g_sql_available = false;
	
	if(g_sql_connect == Empty_Handle)
	{
		database_error(g_sql_query);
		return PLUGIN_CONTINUE;
	}
	
	g_sql_query = SQL_PrepareQuery(g_sql_connect,"PRAGMA integrity_check");

	if(!SQL_Execute(g_sql_query))
	{
		database_error(g_sql_query);
		SQL_FreeHandle(g_sql_query);
		return PLUGIN_CONTINUE;
	}
	
	if(SQL_NumResults(g_sql_query) > 0 )
	{
		SQL_ReadResult(g_sql_query,0,integrity_check,63);
	}

	if (!equali(integrity_check,"ok"))
	{
		return PLUGIN_CONTINUE;
	}
	
	format(g_sql_string,255,"PRAGMA synchronous = %d",SQLITE_SYNC_OFF);
	g_sql_query = SQL_PrepareQuery(g_sql_connect,g_sql_string);

	if(!SQL_Execute(g_sql_query))
	{
		database_error(g_sql_query);
		SQL_FreeHandle(g_sql_query);
		return PLUGIN_CONTINUE;
	}

	g_sql_available = true;
	
	return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1053\\ f0\\ fs16 \n\\ par }
*/
