create_table: Create/Update Dynamo DB Table

Description Usage Arguments References Examples

View source: R/create_table.R

Description

Create or update a Dynamo DB Table

Usage

1
2
3
4
create_table(table, attributes, primary_key, sort_key = NULL,
  read_capacity = 5, write_capacity = 5, ...)

update_table(table, read_capacity = 5, write_capacity = 5, ...)

Arguments

table

A character string specifying the table name.

attributes

A named list of key-value pairs, where the key is the attribute name and value is one of “S” (string), “N” (number), or “B” (binary). Users only need to specify the attribute(s) used for the primary key.

primary_key

The primary key for the database. This should be the name of one of the attributes specified in attributes.

read_capacity

A number specifying read capacity units (i.e., number of reads per second). See References.

write_capacity

A number specifying write capacity units (i.e., number of reads per second). See References.

...

Additional arguments passed to dynamoHTTP.

References

API Guide: CreateTable Provisioned Throughput Primary Key

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
  tab <- create_table(
    table = "Music",
    attributes = list(Artist = "S", SongTitle = "S"),
    primary_key = "Artist",
    sort_key = "SongTitle"
  )

  # cleanup
  delete_table(tab)

## End(Not run)

cloudyr/aws.dynamodb documentation built on Jan. 14, 2020, 4:56 a.m.