Class: PgEventstore::Maintenance

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_eventstore/maintenance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Maintenance

Returns a new instance of Maintenance.

Parameters:



11
12
13
# File 'lib/pg_eventstore/maintenance.rb', line 11

def initialize(config)
  @config = config
end

Instance Attribute Details

#config=(value) ⇒ PgEventstore::Config



7
8
9
# File 'lib/pg_eventstore/maintenance.rb', line 7

def config
  @config
end

Instance Method Details

#delete_event(event, force: false) ⇒ Boolean

Returns whether an event was deleted successfully.

Parameters:

Returns:

  • (Boolean)

    whether an event was deleted successfully



25
26
27
28
29
# File 'lib/pg_eventstore/maintenance.rb', line 25

def delete_event(event, force: false)
  Commands::DeleteEvent.new(
    Queries.new(transactions: transaction_queries, maintenance: maintenance_queries)
  ).call(event, force: force)
end

#delete_stream(stream) ⇒ Boolean

Returns whether a stream was deleted successfully.

Parameters:

Returns:

  • (Boolean)

    whether a stream was deleted successfully



17
18
19
20
21
# File 'lib/pg_eventstore/maintenance.rb', line 17

def delete_stream(stream)
  Commands::DeleteStream.new(
    Queries.new(transactions: transaction_queries, maintenance: maintenance_queries)
  ).call(stream)
end