Your D1 Database contains the following data:
> SELECT * FROM comments LIMIT 3;
[
{
"id": 1,
"author": "Kristian",
"body": "Great post!",
"post_slug": "hello-world"
},
{
"id": 2,
"author": "Serena",
"body": "Keep up the good work.",
"post_slug": "hello-world"
},
{
"id": 3,
"author": "Max",
"body": "Thanks for the great writeup.",
"post_slug": "tutorial-123"
},
{
"id": 4,
"author": "Zeb",
"body": "Well written!",
"post_slug": "tutorial-123"
},
{
"id": 5,
"author": "Shaun",
"body": "Looking forward to a part 2!",
"post_slug": "tutorial-123"
},
{
"id": 6,
"author": "wang",
"body": "fdalfjdlaj",
"post_slug": "tutorial-124"
}
]
Build a comments API with Workers and D1