Exploring Supported Databases
The CAP Node.js runtime provides out-of-the-box support for various databases.
Watch the video to learn about supported databases.
Auto-Wired Configuration
In CAP, the so-called cds-plugin technique is used to integrate a database into an application. Essentially, these database plugins are Node.js packages that allow CAP to connect and interact with a specific database, with no additional configuration required. Each supported database has a corresponding cds-plugin package.
Note
CAP's plugin mechanism searches the project dependencies configured inpackage.json
for packages that contain a module called cds-plugin.js
and loads it if available. Main benefit of that is that adding a feature to a project, like a database in this case, just requires a simple npm add
.By using these database plugins, developers can easily switch between different databases during development and production without having to change the application code.
To automatically configure SQLite for development, install the corresponding database package with the following command in the terminal:
1npm add @cap-js/sqlite -D
Execute the following command to use SAP HANA Cloud for production:
1npm add @sap/cds-hana
Custom Configuration
The Node.js database packages wire things up automatically through configuration defaults that are set via the cds-plugin mechanism. You can use the default configuration provided by the packages for your application or override individual properties. We will see how to do this later in this learning journey.
To see the effective database configuration, you can run the cds env command for the cds.requires.db key in the root folder of your project, as shown in figure Inspecting the Effective Configuration.

The configuration options returned by the command are as follows:
- impl - the module name of the implementation of a CAP database service
- credentials - an object with db-specific configurations, most commonly url
- kind - a name of a preset, such as sqlite or hana