Description
CDS 10 replaces the default SQLite driver for local development and testing with Node.js's built-in node:sqlite module, which is available from Node.js 22.5 without any additional package. Previously, better-sqlite3 (or sql.js as a fallback) was installed as a transitive dependency of @cap-js/sqlite. Projects that explicitly pin better-sqlite3 or override cds.requires.db.driver will continue to work but must ensure the package is present in their own dependencies/devDependencies. Projects running on Node.js versions below 22.5 must either upgrade Node.js or explicitly configure the legacy driver.
How to Check
- [ ] Check
cds envoutput forcds.requires.db.driver— if set tobetter-sqlite3orsql.js, verify whether this is intentional or inherited. - [ ] Check
package.json(andpackage-lock.json/pnpm-lock.yaml) for a direct or indirect dependency onbetter-sqlite3orsql.jsthat is not explicitly declared as adevDependency. - [ ] Confirm the project's Node.js version is ≥ 22.5. If not, the built-in
node:sqliteis unavailable and the legacy driver must be configured explicitly. - [ ] Check
.cdsrc.jsonand anypackage.jsoncdssections for arequires.db.driveroverride.
Migration Steps
If the project relies on
node:sqlite(no driver override, Node.js ≥ 22.5): no change needed — the new default is in effect automatically.If the project must keep
better-sqlite3(e.g. Node.js < 22.5 or test infrastructure dependency), add it as an explicitdevDependencyand configure the driver:diff// package.json { "devDependencies": { + "better-sqlite3": "^9.0.0" }, "cds": { "requires": { "db": { + "driver": "better-sqlite3" } } } }If you need time to migrate (e.g. to upgrade Node.js or adjust test infrastructure), temporarily set the compat flag to restore the previous driver:
diff// package.json or .cdsrc.json { "cds": { "features": { + "sqlite_driver": "better-sqlite3" } } }Remove the flag once the migration is complete.
To upgrade Node.js and use the new default, remove any explicit driver configuration and the
better-sqlite3dev dependency:diff// package.json { "devDependencies": { - "better-sqlite3": "^9.0.0" }, "cds": { "requires": { "db": { - "driver": "better-sqlite3" } } } }
Notes
The node:sqlite built-in is a stable API as of Node.js 22.5 (unflagged). Projects using older Node.js LTS versions (18, 20) must configure the legacy driver explicitly. The change only affects local development and test environments — HANA is unaffected.