Skip to content

Supporting multiple same-system databases #63

@panosfol

Description

@panosfol

Currently the way we parse the config file, it doesn't support multiple instances of the same database system.
The user can't provide multiple postgres databases for example to be replicated, because the sections will have overlap
and the previous database information will be overwritten.

Maybe one possible solution is to save each database information on an array. For example"

typedef struct config_t {
	postgres_t *postgres_config;
	smtp_t *smtp_config;
	general_t *general_config;
} config_t;

instead of this, we implement it like this:

typedef struct config_t {
	postgres_array_t **postgres_config;
	smtp_t *smtp_config;
	general_t *general_config;
} config_t;

The size of the array could be malloc'ed at runtime after we parse the .ini file. This of course will require some
refactoring from our side (on db.c for example), therefore I believe should be given high priority to avoid refactoring
larger parts of the codebase in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions