Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/content/docs/d1/sql-api/sql-statements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ You can execute any of these statements via the D1 console in the Cloudflare das

## Supported SQLite extensions

D1 supports a subset of SQLite extensions for added functionality, including:

- Default SQLite extensions.
- [FTS5 module](https://www.sqlite.org/fts5.html) for full-text search.
<Render file="d1-do-supported-sqlite-extensions" product="d1" params={{ product: "D1 supports" }}/>

## Compatible PRAGMA statements

Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/durable-objects/api/storage-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class Counter extends DurableObject {

}

````
```
</TypeScriptExample>

JavaScript is a single-threaded and event-driven programming language. This means that JavaScript runtimes, by default, allow requests to interleave with each other which can lead to concurrency bugs. The Durable Objects runtime uses a combination of <GlossaryTooltip term="input gate">input gates</GlossaryTooltip> and <GlossaryTooltip term="output gate">output gates</GlossaryTooltip> to avoid this type of concurrency bug when performing storage operations. Learn more in our [blog post](https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/).
Expand Down Expand Up @@ -103,12 +103,14 @@ export class MyDurableObject extends DurableObject {
`);
}
}
````
```

- SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Object classes with SQLite storage backend](/durable-objects/best-practices/access-durable-objects-storage/#create-sqlite-backed-durable-object-class) and will return an error if called on Durable Object classes with a key-value storage backend.
- When writing data, every index counts as an additional row. However, indexes may be beneficial for read-heavy use cases. Refer to [Index for SQLite Durable Objects](/durable-objects/best-practices/access-durable-objects-storage/#index-for-sqlite-durable-objects).
- Writing data to [SQLite virtual tables](https://www.sqlite.org/vtab.html) also counts towards rows written.

<Render file="d1-do-supported-sqlite-extensions" product="d1" params={{ product: "Durable Objects support" }}/>

### `exec`

<code>
Expand Down
11 changes: 11 additions & 0 deletions src/content/partials/d1/d1-do-supported-sqlite-extensions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
params:
- product
---

{props.product} a subset of SQLite extensions for added functionality, including:

- [FTS5 module](https://www.sqlite.org/fts5.html) for full-text search.
- [Maths functions](https://sqlite.org/lang_mathfunc.html).

Refer to the [source code](https://github.com/cloudflare/workerd/blob/4c42a4a9d3390c88e9bd977091c9d3395a6cd665/src/workerd/util/sqlite.c%2B%2B#L269) for the full list of supported functions.
Loading