25#ifndef FBCPP_DATABASE_MANAGER_H
26#define FBCPP_DATABASE_MANAGER_H
28#include "ServiceManager.h"
81 std::optional<ReplicaMode> replicaMode;
112 return verboseOutput;
120 verboseOutput = std::move(value);
129 return parallelWorkers;
137 parallelWorkers = value;
197 return ignoreChecksum;
205 ignoreChecksum = value;
295 std::string database;
297 std::optional<std::uint32_t> parallelWorkers;
299 bool validate =
false;
301 bool ignoreChecksum =
false;
302 bool killShadows =
false;
304 bool checkDb =
false;
306 bool upgradeDb =
false;
Executes configuration and maintenance operations through the Firebird service manager.
void setProperties(const DatabasePropertiesOptions &options)
Configures database properties using the provided options.
void repair(const DatabaseRepairOptions &options)
Runs a repair operation using the provided options.
Represents options used to configure database properties through the service manager.
const std::string & getDatabase() const
Returns the database path to be configured.
DatabasePropertiesOptions & setReplicaMode(ReplicaMode value)
Sets the replica mode.
const std::optional< ReplicaMode > & getReplicaMode() const
Returns the replica mode.
DatabasePropertiesOptions & setDatabase(const std::string &value)
Sets the database path to be configured.
Represents options used to run a database maintenance operation through the service manager.
DatabaseRepairOptions & setFull(bool value)
Sets whether full validation should be run.
bool getIgnoreChecksum() const
Returns whether checksum verification is configured to be ignored.
DatabaseRepairOptions & setKillShadows(bool value)
Sets whether killing database shadows should be run.
DatabaseRepairOptions & setUpgradeDb(bool value)
Sets whether database upgrade should be run.
const std::optional< std::uint32_t > & getParallelWorkers() const
Returns the requested number of parallel workers.
DatabaseRepairOptions & setSweep(bool value)
Sets whether database sweep should be run.
DatabaseRepairOptions & setVerboseOutput(ServiceManager::VerboseOutput value)
Sets the verbose output callback.
bool getUpgradeDb() const
Returns whether database upgrade is configured to be run.
DatabaseRepairOptions & setCheckDb(bool value)
Sets whether checking only metadata/structure should be run.
const ServiceManager::VerboseOutput & getVerboseOutput() const
Returns the verbose output callback.
bool getValidate() const
Returns whether database validation is configured to be run.
bool getCheckDb() const
Returns whether checking only metadata/structure is configured to be run.
bool getKillShadows() const
Returns whether killing database shadows is configured to be run.
bool getSweep() const
Returns whether database sweep is configured to be run.
const std::string & getDatabase() const
Returns the database path to be maintained.
DatabaseRepairOptions & setIcu(bool value)
Sets whether recreating ICU indexes should be run.
DatabaseRepairOptions & setIgnoreChecksum(bool value)
Sets whether checksum verification should be ignored.
bool getIcu() const
Returns whether recreating ICU indexes is configured to be run.
bool getMend() const
Returns whether database mending is configured to be run.
DatabaseRepairOptions & setParallelWorkers(std::uint32_t value)
Sets the requested number of parallel workers.
DatabaseRepairOptions & setMend(bool value)
Sets whether database mending should be run.
bool getFull() const
Returns whether full validation is configured to be run.
DatabaseRepairOptions & setDatabase(const std::string &value)
Sets the database path to be maintained.
DatabaseRepairOptions & setValidate(bool value)
Sets whether database validation should be run.
Represents a connection to the Firebird service manager.
ServiceManager(Client &client, const ServiceManagerOptions &options={})
Attaches to the service manager specified by the given options.
std::function< void(std::string_view line)> VerboseOutput
Function invoked when a verbose service output line is available.