We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21521c6 commit f9bc0a6Copy full SHA for f9bc0a6
1 file changed
main.py
@@ -43,16 +43,17 @@ class TodoUpdate(BaseModel):
43
]
44
45
# Create a DynamoDB client using the default credentials and region
46
-dynamodb = boto3.resource("dynamodb")
47
-table = dynamodb.Table("todo-ascan-table")
+dynamodb = boto3.client("dynamodb")
+# table = dynamodb.scan(TableName="todo-ascan-table")
48
+# table = dynamodb.Table("todo-ascan-table")
49
50
@app.get("/")
51
def read_root():
52
return {"Olá": "Ascanianos"}
53
54
@app.get('/todos',response_model=List[Todo])
55
def get_todos():
- return table.scan()
56
+ return dynamodb.scan(TableName="todo-ascan-table")
57
58
@app.get('/todos/{id}', response_model=Todo)
59
def get_todo( id: int ):
0 commit comments