1.0.17 • Published 2 years ago
@npmtapi/tapi-lib-non-working-days v1.0.17
Library to manage dynamoDb database.
Only working for lambdas due it has aws-sdk as a dev dependency.(built in for lambdas)
Set credentials:
docker exec -it localstack aws dynamodb create-table --table-name tap-sandbox-non-working-days --endpoint-url=http://localhost:4566 --attribute-definitions '[{"AttributeName":"countryDate", "AttributeType":"S"}]' --key-schema '[{"AttributeName":"countryDate", "KeyType":"HASH"}]' --provisioned-throughput '{ "ReadCapacityUnits": 10, "WriteCapacityUnits": 10 }'
list tables
docker exec -it localstack aws dynamodb list-tables --endpoint-url http://localhost:4566
docker exec -it localstack aws dynamodb put-item \
--table-name tap-sandbox-non-working-days \
--endpoint-url http://localhost:4566 \
--item "{\"countryDate\":{\"S\":\"ar_2023-10-24\"},\"date\":{\"S\":\"01/01/2023\"},\"description\":{\"S\":\"Año Nuevo\"},\"type\":{\"S\":\"inamovible\"},\"country\":{\"S\":\"Argentina\"}}"
describe specific table
docker exec -it localstack aws dynamodb describe-table --table-name tap-sandbox-non-working-days --endpoint-url http://localhost:4566
list all items on table
docker exec -it localstack aws dynamodb scan --table-name tap-sandbox-non-working-days --endpoint-url http://localhost:4566