Skip to content

cds ​

Command: cds
Category: Developer Tools
Status: Production Ready

Description ​

Display a database object via CDS (Core Data Services). This command generates CDS entity definitions from database tables or views and can preview them using a CDS service. It retrieves the object schema, fields, and constraints to generate properly formatted CDS code.

Syntax ​

bash
hana-cli cds [schema] [table] [options]

Aliases ​

  • cdsPreview

Command Diagram ​

Parameters ​

Positional Arguments ​

ParameterTypeDescription
schemastringSchema containing the table or view (optional, defaults to **CURRENT_SCHEMA**)
tablestringDatabase table or view name (optional if using --table)

Options ​

OptionAliasTypeDefaultDescription
--table-tstring-Database table name
--schema-sstring**CURRENT_SCHEMA**Schema containing the table or view
--view-vbooleanfalseCDS processing for View instead of Table
--useHanaTypes--hanabooleanfalseUse SAP HANA-Specific Data Types (see predefined types)
--useQuoted-q, --quotedbooleanfalseUse Quoted Identifiers for non-standard identifiers
--port-pnumber-Port to run HTTP server for CDS preview
--profile--prstring-CDS Profile for connection

Connection Parameters ​

OptionAliasTypeDefaultDescription
--admin-abooleanfalseConnect via admin (default-env-admin.json)
--conn-string-Connection filename to override default-env.json

Troubleshooting ​

OptionAliasTypeDefaultDescription
--disableVerbose--quietbooleanfalseDisable verbose output - removes all extra output that is only helpful to human readable interface
--debug-dbooleanfalseDebug hana-cli itself by adding output of LOTS of intermediate details

Examples ​

Basic Usage ​

bash
hana-cli cds --table myTable --schema MYSCHEMA

Generates CDS entity definition for table myTable in schema MYSCHEMA and displays the CDS code.

Generate CDS for a View ​

bash
hana-cli cds --table myView --schema MYSCHEMA --view

Generates CDS entity definition for view myView.

Use HANA-Specific Types ​

bash
hana-cli cds --table myTable --useHanaTypes

Generates CDS code using HANA-specific data types instead of generic CDS types.

Preview with CDS Service ​

bash
hana-cli cds --table myTable --port 4004

Starts a CDS service on port 4004 to preview the generated entity.

See the Commands Reference for other commands in this category.

See Also ​