CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

cds-pg

A PostgreSQL adapter for SAP CDS, built by the SAP Mentors community, which gave CAP a Postgres persistence option years before @cap-js/postgres shipped.

Gave CAP a Postgres persistence option years before an official one existed, and carried most community Postgres deployments until @cap-js/postgres shipped.

Facts

Latestv0.1.36ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Database connectorsCAPDatabase connectorscapabilityConnecting an application’s data model and queries to a database, including the differences in supported queries, types and schema management between database implementations. Changing an existing schema belongs to [schema evolution](capability:schema-evolution).
Flavors
Node.jsfrom its runtime
Requires
PostgreSQLPostgreSQLoutside the atlasNamed as a dependency in its documentation.

Who is behind it

Gregor WolfGregor WolfPersonMaintains this
In the atlas: maintains 17, contributes to 59, wrote 2
@gregorwolf
SAP Mentors & FriendsSAP Mentors & FriendsOrganisationMaintains this
In the atlas: maintains 3
@sapmentors
Volker BuzekVolker BuzekPersonMaintains this
In the atlas: maintains 7, contributes to 53, wrote 2
@vobu
maintainersMd. Ashraful AlamPersonContributes to this
In the atlas: contributes to 1
@ajewelbd
Austin KloskePersonContributes to this
In the atlas: contributes to 1
@austinkloske22
David SooterPersonContributes to this
In the atlas: contributes to 9
@d-sooter
Iwona HahnPersonContributes to this
In the atlas: contributes to 7
@iwonahahn
cyrilPersonContributes to this
In the atlas: contributes to 1
@kroben
Lars HvamPersonContributes to this
In the atlas: maintains 13, contributes to 92, wrote 1
@larshp
Mike ZaschkaPersonContributes to this
In the atlas: maintains 6, contributes to 9, wrote 12
@mikezaschka
rajbhuva1PersonContributes to this
In the atlas: contributes to 3
@rajbhuva1
Rajdeep BhuvaPersonContributes to this
In the atlas: contributes to 1
@rbhuva
Rafael Augusto Leite YegrosPersonContributes to this
In the atlas: contributes to 1
@ryegros
13 contributors

Before choosing this

Signals

RepositoryArchivedThe declared repository is archived

GitHub reports the repository as archived. The package may remain installable, but its source is no longer open for normal maintenance.

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →

Also, from Database connectors§ 1: The connector itself does not decide the licence boundary. Section 1 makes the destination and purpose of extraction relevant, including the scoped exception for interoperability with an SAP product.

What it declares

Every artifact

Type
CDS plugin
Origin
Independently maintained
Runtime
Node.js

As a CDS plugin

Distributed through
npm

Connections4

Install

npm add cds-pg

Derived from the package name. No recipe recorded; the README has the configuration.

Learn more4

Readings
  1. Run and Deploy SAP CAP (Java) with PostgreSQL using Official Database Adapter @cap-js/postgresshanthakumar_krishnaswamy, SAP Community
  2. Run and Deploy CAP with PostgreSQL on SAP BTP Cloud Foundry (Node.js)Mike Zaschka, SAP Community
  3. Getting started with CAP on PostgreSQL (Node.js)Mike Zaschka, SAP Community
1 more
  1. PostgreSQL persistence adapter for CAP (Node.js)Volker Buzek, SAP Community

Where it sits in your app

Download
Your CAP applicationdocumentedrequiresPostgreSQL, systemPostgreSQLsystemcds-pg, modulecds-pg
SAPnot SAP's, or the project's owndocumented only

README

quoted from sapmentors/cds-pg under MIT, read
sapmentors/cds-pg/README.mdOn GitHub

⚠️
this package is in 🌇-mode in favor of the official CAP PostgreSQL adapter
thanks to all the contributors for sailing along ⛵️ - hope to see you on board at @cap-js/postgres!
⚠️

cds-pg - PostgreSQL adapter for SAP CDS (CAP)

First a big thank you to our contributors:

Contributors Display

This node module provides an adapter to the PostgreSQL database

For a short introduction on the background of this project you can check out a short video that has been captured as part of the SAP devtoberfest.

Current status

Please use @cap-js/postgres!

**cds-pg is ready to be used! Still, there's some gaps left to fill - note the list below and please see CONTRIBUTING.md for how to contribute additional capabilities!

Also checkout the following blog posts on how to get started using cds-pg in your local development environment and on SAP Business Technology Platform (BTP), Cloud Foundry:

Usage in your CAP project

Please use @cap-js/postgres!

Add this package to your SAP Cloud Application Programming Model project by running:

npm install cds-pg

Then add this configuration to the cds section of your `package.json:

  "cds": {
    "requires": {
      "db": {
        "kind": "postgres"
      },
      "postgres": {
        "dialect": "plain", // <- for cds >= 5.1
        "impl": "cds-pg",
        "model": [
          "srv"
        ]
      }
    }
  }

For local development you can provide the credentials in the file default-env.json in the root folder of your project:

{
  "VCAP_SERVICES": {
    "postgres": [
      {
        "name": "postgres",
        "label": "postgres",
        "tags": ["plain", "database"],
        "credentials": {
          "host": "localhost",
          "port": "5432",
          "database": "dbname",
          "user": "postgres",
          "password": "postgres",
          "schema":"public"
        }
      }
    ]
  }
}
CDS deployment

cds-pg contains the database adapter to translate the incoming requests to PostgreSQL during runtime, but also includes a quick and dirty command to deploy the current data model to the PostgreSQL database specified in default-env.json. Initial data will also be filled from the provided .csv files following the approach described in Providing Initial Data. Be aware that the existing tables and views are deleted and then re-created according the CDS model, so this should not be used in production environments

npx cds-pg deploy srv --to db

For a more sophisticated approach, please check out cds-dbm at https://github.com/mikezaschka/c~s-dbm, which offers an advanced deployment model including delta handling of data and models! Please also read the following blogposts for a detailed description, on how cds-dbm can be used in combintation with cds-pg:

MIT, read

History

Latest

v0.1.36

  1. v0.1.35

    Features 1

    Notes
    Features
  2. v0.1.34

  3. v0.1.33

  4. v0.1.32

  5. v0.1.31

    Features 1

    Notes
    Features
    • align debug behaviour with cap standard (#359) (ffe84a3)
  6. v0.1.30

    Fixes 1

    Notes
    Bug Fixes
  7. v0.1.29

    Fixes 1

    Notes
    Bug Fixes
  8. v0.1.28

    Features 1

    Notes
    Features
  9. v0.1.27

  10. v0.1.26

    Fixes 1

    Notes
    Bug Fixes
    • support deep update for one to many composition (#281) (5e9e124)
  11. v0.1.25

  12. v0.1.24

    Fixes 1

    Notes
    Bug Fixes
    • return timestamps, not now() for createdat and modifiedat columns (#278) (8a2c05b)
  13. v0.1.23

  14. v0.1.22

    Fixes 1

    Notes
    Bug Fixes
    • return null when SELECT.one returns empty result instead of empty array (#266) (99dc308)
  15. v0.1.21

  16. v0.1.20

  17. v0.1.19

  18. v0.1.18

  19. v0.1.17

  20. v0.1.16

    Fixes 1

    Notes
    Bug Fixes
  21. v0.1.15

  22. v0.1.14

    Features 1

    Notes
    Features
  23. v0.1.13

  24. v0.1.12

  25. v0.1.11

  26. v0.1.10

  27. v0.1.8

    Features 1

    Notes
    Features
  28. v0.1.7

    Features 1

    Notes
    Features
    • re-using as release commit for cds 5.3 support (#180) (a79c37e)
  29. v0.1.6

  30. v0.1.5

    Fixes 1

    Notes
    Bug Fixes
  31. v0.1.4

  32. v0.1.3

  33. v0.1.2

    Features 1

    Notes
    Features
  34. v0.1.1

  35. v0.1.0

    Breaking 2

    Notes
    ⚠ BREAKING CHANGES
    • no more node <12 support!

    • require node 12+ for cds5 (#141) (14077be)

  36. v0.0.51

  37. v0.0.50

  38. v0.0.49

  39. v0.0.48

  40. v0.0.47

  41. v0.0.46

  42. v0.0.45

  43. v0.0.44

    Fixes 1

    Notes
    Bug Fixes
  44. v0.0.43

  45. v0.0.42

  46. v0.0.41

    Fixes 1

    Notes
    Bug Fixes
    • core: Remove Composition from Select (#86) (329e44a)
  47. v0.0.40

  48. v0.0.39

  49. v0.0.38

    Features 1

    Notes
    Features
  50. v0.0.37

  51. v0.0.36

  52. v0.0.35

  53. v0.0.34

  54. v0.0.33

  55. v0.0.32

  56. v0.0.31

  57. v0.0.30

  58. v0.0.29

    Features 1

    Notes
    Features
  59. v0.0.28

  60. v0.0.27

  61. v0.0.26

  62. v0.0.25

  63. v0.0.24

    Features 1

    Notes
    Features
  64. v0.0.23

    Features 1

    Notes
    Features
    • support SAP CP CF PG Hyperscaler Service (#43) (c0ba1dd)
  65. v0.0.22

  66. v0.0.21

  67. v0.0.20

  68. v0.0.19

  69. v0.0.18

  70. v0.0.17

  71. v0.0.16

  72. v0.0.15

  73. v0.0.14

  74. v0.0.13

  75. v0.0.12

  76. v0.0.11

  77. v0.0.5

    Features 5, Fixes 3

    Notes
    Features
    • transform cds sql to pg sql (#9) (1b751c3)
    • entity: get a single record/entity (459475d)
    • sqlite: run cap proj in-mem for comparison (c3bc4fe)
    • test: flow (3d1853f)
    • support limit and offset (#5) (b5cb922)
    Bug Fixes
    • mapcf username to pg user (#10) (d00a6d8)
    • hana: env var pointing to dbcapi (b6b4921)
    • pool: release client back to pool correctly (8027952)
154downloads per week, npm
Weekly downloads for cds-pg26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 154.27 Apr – 3 May: 1,2154 May – 10 May: 94811 May – 17 May: 1,10718 May – 24 May: 1,99625 May – 31 May: 1,3801 Jun – 7 Jun: 1,0458 Jun – 14 Jun: 1,14915 Jun – 21 Jun: 1,33522 Jun – 28 Jun: 1,33029 Jun – 5 Jul: 1,1806 Jul – 12 Jul: 1,44913 Jul – 19 Jul: 1,31220 Jul – 26 Jul: 1,19327 Jul – 2 Aug: 1,0993 Aug – 9 Aug: 1,31410 Aug – 16 Aug: 95017 Aug – 23 Aug: 95924 Aug – 30 Aug: 79631 Aug – 6 Sept: 7187 Sept – 13 Sept: 62014 Sept – 20 Sept: 60821 Sept – 27 Sept: 74328 Sept – 4 Oct: 8405 Oct – 11 Oct: 76112 Oct – 18 Oct: 43319 Oct – 25 Oct: 154
Declared alternative
  1. @cap-js/postgresPostgreSQL database service for CAP
Database connectors
  1. SAP HANA CloudManaged SAP HANA database service on BTP
  2. PostgreSQL on SAP BTP, hyperscaler optionManaged PostgreSQL from the hyperscaler via a BTP service binding
  3. com.sap.cds:cds-feature-hanaSAP HANA Cloud datasource for CAP Java applications
  4. com.sap.cds:cds-feature-jdbcJDBC runtime for H2 and SQLite in CAP Java
  5. com.sap.cds:cds-feature-postgresqlPostgreSQL datasource for CAP Java applications
  6. com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
  7. @cap-js/db-serviceBase service shared by CAP's SQLite, PostgreSQL and HANA services
  8. @cap-js/hanaSAP HANA database service for CAP
  9. @cap-js/postgresPostgreSQL database service for CAP
  10. @cap-js/sqliteSQLite database service for CAP, in memory during development
  11. cap-postgres-btp-connectivityTunnels CAP Node.js to a private PostgreSQL via Cloud Connector
  12. cds-mongodbMongoDB as a CAP database service through Mongoose
  13. @cds-pgroll/postgresCLI for DROP and RENAME schema changes beside @cap-js/postgres
  14. @neoimpulse/cap-js-restore-model-defined-typesCAP plugin casting read values back to CDS model types
  15. @quadrio/cds-db2DB2 adapter for CDS
  16. @sap/cds-hanaDatabase adapter for SAP HANA in CAP
  17. @sap/cdsCAP Node.js runtime
  18. @sap/hana-clientSAP's Node.js driver for SAP HANA
  19. SAP HANASAP's relational database platform, on-premise and in HANA Cloud
  20. cap-snowflakeCAP database adapter for Snowflake with OData V4 support
  21. cds-mysqlMySQL and MariaDB database adapter for CAP

Details

Sources6
npm registrydiscovered herechecked
GitHub APIdiscovered here, sapmentorschecked
SAP Communitydiscovered herechecked
npm registry, cds-pgversion, releases, installschecked
github.com/git+https://github.com/sapmentors/cds-pg.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
latestv0.1.36
first release
releases and cadence84, ~32d median
discovered vianpm registry, GitHub API · sapmentors, SAP Community
first seen in the atlas
ecosystem and domaincap, data-and-persistence
Contributors13
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:sapmentors-cds-pg
JSON
/artifacts/sapmentors-cds-pg.json
MCP
Connecting an agent