Skip to content

Commit 5b7e564

Browse files
authored
Update get-started.mdx
We were using .run() instead of .all() If my knowledge is correct: 1. we use .all() for SELECT queries to get the actual rows. 2. we use .run() is for INSERT/UPDATE/DELETE and returns metadata. In the description below, we were explaining for ".all()" but were using ".run()" in actual code.
1 parent f4112f5 commit 5b7e564

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/docs/d1/get-started.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ After you have set up your database, run an SQL query from within your Worker.
342342
"SELECT * FROM Customers WHERE CompanyName = ?",
343343
)
344344
.bind("Bs Beverages")
345-
.run();
345+
.all();
346346
return Response.json(results);
347347
}
348348

@@ -387,7 +387,7 @@ You can query your D1 database using your Worker.
387387
"SELECT * FROM Customers WHERE CompanyName = ?"
388388
)
389389
.bind("Bs Beverages")
390-
.run();
390+
.all();
391391
return new Response(JSON.stringify(results), {
392392
headers: { 'Content-Type': 'application/json' }
393393
});

0 commit comments

Comments
 (0)