Skip to content

Fix example code for D1 storage #18928

@ss49919201

Description

@ss49919201

Existing documentation URL(s)

What changes are you suggesting?

const db = await mf.getD1Database("DB");
const { results } = await db.prepare("<Query>");

The above code in the document is incorrect.
D1Database.prepare returns D1PreparedStatement.
But it looks as if it is returning D1Result.
Should call run or all!

Additional information

No response

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:d1D1: https://developers.cloudflare.com/d1/product:workersRelated to Workers product

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions