How can I get rid of the buffer object returned when using Magical sql operator?

This is and example of how I execute the query:
const id = 69;
await db.execute(sql`select * from ${usersTable} where ${usersTable.id} = ${id}`)
`)

return NextResponse.json({ menu });
const id = 69;
await db.execute(sql`select * from ${usersTable} where ${usersTable.id} = ${id}`)
`)

return NextResponse.json({ menu });
Which returns the data with a _bug object that I don't need.
{
"menu": [
[
{
"id": 1,
"title": "Steak & Frites",
"description": "Delicious steak rib with french fries",
"price": "35.00",
"status": "available",
"name": "Main Course"
}
],
[
{
"_buf": {
"type": "Buffer",
"data": [
....
]
{
"menu": [
[
{
"id": 1,
"title": "Steak & Frites",
"description": "Delicious steak rib with french fries",
"price": "35.00",
"status": "available",
"name": "Main Course"
}
],
[
{
"_buf": {
"type": "Buffer",
"data": [
....
]
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server