With d_str_t being just a struct for holding two strings for convenience. A struct db_t holding all the information needed for connecting to the origin and target databases. Struct options will be used by replicate_db for any options regarding the replication/backup process.
A user will create all those structs and define the three functions connect, close, and replicate where the variable of type db_operations will hold.
For the database operations, we need to provide an API where folks are going to use it to easily enable new/not-supported database support.
This means that we need to define a generic structure similar to the Linux Kernel Module one. Consider we have the following structs as a prototype:
With
d_str_t
being just a struct for holding two strings for convenience. A structdb_t
holding all the information needed for connecting to the origin and target databases. Structoptions
will be used byreplicate_db
for any options regarding the replication/backup process.A user will create all those structs and define the three functions
connect
,close
, andreplicate
where the variable of typedb_operations
will hold.