Kexi API Documentation (2.0 alpha)

NAMESPACE::MySqlConnectionInternal Class Reference

#include <mysqlconnection_p.h>

Inheritance diagram for NAMESPACE::MySqlConnectionInternal:

KexiDB::ConnectionInternal NAMESPACE::MySqlCursorData List of all members.

Detailed Description

Internal MySQL connection data.

Provides a low-level API for accessing MySQL databases, that can be shared by any module that needs direct access to the underlying database. Used by the KexiDB and KexiMigration drivers.

Definition at line 54 of file mysqlconnection_p.h.

Public Member Functions

 MySqlConnectionInternal (KexiDB::Connection *connection)
virtual ~MySqlConnectionInternal ()
bool db_connect (const KexiDB::ConnectionData &data)
 Connects to a MySQL database.
bool db_disconnect ()
 Disconnects from the database.
bool useDatabase (const QString &dbName=QString::null)
 Selects a database that is about to be used.
bool executeSQL (const QString &statement)
 Execute SQL statement on the database.
virtual void storeResult ()
 Stores last operation's result.
QString escapeIdentifier (const QString &str) const
 Escapes a table, database or column name.

Public Attributes

MYSQLmysql
bool mysql_owned
 true if mysql pointer should be freed on destruction
QString errmsg
 server-specific message of last operation
int res
 result code of last operation on server


Constructor & Destructor Documentation

MySqlConnectionInternal::MySqlConnectionInternal KexiDB::Connection connection  ) 
 

Definition at line 41 of file mysqlconnection_p.cpp.

MySqlConnectionInternal::~MySqlConnectionInternal  )  [virtual]
 

Definition at line 49 of file mysqlconnection_p.cpp.

References mysql, and mysql_owned.


Member Function Documentation

bool MySqlConnectionInternal::db_connect const KexiDB::ConnectionData data  ) 
 

Connects to a MySQL database.

Connects to the MySQL server on host as the given user using the specified password. If host is "localhost", then a socket on the local file system can be specified to connect to the server (several defaults will be tried if none is specified). If the server is on a remote machine, then a port is the port that the remote server is listening on.

Todo:
move the list of default sockets to a generic method
Todo:
is latin1() encoding here valid? what about using UTF for passwords?

Definition at line 72 of file mysqlconnection_p.cpp.

References db_disconnect(), KexiDB::ConnectionDataBase::hostName, KexiDBDrvDbg, KexiDB::ConnectionDataBase::localSocketFileName, mysql, KexiDB::ConnectionDataBase::password, KexiDB::ConnectionDataBase::port, storeResult(), KexiDB::ConnectionDataBase::useLocalSocketFile, and KexiDB::ConnectionDataBase::userName.

Referenced by KexiMigration::MySQLMigrate::drv_connect().

bool MySqlConnectionInternal::db_disconnect  ) 
 

Disconnects from the database.

Disconnects from the database.

Definition at line 123 of file mysqlconnection_p.cpp.

References KexiDBDrvDbg, and mysql.

Referenced by db_connect(), and KexiMigration::MySQLMigrate::drv_disconnect().

QString MySqlConnectionInternal::escapeIdentifier const QString str  )  const
 

Escapes a table, database or column name.

Definition at line 156 of file mysqlconnection_p.cpp.

bool MySqlConnectionInternal::executeSQL const QString statement  ) 
 

Execute SQL statement on the database.

Executes the given SQL statement on the server.

Definition at line 141 of file mysqlconnection_p.cpp.

References mysql, and storeResult().

Referenced by KexiMigration::MySQLMigrate::drv_copyTable(), KexiMigration::MySQLMigrate::drv_fetchRecordFromSQL(), KexiMigration::MySQLMigrate::drv_getTableSize(), KexiMigration::MySQLMigrate::drv_queryStringListFromSQL(), KexiMigration::MySQLMigrate::drv_readTableSchema(), KexiMigration::MySQLMigrate::drv_tableNames(), KexiMigration::MySQLMigrate::examineBlobField(), KexiMigration::MySQLMigrate::examineEnumField(), and useDatabase().

void MySqlConnectionInternal::storeResult  )  [virtual]
 

Stores last operation's result.

Implements KexiDB::ConnectionInternal.

Definition at line 57 of file mysqlconnection_p.cpp.

References errmsg, mysql, and res.

Referenced by db_connect(), and executeSQL().

bool MySqlConnectionInternal::useDatabase const QString dbName = QString::null  ) 
 

Selects a database that is about to be used.

Selects dbName as the active database so it can be used.

Definition at line 134 of file mysqlconnection_p.cpp.

References executeSQL().

Referenced by KexiMigration::MySQLMigrate::drv_connect().


Member Data Documentation

QString NAMESPACE::MySqlConnectionInternal::errmsg
 

server-specific message of last operation

Definition at line 80 of file mysqlconnection_p.h.

Referenced by storeResult().

MYSQL* NAMESPACE::MySqlConnectionInternal::mysql
 

Definition at line 78 of file mysqlconnection_p.h.

Referenced by db_connect(), db_disconnect(), KexiMigration::MySQLMigrate::drv_copyTable(), KexiMigration::MySQLMigrate::drv_fetchRecordFromSQL(), KexiMigration::MySQLMigrate::drv_getTableSize(), KexiMigration::MySQLMigrate::drv_queryStringListFromSQL(), KexiMigration::MySQLMigrate::drv_readTableSchema(), KexiMigration::MySQLMigrate::drv_tableNames(), KexiMigration::MySQLMigrate::examineBlobField(), KexiMigration::MySQLMigrate::examineEnumField(), executeSQL(), storeResult(), and ~MySqlConnectionInternal().

bool NAMESPACE::MySqlConnectionInternal::mysql_owned
 

true if mysql pointer should be freed on destruction

Definition at line 79 of file mysqlconnection_p.h.

Referenced by NAMESPACE::MySqlCursorData::MySqlCursorData(), and ~MySqlConnectionInternal().

int NAMESPACE::MySqlConnectionInternal::res
 

result code of last operation on server

Definition at line 81 of file mysqlconnection_p.h.

Referenced by storeResult().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:51:08 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003