All Projects → sapmentors → cds-pg

sapmentors / cds-pg

Licence: MIT license
PostgreSQL adapter for SAP CDS (CAP)

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to cds-pg

light-odata
OData(V2/V4) Client for javascript/typescript
Stars: ✭ 25 (-70.24%)
Mutual labels:  sap, cap
cloud-native-workshop
1 day workshop to learn Spring Boot + Spring Cloud + Pivotal Cloud Foundry
Stars: ✭ 37 (-55.95%)
Mutual labels:  cloud-foundry
stackdriver-tools
Stackdriver Nozzle for Cloud Foundry Loggregator, Host Monitoring Agents BOSH Release
Stars: ✭ 22 (-73.81%)
Mutual labels:  cloud-foundry
bosh-softlayer-cpi-release
An external BOSH CPI for the SoftLayer cloud written in Golang
Stars: ✭ 14 (-83.33%)
Mutual labels:  cloud-foundry
MCW-Template-Cloud-Workshop
Official Microsoft Cloud Workshop Template
Stars: ✭ 36 (-57.14%)
Mutual labels:  sap
cf exporter
Cloud Foundry Prometheus Exporter
Stars: ✭ 21 (-75%)
Mutual labels:  cloud-foundry
paas-aiven-broker
A service broker to provide Aiven Elasticsearch and InfluxDB services to Cloud Foundry users
Stars: ✭ 15 (-82.14%)
Mutual labels:  cloud-foundry
openui5-validator
A library to validate OpenUI5 fields
Stars: ✭ 17 (-79.76%)
Mutual labels:  sap
xtt
ABAP template engine for Excel, Word, Html & Pdf
Stars: ✭ 21 (-75%)
Mutual labels:  sap
Clownfish
Smart Content Management System using Spring Boot
Stars: ✭ 14 (-83.33%)
Mutual labels:  sap
swift-buildpack
IBM Cloud buildpack for Swift
Stars: ✭ 33 (-60.71%)
Mutual labels:  cloud-foundry
paas-docker-cloudfoundry-tools
No description or website provided.
Stars: ✭ 30 (-64.29%)
Mutual labels:  cloud-foundry
cloud-cf-helloworld-nodejs
A "Hello World" application for Cloud Foundry using a simple RESTful API in Node.js with persistency in PostgreSQL and SAPUI5 UIs.
Stars: ✭ 45 (-46.43%)
Mutual labels:  cloud-foundry
cloud-cf-espm
A reference application showcasing an end-to-end development scenario in Java on SAP BTP, Cloud Foundry environment.
Stars: ✭ 14 (-83.33%)
Mutual labels:  cloud-foundry
bw toolbox
📊 🔨 📦 Collection of all tools for SAP BW useful for daily work
Stars: ✭ 24 (-71.43%)
Mutual labels:  sap
overview-broker
A service broker that provides an overview of its service instances and bindings. Conforms to the Open Service Broker API standard.
Stars: ✭ 18 (-78.57%)
Mutual labels:  cloud-foundry
nwabap-ui5uploader
This module allows a developer to upload SAPUI5/OpenUI5 sources into a SAP NetWeaver ABAP system.
Stars: ✭ 15 (-82.14%)
Mutual labels:  sap
fundamental-tools
Web applications with ABAP, done simple.
Stars: ✭ 42 (-50%)
Mutual labels:  sap
cf-butler
My purpose in life is to cleanup stale apps and services on a Cloud Foundry foundation. I can be configured to report on and remove orphaned services and stopped app instances older than a configurable duration. I do many other useful things too.
Stars: ✭ 31 (-63.1%)
Mutual labels:  cloud-foundry
cf-tools
Useful shell scripts for Cloud Foundry API v2
Stars: ✭ 22 (-73.81%)
Mutual labels:  cloud-foundry

npm version Package Build

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

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:

TODO

  • implement basic SELECT|READ(~ OData GET)
  • implement basic INSERT|CREATE(~ OData POST)
  • implement basic UPDATE(~ OData PUT|PATCH)
  • implement basic DELETE(~ OData DELETE)
  • map OData to PostgreSQL vocabulary
  • implement basic cds deployment
  • use default query builders for UPDATE/DELETE
  • add support for multitenancy (see issue #25)
    • support multiple schemas (at config time)
    • support queries with tenant info (at runtime)
  • add support for full OData vocabulary
    • system query options ($filter, $expand, $select)
    • string functions
    • collection functions
    • date + time functions
    • geo functions
    • arithmetic operators + functions
  • add draft support (see issue #30)
  • add advanced deployment model that supports delta handling/migrations (see issue #27)
  • support virtual fields (see issue 204)
  • support localized entities (see issue 196)

Usage in your CAP project

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/cds-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:

Projects using cds-pg

  • pg-beershop – An example project with multiple deployment scenarios (Cloud Foundry, Kyma, Azure, Google Cloud Platform)
  • cap-devtoberfest – A simple project showcasing how to run cds-pg and cds-dbm locally and on SAP BTB Cloud Foundry
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].