Class: Acta::Adapters::Postgres

Inherits:
Base
  • Object
show all
Defined in:
lib/acta/adapters/postgres.rb

Instance Method Summary collapse

Methods inherited from Base

#install_schema

Instance Method Details

#fetch_recordsObject



25
26
27
# File 'lib/acta/adapters/postgres.rb', line 25

def fetch_records
  Acta::Record.order(:id)
end

#insert_event(attributes) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/acta/adapters/postgres.rb', line 14

def insert_event(attributes)
  stream_type = attributes[:stream_type]
  stream_key = attributes[:stream_key]

  if stream_type && stream_key
    insert_streamed(attributes, stream_type:, stream_key:)
  else
    Acta::Record.create!(**attributes)
  end
end

#json_column_typeObject



10
11
12
# File 'lib/acta/adapters/postgres.rb', line 10

def json_column_type
  :jsonb
end

#uuid_column_typeObject



6
7
8
# File 'lib/acta/adapters/postgres.rb', line 6

def uuid_column_type
  :uuid
end