Skip to content

Commit f9bc0a6

Browse files
committed
add testing database conn dynamodb
1 parent 21521c6 commit f9bc0a6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,17 @@ class TodoUpdate(BaseModel):
4343
]
4444

4545
# Create a DynamoDB client using the default credentials and region
46-
dynamodb = boto3.resource("dynamodb")
47-
table = dynamodb.Table("todo-ascan-table")
46+
dynamodb = boto3.client("dynamodb")
47+
# table = dynamodb.scan(TableName="todo-ascan-table")
48+
# table = dynamodb.Table("todo-ascan-table")
4849

4950
@app.get("/")
5051
def read_root():
5152
return {"Olá": "Ascanianos"}
5253

5354
@app.get('/todos',response_model=List[Todo])
5455
def get_todos():
55-
return table.scan()
56+
return dynamodb.scan(TableName="todo-ascan-table")
5657

5758
@app.get('/todos/{id}', response_model=Todo)
5859
def get_todo( id: int ):

0 commit comments

Comments
 (0)