diff --git a/orm_lib/inc/drogon/orm/DbClient.h b/orm_lib/inc/drogon/orm/DbClient.h index cfe00e37..626d7a5a 100644 --- a/orm_lib/inc/drogon/orm/DbClient.h +++ b/orm_lib/inc/drogon/orm/DbClient.h @@ -36,14 +36,36 @@ typedef std::function ExceptionCallback; class Transaction; +/// Database client abstract class class DbClient : public trantor::NonCopyable { public: virtual ~DbClient(){}; + /// Create new database client with multiple connections; + /** + * @param connInfo: Connection string with some parameters, + * each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. + * To write an empty value, or a value containing spaces, surround it with single quotes, e.g., + * keyword = 'a value'. Single quotes and backslashes within the value must be escaped with a backslash, + * i.e., \' and \\. + * Example: + * host=localhost port=5432 dbname=mydb connect_timeout=10 password='' + * The currently recognized parameter key words are: + * - host: can be either a host name or an IP address. + * - port: Port number to connect to at the server host. + * - dbname: The database name. Defaults to be the same as the user name. + * - user: user name to connect as. With PostgreSQL defaults to be the same as + * the operating system name of the user running the application. + * - password: Password to be used if the server demands password authentication. + * + * Other key words for PostgreSQL, please refer to the documentation of PostgreSQL. + * + * @param connNum: The number of connections to database server; + */ #if USE_POSTGRESQL static std::shared_ptr newPgClient(const std::string &connInfo, const size_t connNum); #endif - //Async method, nonblocking by default; + ///Async method, nonblocking by default; template < typename FUNCTION1, typename FUNCTION2, diff --git a/trantor b/trantor index 1c96f8cf..90a3ba84 160000 --- a/trantor +++ b/trantor @@ -1 +1 @@ -Subproject commit 1c96f8cf24297a63e2e85428965a4247f262dbcf +Subproject commit 90a3ba84b157923ea8b5858a4d16733f02d88c10