{"id":18906,"library":"vs-cds-dbm","title":"cds-dbm","description":"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).","status":"active","version":"0.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/mikezaschka/cds-dbm","tags":["javascript","sap","cap","cds","PostgreSQL","postgres"],"install":[{"cmd":"npm install vs-cds-dbm","lang":"bash","label":"npm"},{"cmd":"yarn add vs-cds-dbm","lang":"bash","label":"yarn"},{"cmd":"pnpm add vs-cds-dbm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for CAP models and service SDK","package":"@sap/cds","optional":false},{"reason":"Liquibase requires JRE >= 8; must be installed on system","package":"java-runtime","optional":true},{"reason":"PostgreSQL adapter for CDS (e.g., @cap-js/postgres or cds-pg)","package":"cds-pg","optional":true}],"imports":[{"note":"cds-dbm is a CLI tool; no JavaScript import. Use npx or add scripts in package.json.","wrong":"require('cds-dbm')","symbol":"cds-dbm","correct":"npx cds-dbm deploy"},{"note":"Programmatic API is experimental; path must include /commands.","wrong":"import cdsDbm from 'cds-dbm'","symbol":"cds-dbm/commands","correct":"import { deploy } from 'cds-dbm/commands'"},{"note":"Config must be in root package.json under cds.migrations.db. See README for required schema/clone/reference.","wrong":"Missing migrations config block","symbol":"cds-dbm (package.json config)","correct":"\"cds\": { \"migrations\": { \"db\": { ... } } }"}],"quickstart":{"code":"npm install cds-dbm\n# In package.json, add:\n\"cds\": {\n  \"migrations\": {\n    \"db\": {\n      \"schema\": {\n        \"default\": \"public\",\n        \"clone\": \"_cdsdbm_clone\",\n        \"reference\": \"_cdsdbm_ref\"\n      },\n      \"deploy\": {\n        \"tmpFile\": \"tmp/_autodeploy.json\",\n        \"undeployFile\": \"db/undeploy.json\"\n      }\n    }\n  }\n}\n# Ensure JRE >= 8 is installed\nnpx cds-dbm deploy","lang":"typescript","description":"Installs cds-dbm, adds required migration config to package.json, runs deploy command."},"warnings":[{"fix":"Install Java 8+ and ensure java is on PATH","message":"JRE >= 8 required on system; not bundled with npm","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use exactly 'public' for default, '_cdsdbm_clone' for clone, '_cdsdbm_ref' for reference","message":"CDS configuration must be exactly as documented; schema names cannot be arbitrary","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Ensure cds-pg (or compatible adapter) is installed and configured","message":"cds-dbm only supports PostgreSQL via cds-pg; other databases not supported","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test migrations on a development copy first; check Liquibase compatibility","message":"Liquibase is used internally; complex migrations may fail on unsupported DB features","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install cds-dbm' and use 'import { deploy } from 'cds-dbm/commands''","cause":"Incorrect import path or not installed","error":"Error: Cannot find module 'cds-dbm/commands'"},{"fix":"Install JRE >= 8 and ensure 'java' command works in terminal","cause":"Java not installed or not in PATH","error":"java.lang.RuntimeException: java.io.IOException: Cannot run program \"java\": error=2, No such file or directory"},{"fix":"Add the required migrations configuration as shown in the README","cause":"Missing or incorrect configuration block","error":"Error: cds-dbm requires a 'cds.migrations.db' configuration in package.json"},{"fix":"Set environment variables for DB connection (e.g., DATABASE_URL) and install database adapter","cause":"Missing database credentials or driver","error":"LiquibaseException: liquibase.exception.DatabaseException: Connection could not be created"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}