Skip to main content

Class: SaveBackupToPathCommand

Defined in: electron/services/commands/DatabaseCommands.ts:437

Command for saving a SQLite database backup directly to disk.

Remarks

This command exists to support backup workflows that should not load the entire backup into memory (e.g. large databases). The command delegates to DataBackupService#saveDatabaseBackupToPath.

Hierarchy

View Summary

Extends

Constructors

Constructor

new SaveBackupToPathCommand(context: DatabaseCommandContext & { targetPath: string; }): SaveBackupToPathCommand

Defined in: electron/services/commands/DatabaseCommands.ts:455

Parameters

context

DatabaseCommandContext & { targetPath: string; }

Returns

SaveBackupToPathCommand

Overrides

DatabaseCommand.constructor

Properties

cache

protected readonly cache: StandardizedCache<Site>

Defined in: electron/services/commands/DatabaseCommands.ts:127

Site cache for data synchronization during operations

Inherited from

DatabaseCommand.cache


eventEmitter

protected readonly eventEmitter: TypedEventBus<UptimeEvents>

Defined in: electron/services/commands/DatabaseCommands.ts:130

Event bus for emitting command execution events

Inherited from

DatabaseCommand.eventEmitter


serviceFactory

protected readonly serviceFactory: DatabaseServiceFactory

Defined in: electron/services/commands/DatabaseCommands.ts:133

Factory for accessing database services and repositories

Inherited from

DatabaseCommand.serviceFactory


configurationManager

protected readonly configurationManager: ConfigurationManager | undefined

Defined in: electron/services/commands/DatabaseCommands.ts:136

Optional configuration manager used for validation flows

Inherited from

DatabaseCommand.configurationManager


updateHistoryLimit

protected readonly updateHistoryLimit: (limit: number) => Promise<void> | undefined

Defined in: electron/services/commands/DatabaseCommands.ts:139

Optional history limit updater for settings propagation

Inherited from

DatabaseCommand.updateHistoryLimit


targetPath

private readonly targetPath: string

Defined in: electron/services/commands/DatabaseCommands.ts:438

Methods

emitFailureEvent()

protected emitFailureEvent<K>(eventType: K, error: Error, data?: Partial<UptimeEvents[K]>): Promise<void>

Defined in: electron/services/commands/DatabaseCommands.ts:156

Internal

Emits a failure event for the command operation.

Type Parameters

K

K extends string

Parameters

eventType

K

The event type to emit.

error

Error

The ://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error that occurred.

data?

Partial<UptimeEvents[K]> = {}

Additional event data to include in the event payload.

Returns

Promise<void>

Remarks

Used internally to emit a typed event indicating command failure, including error details and additional event data.

Inherited from

DatabaseCommand.emitFailureEvent


emitSuccessEvent()

protected emitSuccessEvent<K>(eventType: K, data: Partial<UptimeEvents[K]>): Promise<void>

Defined in: electron/services/commands/DatabaseCommands.ts:181

Internal

Emits a success event for the command operation.

Type Parameters

K

K extends string

Parameters

eventType

K

The event type to emit.

data

Partial<UptimeEvents[K]>

Additional event data to include in the event payload.

Returns

Promise<void>

Remarks

Used internally to emit a typed event indicating command success, including additional event data.

Inherited from

DatabaseCommand.emitSuccessEvent


rollback()

rollback(): Promise<void>

Defined in: electron/services/commands/DatabaseCommands.ts:440

Rolls back the command operation if possible.

Returns

Promise<void>

Promise resolving when rollback is complete.

Remarks

Attempts to revert the effects of the command. Not all commands require rollback.

Overrides

DatabaseCommand.rollback


validate()

validate(): Promise<{ errors: string[]; isValid: boolean; }>

Defined in: electron/services/commands/DatabaseCommands.ts:445

Validates the command before execution.

Returns

Promise<{ errors: string[]; isValid: boolean; }>

Promise resolving to validation result.

Remarks

Ensures the command is in a valid state before execution. Returns a validation result with errors if any.

Overrides

DatabaseCommand.validate


execute()

execute(): Promise<DatabaseBackupMetadata>

Defined in: electron/services/commands/DatabaseCommands.ts:450

Executes the command operation.

Returns

Promise<DatabaseBackupMetadata>

Promise resolving to the operation result.

Remarks

Performs the main database operation encapsulated by the command.

Throws

When command execution fails.

Overrides

DatabaseCommand.execute


getDescription()

getDescription(): string

Defined in: electron/services/commands/DatabaseCommands.ts:462

Gets a description of the command for logging and debugging.

Returns

string

Human-readable command description.

Overrides

DatabaseCommand.getDescription