![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@sap/cds (SAP Cloud Application Programming Model) is a framework for building enterprise-grade services and applications. It provides a comprehensive set of tools and libraries to develop, deploy, and manage data-centric applications. The package supports defining data models, services, and business logic, and it integrates seamlessly with SAP HANA and other databases.
Defining Data Models
This feature allows you to define data models using CDS (Core Data Services) and interact with them. The code sample demonstrates defining a simple data model for a bookshop and implementing a service to read book data.
const cds = require('@sap/cds');
const { entities } = cds.model;
const Books = entities('my.bookshop.Books');
module.exports = cds.service.impl(async function() {
this.on('READ', Books, async (req) => {
return [{ ID: 1, title: '1984', author: 'George Orwell' }];
});
});
Service Implementation
This feature allows you to implement services that handle CRUD operations. The code sample shows how to implement READ and CREATE operations for a 'Books' entity.
const cds = require('@sap/cds');
module.exports = cds.service.impl(async function() {
this.on('READ', 'Books', async (req) => {
return [{ ID: 1, title: '1984', author: 'George Orwell' }];
});
this.on('CREATE', 'Books', async (req) => {
const { ID, title, author } = req.data;
return { ID, title, author };
});
});
Deploying to SAP HANA
This feature allows you to deploy your CDS models and services to an SAP HANA database. The code sample demonstrates how to deploy a service to SAP HANA using the provided credentials.
const cds = require('@sap/cds');
cds.deploy('srv').to('hana', {
credentials: {
host: 'your-hana-host',
port: 'your-hana-port',
user: 'your-hana-user',
password: 'your-hana-password'
}
}).then(() => {
console.log('Deployment to SAP HANA successful');
}).catch((err) => {
console.error('Deployment failed', err);
});
LoopBack is a highly extensible Node.js framework for building APIs and connecting them with backend data sources. It provides a similar data modeling and service implementation experience as @sap/cds but is more general-purpose and not specifically tailored for SAP environments.
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. It allows you to define models, perform CRUD operations, and manage database migrations. While it provides robust data modeling capabilities, it lacks the integrated service layer and SAP-specific features of @sap/cds.
TypeORM is an ORM for TypeScript and JavaScript (ES7, ES6, ES5). It supports multiple databases and provides a rich set of features for data modeling, migrations, and query building. TypeORM is more focused on database interactions and does not provide the comprehensive service layer found in @sap/cds.
The API package for the SAP Cloud Application Programming Model (CAP).
See the API documentation for more details.
In case you find a bug, please report an incident on SAP Support Portal.
This package is provided under the terms of the SAP Developer License Agreement.
FAQs
SAP Cloud Application Programming Model - CDS for Node.js
The npm package @sap/cds receives a total of 113,558 weekly downloads. As such, @sap/cds popularity was classified as popular.
We found that @sap/cds demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.