From ad759a168c7b21bdd55e92aa22c0609827343ed0 Mon Sep 17 00:00:00 2001 From: Steffen Waldmann Date: Thu, 30 Jul 2026 14:21:23 +0200 Subject: [PATCH 1/2] feat: `sqlite:memory` preset for SQLite --- guides/databases/sqlite.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/guides/databases/sqlite.md b/guides/databases/sqlite.md index 6cfcb7e999..46a7521d23 100644 --- a/guides/databases/sqlite.md +++ b/guides/databases/sqlite.md @@ -197,3 +197,13 @@ SQLite only has limited support for concurrent database access due to its very c ::: Having said this, there can indeed be scenarios where SQLite might also be used in production, not as the primary database of a business application, but for edge cases, such as using SQLite as in-memory caches. → [Learn more on the _sqlite.org_ website](https://www.sqlite.org/whentouse.html). + +For such cases, configure the `sqlite:memory` preset, which runs an in-memory SQLite database in all profiles, including production: + +::: code-group +```json [package.json] +{ "cds": { "requires": { + "db": "sqlite:memory" // [!code focus] +}}} +``` +::: From 4e109d40a0169d2c3fc732928310f77f2822a9f0 Mon Sep 17 00:00:00 2001 From: Steffen Waldmann Date: Fri, 31 Jul 2026 12:25:48 +0200 Subject: [PATCH 2/2] add --- guides/databases/sqlite.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guides/databases/sqlite.md b/guides/databases/sqlite.md index 46a7521d23..52d385183a 100644 --- a/guides/databases/sqlite.md +++ b/guides/databases/sqlite.md @@ -24,11 +24,11 @@ Essentially this is doing the following: - For CAP Java projects, it adds a Maven dependency for the SQLite JDBC driver. - If MTA deployment is used, it adds an SQLite service to the `mta.yaml` file. -> [!tip] +> [!tip] > Using `cds add sqlite` is the recommended way to set up SQLite in your CAP projects, as it covers both CAP Node.js and CAP Java projects in one step, as well as requisite additions for MTA deployment, if applicable. -### Manual Setup for Node.js +### Manual Setup for Node.js Run this if you want to manually set up SQLite for CAP Node.js projects, instead of using `cds add sqlite`: @@ -80,12 +80,12 @@ Using in-memory databases is the most recommended option for local inner-loop de Node.js projects don't require any build steps to prepare SQLite usage. Instead all necessary artifacts are created on-the-fly when running `cds watch`, indicated by the log output like this: ```log -[cds] - connect to db > sqlite { url: ':memory:' } +[cds] - connect to db > sqlite { url: ':memory:' } > init from db/data/sap.capire.bookshop-Authors.csv > init from db/data/sap.capire.bookshop-Books.csv > init from db/data/sap.capire.bookshop-Books.texts.csv > init from db/data/sap.capire.bookshop-Genres.csv -/> successfully deployed to in-memory database. +/> successfully deployed to in-memory database. ``` ### In CAP Java Projects @@ -139,7 +139,7 @@ spring: ## Using Persistent Databases -You can also use persistent SQLite databases. In this case, the database is deployed and initialized by `cds deploy` and not by the CAP runtimes. +You can also use persistent SQLite databases. In this case, the database is deployed and initialized by `cds deploy` and not by the CAP runtimes. Follow these steps to use a file-based SQLite database: @@ -198,7 +198,7 @@ SQLite only has limited support for concurrent database access due to its very c Having said this, there can indeed be scenarios where SQLite might also be used in production, not as the primary database of a business application, but for edge cases, such as using SQLite as in-memory caches. → [Learn more on the _sqlite.org_ website](https://www.sqlite.org/whentouse.html). -For such cases, configure the `sqlite:memory` preset, which runs an in-memory SQLite database in all profiles, including production: + For such cases, configure the `sqlite:memory` preset, which runs an in-memory SQLite database in all profiles, including production: ::: code-group ```json [package.json]