Function createDbClient


#include <lib/inc/drogon/HttpAppFramework.h>

virtual HttpAppFramework & createDbClient(const std::string &dbType, const std::string &host, const unsigned short port, const std::string &databaseName, const std::string &userName, const std::string &password, const size_t connectionNum=1, const std::string &filename="", const std::string &name="default", const bool isFast=false, const std::string &characterSet="")=0


Create a database client.


dbType - The database type is one of "postgresql","mysql","sqlite3".

host - IP or host name.

port - The port on which the database server is listening. @databaseName Database name

userName - User name

password - Password for the database server

connectionNum - The number of connections to the database server. It's valid only if

isFast - is false.

filename - The file name of sqlite3 database file.

name - The client name.

isFast - Indicates if the client is a fast database client.

This operation can be performed by an option in the configuration file.

Mentioned in


Line 1122 in lib/inc/drogon/HttpAppFramework.h.

Add Discussion as Guest

Log in to DocsForge