Skip to main content

Database

Hosting databases for the C++ Replication API

Abstract

An action can be pushed from the central point of control (<FC_PROD_REPLICATIOM_MGR>) to any node in the Site and executed by that node.

Each DBEngine can host one or more databases. The FairCom replication APIs recognizes the FairCom DB SQL database.

Class

FCREPLDatabase

This class is below DBEngine in the hierarchy. It has a list of tables/files. In c-tree it can of be FairCom DB SQL.

Getters

Table 1. Getters

Database path

const char *GetPath() { return ((pRCESDatabase) this)->GetPath(); };



Inherited getters

Table 2. Inherited getters

Database identification

int GetID();

DBEngine identification

Note

This is linked to FCREPLDBEngine class.

int GetDBEngineID();

Database name

const char *GetName();

Database dictionary file name

const char *GetDictFileName();

Return if database is SQL

bool GetIsSQL();

Retrieve the database path

const char *GetPath();



Setters

Table 3. Setters

Database name

void SetName(const char *name) { ((pRCESDatabase)this)->SetName(name); };

Database dictionary file name

void SetDictFileName(const char *dictFileName) { ((pRCESDatabase)this)->SetDictFileName(dictFileName); };



Inherited setters

Table 4. Inherited setters

Database identification

void SetID(int id);

DBEngine identification

Note

It is linked to FCREPLDBEngine class.

void SetDBEngineID(int dbEngineID);

Set name

void SetName(const char *name);

Set filename string

void SetDictFileName(const char *dictFileName);

Database SQL flag

void SetIsSQL(bool isSQL);



Link a list of files to a database.

Prototype

FCREPL_API int fcReplAddFilesToDatabase(pFCREPLConn replConn, int databaseId, int *fileList, int fileCount);

Parameters

Table 5. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

databaseId [IN]

Database identification

fileList [IN]

File ID list

fileCount [IN]

File count



Return

Error code

Retrieve all the databases entity objects for the given DBEngine identification.

Prototype

FCREPL_API int fcReplGetDatabases(pFCREPLConn replConn, int dbEngineID, ppFCREPLDatabase *databaseList, int *databaseCount);

Parameters

Table 6. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

DBEngine identification

databaseList [OUT]

Database entity list

databaseCount [OUT]

Number of database entities in the list



Return

Error code

Retrieve the database entity object by its name.

Prototype

FCREPL_API int fcReplGetDatabase(pFCREPLConn replConn, int dbEngineID, const char *name, ppFCREPLDatabase database);

Parameters

Table 7. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

DBEngine identification

name [IN]

Database name

database [OUT]

Database entity retrieved



Return

Error code

Add a database entity to the database. If there already is a database with the given dbEngine/name, update the existing record.

Prototype

FCREPL_API int fcReplPersistDatabase(pFCREPLConn replConn, pFCREPLDatabase database);

Parameters

Table 8. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

database [IN]

Database entity to be persisted



Return

Error code

Delete the database by its identification.

Prototype

FCREPL_API int fcReplRemoveDatabase(pFCREPLConn replConn, int databaseID);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

databaseId [IN]

Database identification



Return

Error code