Enable mod_lua to use native pgsql dbh support

This commit is contained in:
William King 2012-11-07 17:47:39 -08:00
parent bfe3fdf347
commit 2cea7f0ff6
1 changed files with 6 additions and 0 deletions

View File

@ -342,6 +342,12 @@ Dbh::Dbh(char *dsn, char *user, char *pass)
if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_CORE_DB, &options) == SWITCH_STATUS_SUCCESS) {
m_connected = true;
}
} else if (!strncasecmp(dsn, "pgsql://", 8)) {
type = SCDB_TYPE_PGSQL;
options.pgsql_options.dsn = (char *)(dsn + 8);
if (switch_cache_db_get_db_handle(&dbh, SCDB_TYPE_PGSQL, &options) == SWITCH_STATUS_SUCCESS) {
m_connected = true;
}
} else {
options.odbc_options.dsn = dsn;
options.odbc_options.user = user;