cds-dbm

raw JSON →
0.0.4 verified Sat Apr 25 auth: no javascript

Database deployment and migrations for SAP CAP models supporting non-HANA relational databases. Current stable version is 0.0.4. It extends @sap/cds with Liquibase-based CLI commands (deploy, load, diff, drop) and a custom build task for SAP BTP Cloud Foundry. Key differentiators: enables CAP on PostgreSQL via cds-pg adapter, automated delta deployments using zero-downtime schema cloning. Release cadence is low (single patch).

error Error: Cannot find module 'cds-dbm/commands'
cause Incorrect import path or not installed
fix
Run 'npm install cds-dbm' and use 'import { deploy } from 'cds-dbm/commands''
error java.lang.RuntimeException: java.io.IOException: Cannot run program "java": error=2, No such file or directory
cause Java not installed or not in PATH
fix
Install JRE >= 8 and ensure 'java' command works in terminal
error Error: cds-dbm requires a 'cds.migrations.db' configuration in package.json
cause Missing or incorrect configuration block
fix
Add the required migrations configuration as shown in the README
error LiquibaseException: liquibase.exception.DatabaseException: Connection could not be created
cause Missing database credentials or driver
fix
Set environment variables for DB connection (e.g., DATABASE_URL) and install database adapter
gotcha JRE >= 8 required on system; not bundled with npm
fix Install Java 8+ and ensure java is on PATH
breaking CDS configuration must be exactly as documented; schema names cannot be arbitrary
fix Use exactly 'public' for default, '_cdsdbm_clone' for clone, '_cdsdbm_ref' for reference
gotcha cds-dbm only supports PostgreSQL via cds-pg; other databases not supported
fix Ensure cds-pg (or compatible adapter) is installed and configured
gotcha Liquibase is used internally; complex migrations may fail on unsupported DB features
fix Test migrations on a development copy first; check Liquibase compatibility
npm install vs-cds-dbm
yarn add vs-cds-dbm
pnpm add vs-cds-dbm

Installs cds-dbm, adds required migration config to package.json, runs deploy command.

npm install cds-dbm
# In package.json, add:
"cds": {
  "migrations": {
    "db": {
      "schema": {
        "default": "public",
        "clone": "_cdsdbm_clone",
        "reference": "_cdsdbm_ref"
      },
      "deploy": {
        "tmpFile": "tmp/_autodeploy.json",
        "undeployFile": "db/undeploy.json"
      }
    }
  }
}
# Ensure JRE >= 8 is installed
npx cds-dbm deploy