Skip to content

Commit 5e065f1

Browse files
authored
Fixing instances of D1 all() to run() (#24172)
1 parent 8c1bbf8 commit 5e065f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ After you have set up your database, run an SQL query from within your Worker.
359359
1. Define a binding to your D1 database in your code. This binding matches the `binding` value you set in the [Wrangler configuration file](/workers/wrangler/configuration/) under `d1_databases`.
360360
2. Query your database using `env.DB.prepare` to issue a [prepared query](/d1/worker-api/d1-database/#prepare) with a placeholder (the `?` in the query).
361361
3. Call `bind()` to safely and securely bind a value to that placeholder. In a real application, you would allow a user to pass the `CompanyName` they want to list results for. Using `bind()` prevents users from executing arbitrary SQL (known as "SQL injection") against your application and deleting or otherwise modifying your database.
362-
4. Execute the query by calling `all()` to return all rows (or none, if the query returns none).
362+
4. Execute the query by calling [`run()`](/d1/worker-api/prepared-statements/#run) to return all rows (or none, if the query returns none).
363363
5. Return your query results, if any, in JSON format with `Response.json(results)`.
364364

365365
</Steps>

0 commit comments

Comments
 (0)