Class: CommandPost::SequenceGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/command_post/identity/sequence_generator.rb

Class Method Summary collapse

Class Method Details

.aggregate_idObject



11
12
13
14
15
16
17
18
# File 'lib/command_post/identity/sequence_generator.rb', line 11

def self.aggregate_id
  @@DB ||= Connection.db_cqrs
  val = 0
  @@DB.fetch("SELECT nextval('aggregate');") do |row|
    val = row[row.keys.first]
  end
  val
end

.miscObject



29
30
31
32
33
34
35
36
# File 'lib/command_post/identity/sequence_generator.rb', line 29

def self.misc
  @@DB ||= Connection.db_cqrs
  val = 0
  @@DB.fetch("SELECT nextval('misc');") do |row|
    val = row[row.keys.first]
  end
  val
end

.transaction_idObject



20
21
22
23
24
25
26
27
# File 'lib/command_post/identity/sequence_generator.rb', line 20

def self.transaction_id
  @@DB ||= Connection.db_cqrs
  val = 0
  @@DB.fetch("SELECT nextval('transaction');") do |row|
    val = row[row.keys.first]
  end
  val
end