Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jul 14, 2023. It is now read-only.
/cds-pgPublic archive

PostgreSQL adapter for SAP CDS (CAP)

License

NotificationsYou must be signed in to change notification settings

sapmentors/cds-pg

Repository files navigation

⚠️
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 outa 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 seeCONTRIBUTING.md for how to contribute additional capabilities!

Also checkout the following blog posts on how to get started usingcds-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 thecds 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 filedefault-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 aquick and dirty command to deploy the current data model to the PostgreSQL database specified indefault-env.json. Initial data will also be filled from the provided.csv files following the approach described inProviding Initial Data. Be aware that the existing tables and views are deleted and then re-created according the CDS model, so this shouldnot be used in production environments

npx cds-pg deploy srv --to db

For a more sophisticated approach, please check outcds-dbm athttps://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 howcds-dbm can be used in combintation withcds-pg:


[8]ページ先頭

©2009-2025 Movatter.jp