# NOT RUN {
endp <- table_endpoint("https://mycosmosdb.table.cosmos.azure.com:443", key="mykey")
tab <- create_storage_table(endp, "mytable")
insert_table_entity(tab, list(
RowKey="row1",
PartitionKey="partition1",
firstname="Bill",
lastname="Gates"
))
get_table_entity(tab, "row1", "partition1")
# specifying the entity as JSON text instead of a list
update_table_entity(tab,
'{
"RowKey": "row1",
"PartitionKey": "partition1",
"firstname": "Bill",
"lastname": "Gates"
}')
# we can import to the same table as above: table storage doesn't enforce a schema
import_table_entities(tab, mtcars,
row_key=row.names(mtcars),
partition_key=as.character(mtcars$cyl))
list_table_entities(tab)
list_table_entities(tab, filter="firstname eq 'Satya'")
list_table_entities(tab, filter="RowKey eq 'Toyota Corolla'")
delete_table_entity(tab, "row1", "partition1")
# }
Run the code above in your browser using DataLab