Class: ClaudeMemory::Commands::Checks::DatabaseCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_memory/commands/checks/database_check.rb

Overview

Checks database existence, schema, and health

Instance Method Summary collapse

Constructor Details

#initialize(db_path, label) ⇒ DatabaseCheck

Returns a new instance of DatabaseCheck.



8
9
10
11
# File 'lib/claude_memory/commands/checks/database_check.rb', line 8

def initialize(db_path, label)
  @db_path = db_path
  @label = label
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/claude_memory/commands/checks/database_check.rb', line 13

def call
  unless File.exist?(@db_path)
    return missing_database_result
  end

  check_database_health
rescue => e
  {
    status: :error,
    label: @label,
    message: "#{@label} database error: #{e.message}",
    details: {}
  }
end