diff --git a/src/content/docs/d1/sql-api/sql-statements.mdx b/src/content/docs/d1/sql-api/sql-statements.mdx index 0ce7a9cb80985c..d9ebf7626368ff 100644 --- a/src/content/docs/d1/sql-api/sql-statements.mdx +++ b/src/content/docs/d1/sql-api/sql-statements.mdx @@ -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. + ## Compatible PRAGMA statements diff --git a/src/content/docs/durable-objects/api/storage-api.mdx b/src/content/docs/durable-objects/api/storage-api.mdx index 532b096f3c0a2c..d95c0105af8c17 100644 --- a/src/content/docs/durable-objects/api/storage-api.mdx +++ b/src/content/docs/durable-objects/api/storage-api.mdx @@ -71,7 +71,7 @@ export class Counter extends DurableObject { } -```` +``` 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 input gates and output gates 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/). @@ -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. + + ### `exec` diff --git a/src/content/partials/d1/d1-do-supported-sqlite-extensions.mdx b/src/content/partials/d1/d1-do-supported-sqlite-extensions.mdx new file mode 100644 index 00000000000000..ea530442f74199 --- /dev/null +++ b/src/content/partials/d1/d1-do-supported-sqlite-extensions.mdx @@ -0,0 +1,12 @@ +--- +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 (including `fts5vocab`). +- [JSON extension](https://www.sqlite.org/json1.html) for JSON functions and operators. +- [Math 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. \ No newline at end of file