25#ifndef FBCPP_DATABASE_MANAGER_H
26#define FBCPP_DATABASE_MANAGER_H
28#include "ServiceManager.h"
29#include "fb-cpp-export.h"
140 shutdownMode = value;
157 shutdownType = value;
166 return shutdownTimeout;
174 shutdownTimeout = value;
196 std::string database;
197 std::optional<ReplicaMode> replicaMode;
198 std::optional<ShutdownMode> shutdownMode;
199 std::optional<ShutdownType> shutdownType;
200 std::optional<int> shutdownTimeout;
201 std::optional<bool> online;
232 return verboseOutput;
240 verboseOutput = std::move(value);
249 return parallelWorkers;
257 parallelWorkers = value;
317 return ignoreChecksum;
325 ignoreChecksum = value;
415 std::string database;
417 std::optional<std::uint32_t> parallelWorkers;
419 bool validate =
false;
421 bool ignoreChecksum =
false;
422 bool killShadows =
false;
424 bool checkDb =
false;
426 bool upgradeDb =
false;
435 using ServiceManager::ServiceManager;
Executes configuration and maintenance operations through the Firebird service manager.
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< bool > & getOnline() const
Returns whether the database should be brought online.
const std::optional< ReplicaMode > & getReplicaMode() const
Returns the replica mode.
DatabasePropertiesOptions & setShutdownMode(ShutdownMode value)
Sets the shutdown mode.
const std::optional< ShutdownMode > & getShutdownMode() const
Returns the shutdown mode.
const std::optional< ShutdownType > & getShutdownType() const
Returns the shutdown type.
const std::optional< int > & getShutdownTimeout() const
Returns the shutdown timeout in seconds.
DatabasePropertiesOptions & setShutdownType(ShutdownType value)
Sets the shutdown type.
DatabasePropertiesOptions & setShutdownTimeout(int value)
Sets the shutdown timeout in seconds.
DatabasePropertiesOptions & setOnline(bool value)
Sets whether the database should be brought online.
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.
std::function< void(std::string_view line)> VerboseOutput
Function invoked when a verbose service output line is available.
ShutdownType
Shutdown type for a Firebird database.
@ DENY_TRANSACTIONS
Deny new transactions: waits for existing transactions to finish.
@ FORCED
Forced shutdown: disconnects all users immediately after the timeout.
@ DENY_ATTACHMENTS
Deny new attachments: waits for existing connections to finish.
ShutdownMode
Shutdown mode for a Firebird database.
@ SINGLE
Single-user shutdown.
@ NORMAL
Normal online state.
@ FULL
Full exclusive shutdown.
@ MULTI
Multi-user shutdown.