#include <sqldatabase.hpp>
Inheritance diagram for SqlDatabase:

Public Member Functions | |
| SqlDatabase (const string &dbName="", const string &user="", const string &passwd="", const string &host="localhost", const int port=0, const string &unixSocket="", const unsigned long clientFlag=0) | |
| Constructor. | |
| virtual | ~SqlDatabase () |
| Destructor. | |
| virtual void | close ()=0 |
| Close connection. | |
| virtual string | escapeString (const string &original) const=0 |
| Escape special characters. | |
| virtual string | version () const=0 |
| Version information. | |
Friends | |
| SqlResult | SqlQuery::operator() (const string &) |
Definition at line 40 of file sqldatabase.hpp.
| SqlDatabase::SqlDatabase | ( | const string & | dbName = "", |
|
| const string & | user = "", |
|||
| const string & | passwd = "", |
|||
| const string & | host = "localhost", |
|||
| const int | port = 0, |
|||
| const string & | unixSocket = "", |
|||
| const unsigned long | clientFlag = 0 | |||
| ) | [inline] |
Constructor.
The constructor for creating a connection to the database. You must provide the arguments needed for connecting to the SQL engine you are using. For SQLite only dbName is used, for other backends you may need to get the values of the arguments from your system administrator.
| dbName | Name of the database. | |
| user | User name for authentication. | |
| passwd | Password for authentication. | |
| host | Host name to the database. Default is 'localhost'. | |
| port | The port used for connecting to the database. | |
| unixSocket | For local connections. | |
| clientFlag | Options to be sent to database server. |
Definition at line 57 of file sqldatabase.hpp.
| virtual SqlDatabase::~SqlDatabase | ( | ) | [inline, virtual] |
| virtual void SqlDatabase::close | ( | ) | [pure virtual] |
Close connection.
This will close and clean up the database connection, including freeing memory. Note: It does not delete the SqlDatabase object itself.
Implemented in MySqlContext, PostgresContext, Sqlite2Context, and Sqlite3Context.
| virtual string SqlDatabase::escapeString | ( | const string & | original | ) | const [pure virtual] |
Escape special characters.
This function can be used to escape special characters (like single quotes) when building an SQL statement.
| original | The string that you want escaped. |
| virtual string SqlDatabase::version | ( | ) | const [pure virtual] |
Version information.
Get the version information of the underlying API library, not the version of SqlWrapperXX.
Implemented in MySqlContext, PostgresContext, Sqlite2Context, and Sqlite3Context.
| SqlResult SqlQuery::operator() | ( | const string & | ) | [friend] |
1.5.0