Skip to content

Commit 9efd9e9

Browse files
committed
Grammar fixes and deleting redundant comment block.
1 parent 7dbf844 commit 9efd9e9

File tree

3 files changed

+2
-50
lines changed

3 files changed

+2
-50
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,5 +532,5 @@ In this tutorial, you have:
532532
If you have any feature requests or notice any bugs, share your feedback directly with the Cloudflare team by joining the [Cloudflare Developers community on Discord](https://discord.cloudflare.com).
533533

534534
- See supported [Wrangler commands for D1](/workers/wrangler/commands/#d1).
535-
- Learn how to use the [D1 Worker Binding API](/d1/worker-api/) within your Worker, and test them from the [API playground](/d1/worker-api/#api-playground).
535+
- Learn how to use [D1 Worker Binding APIs](/d1/worker-api/) within your Worker, and test them from the [API playground](/d1/worker-api/#api-playground).
536536
- Explore [community projects built on D1](/d1/reference/community-projects/).

src/content/docs/d1/worker-api/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Refer to the relevant sections for the API documentation.
1717

1818
## Typescript support
1919

20-
D1 Worker Bindings API is fully-typed via the [`@cloudflare/workers-types`](/workers/languages/typescript/#typescript) package, and also supports [generic types](https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-types) as part of its TypeScript API. A generic type allows you to provide an optional _type parameter_ so that a function understands the type of the data it is handling.
20+
D1 Worker Bindings API is fully-typed via the [`@cloudflare/workers-types`](/workers/languages/typescript/#typescript) package, and also supports [generic types](https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-types) as part of its TypeScript API. A generic type allows you to provide an optional `type parameter` so that a function understands the type of the data it is handling.
2121

2222
When using the [query statement methods](/d1/worker-api/run-a-statement) `stmt.run()`, `stmt.raw()` and `stmt.first()`, you can provide a type representing each database row. D1's API will [return the result object](#return-object) with the correct type.
2323

src/content/docs/d1/worker-api/run-a-statement.mdx

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -220,54 +220,6 @@ return Response.json(returnValue)
220220
- `stmt.first()` does not alter the SQL query. To improve performance, consider appending `LIMIT 1` to your statement.
221221
- When using TypeScript, you can pass a [type parameter](/d1/build-with-d1/d1-client-api/#typescript-support) to `first()` to return a typed result object.
222222

223-
{/* ### `stmt.all()`
224-
225-
Returns all rows as an array of objects, with each result row represented as an object on the `results` property of the `D1Result` type.
226-
227-
```js
228-
const { results } = await stmt.all();
229-
```
230-
231-
#### Parameters
232-
233-
- None.
234-
235-
#### Return values
236-
237-
- <code>Array</code>: <Type text="Array"/>
238-
- An array of objects.
239-
- Each row represents a row.
240-
- Each object is created on the `results` property of the `D1Result` type.
241-
242-
<Details header="Example of return values" open = {false}>
243-
```js
244-
const stmt = db.prepare("SELECT name, age FROM users LIMIT 3");
245-
const { results } = await stmt.all();
246-
console.log(results);
247-
```
248-
249-
```js output
250-
[
251-
{
252-
name: "John",
253-
age: 42,
254-
},
255-
{
256-
name: "Anthony",
257-
age: 37,
258-
},
259-
{
260-
name: "Dave",
261-
age: 29,
262-
},
263-
]
264-
```
265-
</Details>
266-
267-
#### Guidance
268-
269-
- When joining tables with identical column names, only the leftmost column will be included in the row object. Use [`stmt.raw()`](#await-stmtraw) to return all rows as an array of arrays.
270-
- When using TypeScript, you can pass a [type parameter](/d1/build-with-d1/d1-client-api/#typescript-support) to `all()` to return a typed result object. */}
271223
### `db.batch()`
272224

273225
Sends multiple SQL statements inside a single call to the database. This can have a huge performance impact as it reduces latency from network round trips to D1. D1 operates in auto-commit. Our implementation guarantees that each statement in the list will execute and commit, sequentially, non-concurrently.

0 commit comments

Comments
 (0)