module EventSourcery::DynamoDB::Schema

Public Instance Methods

config() click to toggle source
# File lib/event_sourcery/dynamodb/schema.rb, line 17
def config
  ::EventSourcery::DynamoDB.config
end
create_projector_tracker(db:, table_name: config.tracker_table_name) click to toggle source
# File lib/event_sourcery/dynamodb/schema.rb, line 5
def create_projector_tracker(db:, table_name: config.tracker_table_name)
  db.create_table({
    table_name: table_name,
    attribute_definitions: [{attribute_name: "name", attribute_type: "S"}],
    key_schema: [{attribute_name: "name", key_type: "HASH"}],
    provisioned_throughput: {
      read_capacity_units: config.provisioned_reads_per_second,
      write_capacity_units: config.provisioned_writes_per_second,
    },
  })
end