]> the.earth.li Git - onak.git/blobdiff - keydb_pg.c
Properly isolate database backend configuration
[onak.git] / keydb_pg.c
index ca7e35bac0545796f4fe32c768a4b47af2ec78d0..d599afecc97ee3012f1dd96294d78b2490eea6b7 100644 (file)
@@ -666,7 +666,7 @@ static void pg_cleanupdb(struct onak_dbctx *dbctx)
  *     this file are called in order to allow the DB to be initialized ready
  *     for access.
  */
-struct onak_dbctx *keydb_pg_init(bool readonly)
+struct onak_dbctx *keydb_pg_init(struct onak_db_config *dbcfg, bool readonly)
 {
        struct onak_dbctx *dbctx;
        PGconn *dbconn;
@@ -675,6 +675,7 @@ struct onak_dbctx *keydb_pg_init(bool readonly)
        if (dbctx == NULL) {
                return NULL;
        }
+       dbctx->config = dbcfg;
 
        dbconn = PQsetdbLogin(config.pg_dbhost, // host
                        NULL, // port