Git Product home page Git Product logo

sap-samples / hana-developer-cli-tool-example Goto Github PK

View Code? Open in Web Editor NEW
90.0 16.0 24.0 146.95 MB

Learn how to build a developer-centric SAP HANA command line tool, particularly designed to be used when performing SAP HANA development in non-SAP tooling (for example from VS Code).

License: Apache License 2.0

JavaScript 33.54% HTML 1.28% CSS 65.06% Dockerfile 0.09% Shell 0.03%
sample sample-code sap-hana command-line-tool vscode sap-hana-cloud-hana-database sap-hana-cloud owner-jung-thomas

hana-developer-cli-tool-example's Introduction

SAP HANA Developer Command Line Interface

REUSE status

The change log describes notable changes in this package.

Description

This sample is intended to shown how one could build a developer-centric SAP HANA command line tool, particularly designed to be used when performing local SAP HANA development in non-SAP tooling (like VSCode). It utilizes the default-env.json that is often used in local development for connectivity to a remote SAP HANA DB (although it can of course be used with a local SAP HANA, express edition instance as well). There is no intention to replacing the hdbsql tool as a generic SQL console. Instead this sample will focus on simplifying and grouping common and complex commands that otherwise might a lot of separate scripts.

Introduction Video: https://youtu.be/dvVQfi9Qgog

However the tool isn't limited to only local development. It also works well when developing in the cloud. The hana-cli tool can also run well from a cloud shell in the SAP Business Application Studio, Google Cloud Shell, AWS Cloud9, etc. We can also run against a SAP HANA service for SAP BTP or SAP HANA Cloud instance. This demonstrates that the tool can run just about anywhere you can get a command line that has access to the Node.js Runtime. We can also connect to a remote HANA instance even if it isn't running in the same cloud environment in which we are performing our development tasks.

Running in Cloud Shells Video: https://youtu.be/L7QyVLvAIIQ

Requirements / Download and Installation

If you would rather just access the tool directly, it is now available in npm as well. You can install via:

npm install -g hana-cli

Otherwise you can also run it from the sources as described here:

npm config delete @sap:registry
git clone https://github.com/SAP-samples/hana-developer-cli-tool-example
  • Run NPM install from the root of the hana-developer-cli-tool-example project you just cloned to download dependencies
npm install
npm link

asciicast

Security

This application primarily uses the default-env.json that is often used in local development for connectivity to a remote HANA DB (although it can of course be used with a local SAP HANA, express edition instance as well). For more details on how the default-env.json works, see the readme.md of the @sap/xsenv package or the @sap/hdi-deploy package.

The tool doesn't simply look for a default-env.json file in the current directory however. There are numerous options and places it will look for the connection parameters. Here is the order in which it checks:

  • First we look for the Admin option and use a default-env-admin.json - this overrides all other parameters
  • If no admin option or if there was an admin option but no default-env-admin.json could be found in this directory or 5 parent directories, then look for .cdsrc-private.json in this directory or 5 parent directories and use cds bind functionality to lookup the credentials securely. This is the most secure option, but please note: this will make each command take a few seconds longer as credentials are no longer stored locally but looked up from cf or k8s dynamically with each command
  • If no .cdsrc-private.json found in this directory or 5 parent directories, then look for a .env file in this directory or up to 5 parent directories
  • No .env file found or it doesn't contain a VCAP_SERVICES section, then check to see if the --conn parameter was specified. If so check for that file in the current directory or up to 5 parent directories
  • If the file specified via the --conn parameter wasn't found locally then check for it in the ${homedir}/.hana-cli/ folder
  • If no specific configuration file was was found then look for a file named default-env.json in the current directory or up to 5 parent directories
  • Last resort if nothing has been found up to this point - look for a file named default.json in the ${homedir}/.hana-cli/ folder

Examples

A lot of the functionality of this tool revolves around typical tasks you face while doing HANA database development. For example you might want to get a list of all views in your current schema/container:

C:\github\hana-xsa-opensap-hana7\user_db>hana-cli views
Schema: OPENSAP_HANA_USER, View: *
SCHEMA_NAME        VIEW_NAME                                    VIEW_OID  COMMENTS
-----------------  -------------------------------------------  --------  ------------
OPENSAP_HANA_USER  user.models::USER_DETAILS                    171133    USER_DETAILS
OPENSAP_HANA_USER  user.models::USER_DETAILS/hier/USER_DETAILS  171139    null

Then perhaps you want to inspect a view to see the columns and their data types:

C:\github\hana-xsa-opensap-hana7\user_db>hana-cli view * user.models::USER_DETAILS
Schema: %, View: user.models::USER_DETAILS
{ SCHEMA_NAME: 'OPENSAP_HANA_USER',
  VIEW_NAME: 'user.models::USER_DETAILS',
  VIEW_OID: 171133,
  COMMENTS: 'USER_DETAILS',
  IS_COLUMN_VIEW: 'TRUE',
  VIEW_TYPE: 'CALC',
  HAS_STRUCTURED_PRIVILEGE_CHECK: 'TRUE',
  HAS_PARAMETERS: 'TRUE',
  HAS_CACHE: 'NONE',
  CREATE_TIME: '2019-07-30 13:14:15.594000000' }


SCHEMA_NAME        VIEW_NAME                  VIEW_OID  COLUMN_NAME  POSITION  DATA_TYPE_NAME  OFFSET  LENGTH  SCALE  IS_NULLABLE  DEFAULT_VALUE  CS_DATA_TYPE_NAME  COLUMN_ID  COMMENTS
-----------------  -------------------------  --------  -----------  --------  --------------  ------  ------  -----  -----------  -------------  -----------------  ---------  ---------
OPENSAP_HANA_USER  user.models::USER_DETAILS  171133    EMAIL        1         NVARCHAR        0       255     null   TRUE         null           STRING             171135     Email
OPENSAP_HANA_USER  user.models::USER_DETAILS  171133    FIRSTNAME    2         NVARCHAR        0       40      null   TRUE         null           STRING             171136     FirstName
OPENSAP_HANA_USER  user.models::USER_DETAILS  171133    LASTNAME     3         NVARCHAR        0       40      null   TRUE         null           STRING             171137     LastName
OPENSAP_HANA_USER  user.models::USER_DETAILS  171133    USERID       4         INTEGER         0       10      0      TRUE         null           INT                171138     UserId

But there are multiple output options for inspection. Perhaps you are using Cloud Application Programming Model and need to create a proxy entity in CDS for a view. This tool will read the catalog metadata and convert it to CDS:

C:\github\hana-xsa-opensap-hana7\user_db>hana-cli view OPENSAP_HANA_USER user.models::USER_DETAILS -o cds
Schema: OPENSAP_HANA_USER, View: user.models::USER_DETAILS
@cds.persistence.exists
Entity user_modelsUSER_DETAILS {
 key    "EMAIL": String(255) null  @title: 'EMAIL: Email' ;
key     "FIRSTNAME": String(40) null  @title: 'FIRSTNAME: FirstName' ;
key     "LASTNAME": String(40) null  @title: 'LASTNAME: LastName' ;
key     "USERID": Integer null  @title: 'USERID: UserId' ;
}

Or maybe you are service enabling this view and you want to see it converted to EDMX:

C:\github\hana-xsa-opensap-hana7\user_db>hana-cli view OPENSAP_HANA_USER user.models::USER_DETAILS -o edmx
Schema: OPENSAP_HANA_USER, View: user.models::USER_DETAILS
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
  <edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470974/Common.xml?api=v2" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
    <edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
  </edmx:Reference>
  <edmx:DataServices m:DataServiceVersion="2.0">
    <Schema Namespace="HanaCli" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
      <EntityContainer Name="EntityContainer" m:IsDefaultEntityContainer="true">
        <EntitySet Name="user_modelsUSER_DETAILS" EntityType="HanaCli.user_modelsUSER_DETAILS"/>
      </EntityContainer>
      <EntityType Name="user_modelsUSER_DETAILS">
        <Key>
          <PropertyRef Name="EMAIL"/>
          <PropertyRef Name="FIRSTNAME"/>
          <PropertyRef Name="LASTNAME"/>
          <PropertyRef Name="USERID"/>
        </Key>
        <Property Name="EMAIL" Type="Edm.String" MaxLength="255"/>
        <Property Name="FIRSTNAME" Type="Edm.String" MaxLength="40"/>
        <Property Name="LASTNAME" Type="Edm.String" MaxLength="40"/>
        <Property Name="USERID" Type="Edm.Int32"/>
      </EntityType>
      <Annotations Target="HanaCli.user_modelsUSER_DETAILS/EMAIL" xmlns="http://docs.oasis-open.org/odata/ns/edm">
        <Annotation Term="Common.Label" String="EMAIL: Email"/>
      </Annotations>
      <Annotations Target="HanaCli.user_modelsUSER_DETAILS/FIRSTNAME" xmlns="http://docs.oasis-open.org/odata/ns/edm">
        <Annotation Term="Common.Label" String="FIRSTNAME: FirstName"/>
      </Annotations>
      <Annotations Target="HanaCli.user_modelsUSER_DETAILS/LASTNAME" xmlns="http://docs.oasis-open.org/odata/ns/edm">
        <Annotation Term="Common.Label" String="LASTNAME: LastName"/>
      </Annotations>
      <Annotations Target="HanaCli.user_modelsUSER_DETAILS/USERID" xmlns="http://docs.oasis-open.org/odata/ns/edm">
        <Annotation Term="Common.Label" String="USERID: UserId"/>
      </Annotations>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>

This tool will even create a temporary OData V4 service for any existing table, view or Calculation View and launch a test Fiori Ui locally. Fioir Example

Commands

activateHDI

hana-cli activateHDI [tenant]
[aliases: ahdi, ah]
Activate the HDI service in a particluar SAP HANA Tenant (Must be ran in the
SYSTEMDB)

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --tenant, --Tenant  SAP HANA Tenant                               [string]

adminHDI

hana-cli adminHDI [user] [password]
[aliases: adHDI, adhdi]
Create an Admin User for HDI or assign HDI admin privileges to an existing user

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User          User
  -p, --password, --Password  Password
  -c, --create, --Create      Set this parameter to false to reuse an existing
                              database user and assign the HDI admin privileges
                              to this user. In this case a dummy password can
                              be given.
                                                      [boolean] [default: false]

adminHDIGroup

hana-cli adminHDIGroup [user] [group]
[aliases: adHDIG, adhdig]
Add a User as an HDI Group Admin

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User    User
  -g, --group, --Group  HDI Group       [string] [default: "SYS_XS_HANA_BROKER"]

btp

hana-cli btp [directory] [subaccount]

Set the target for commands for the btp CLI to the global account, a directory,
or a subaccount. Commands are executed in the specified target, unless you override it using a parameter. If the specified target is part of an account hierarchy, its parents are also targeted, so that if a command is only available on a higher level, it will be executed there.

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output t
                             hat is only helpful to human readable interface. Us
                             eful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of i
                             ntermediate details      [boolean] [default: false]

Options:
  --subaccount, --sa  The ID of the subaccount to be targeted           [string]

bas example

btpInfo

Detailed Information about btp CLI target

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra outp
                                 ut that is only helpful to human readable inter
                                 face. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -o, --output, --Output  Output Format for inspection
                              [string] [choices: "tbl", "json"] [default: "tbl"]

callProcedure

hana-cli callProcedure [schema] [procedure]
[aliases: cp, callprocedure, callProc, callproc, callSP, callsp]
Call a stored procedure and display the results

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -p, --procedure, --Procedure, --sp  Stored Procedure                  [string]
  -s, --schema, --Schema              schema
                                        [string] [default: "**CURRENT_SCHEMA**"]

callProcedure example

certificates

hana-cli certificates
[aliases: cert, certs]
List System Certificates

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

certificates example

cds

hana-cli cds [schema] [table]
[aliases: cdsPreview]
Display a DB object via CDS

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table        Database Table                            [string]
  -s, --schema, --Schema      schema    [string] [default: "**CURRENT_SCHEMA**"]
  -v, --view, --View          CDS processing for View instead of Table
                                                      [boolean] [default: false]
      --useHanaTypes, --hana  Use SAP HANA-Specific Data Types See (https://cap.
                              cloud.sap/docs/cds/cdl#predefined-types)
                                                      [boolean] [default: false]
  -q, --useQuoted, --quoted, --quotedIdent  Use Quoted Identifiers ![non-identif
  ifiers                                    ier]      [boolean] [default: false]                                                      
  -p, --port                  Port to run HTTP server for CDS preview
                                                                [default: false]

changelog

hana-cli changelog
[aliases: chg]
Open Change Log in browser

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]

changes

hana-cli changes
[aliases: chg]
Display Change Log in CLI

changesUI

hana-cli changesUI
[aliases: chgUI, chgui, changeLogUI, changelogui]
Display Change Log in Browser UI

completion

hana-cli completion
generate completion script for bash shell

connect

hana-cli connect [user] [password]
[aliases: c, login]
Connects to an SAP HANA DB and writes connection information to a
default-env-admin.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -n, --connection                          Connection String  <host>[:<port>]
  -u, --user, --User                        User
  -p, --password, --Password                Password
  -U, --userstorekey, --UserStoreKey        Optional: HDB User Store Key -
                                            Overrides all other Connection
                                            Parameters
  -s, --save, --Save                        Save Credentials to
                                            default-env-admin.json
                                                       [boolean] [default: true]
  -e, --encrypt, --Encrypt, --ssl           Encrypt connections (required for
                                            SAP HANA service for SAP BTP or SAP
                                            HANA Cloud)                [boolean]
  -t, --trustStore, --Trust, --trust,       SSL Trust Store
  --truststore

connect example

containers

hana-cli containers [containerGroup] [container]
[aliases: cont, listContainers, listcontainers]
List all HDI Containers

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --container, --Container              Container Name
                                                         [string] [default: "*"]
  -g, --containerGroup, --Group, --group,   Container Group
  --containergroup                                       [string] [default: "*"]
  -l, --limit                               Limit results[number] [default: 200]

containersUI

hana-cli containersUI [containerGroup] [container]
[aliases: contui, listContainersUI, listcontainersui, containersui]
List all HDI Containers in browser UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --container, --Container              Container Name
                                                         [string] [default: "*"]
  -g, --containerGroup, --Group, --group,   Container Group
  --containergroup                                       [string] [default: "*"]
  -l, --limit                               Limit results[number] [default: 200]

copy2DefaultEnv

hana-cli copy2DefaultEnv
[aliases: copyDefaultEnv, copyDefault-Env, copy2defaultenv, copydefaultenv,
                                                                copydefault-env]
Copy .env contents to default-env.json and reformat

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]

copy2Env

hana-cli copy2Env
[aliases: copyEnv, copyenv, copy2env]
Copy default-env.json contents to .env and reformat

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

copy2Secrets

hana-cli copy2Secrets
[aliases: secrets, make:secrets]
make secrets for Kubernetes deployment
(https://www.npmjs.com/package/@sap/xsenv#usage-in-kubernetes)

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]

Options:
  --envJson, --from-file        JSON file containing VCAP_SERVICES variable
                                          [string] [default: "default-env.json"]
  --secretsFolder, --to-folder  Folder name for storing secrets
                                                   [string] [default: "secrets"]
  --filter                      List of service instances to process    [string]

createGroup

hana-cli createGroup [group]
[aliases: cg, cGrp]
Create an HDI container group

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -g, --group, --Group           Container Group Name                   [string]

createContainer

hana-cli createContainer [container] [group]
[aliases: cc, cCont]
Create an HDI Container and populate connection details into default-env.json

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --container, --Container     Container Name                       [string]
  -g, --group, --Group             Container Group Name [string] [default: empty]
  -s, --save, --Save               Save Credentials to default-env.json
                                                       [boolean] [default: true]
  -e, --encrypt, --Encrypt, --ssl  Encrypt connections (required for SAP HANA
                                   service for SAP BTP or SAP HANA Cloud)
                                                      [boolean] [default: false]

createContainer example

createContainerUsers

hana-cli createContainerUsers [container]
[aliases: ccu, cContU]
Create new HDI Container technical users for an existing container and populates
connection details into default-env.json

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --container, --Container     Container Name                       [string]
  -s, --save, --Save               Save Credentials to default-env.json
                                                       [boolean] [default: true]
  -e, --encrypt, --Encrypt, --ssl  Encrypt connections (required for SAP HANA
                                   service for SAP BTP or SAP HANA Cloud)
                                                      [boolean] [default: false]

createJWT

hana-cli createJWT [name]
[aliases: cJWT, cjwt, cJwt]
Create JWT Token and Import Certificate (To obtain the certificate and issuer
used in the SQL you need to use the xsuaa service key credentials.url element
which should look like this:
https://<subdomain>.authentication.<region>.hana.ondemand.com then add
/sap/trust/jwt path to it in a browser)

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --name, --Name                JWT Provider Name (Any descriptive Value)
                                                                        [string]
  -c, --certificate, --Certificate  certificate                         [string]
  -i, --issuer, --Issuer            Certificate Issuer                  [string]

createModule

hana-cli createModule
[aliases: createDB, createDBModule]
Create DB Module

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -f, --folder, --Folder                    DB Module Folder Name
                                                        [string] [default: "db"]
      --hanaCloud, --hc, --hana-cloud,      Build Module for SAP HANA Cloud?
      --hanacloud                                      [boolean] [default: true]

createXSAAdmin

hana-cli createXSAAdmin [user] [password]
[aliases: cXSAAdmin, cXSAA, cxsaadmin, cxsaa]
Create an SAP HANA DB User which is also an XSA Admin

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User          User
  -p, --password, --Password  Passwordd

createXSAAdmin example

dataTypes

hana-cli dataTypes
[aliases: dt, datatypes, dataType, datatype]
List of HANA Data Types and their technical details

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

dataTypes example

dataTypesUI

hana-cli dataTypesUI
[aliases: dtui, datatypesui, dataTypeUI, datatypeui]
List of HANA Data Types and their technical details in the browser UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

dataVolumes

hana-cli dataVolumes
[aliases: dv, datavolumes]
Details about the HANA Data Volumes

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

dataVolumes example

disks

hana-cli disks
[aliases: di, Disks]
Details about disk devices used by HANA

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

disks example

dropContainer

hana-cli dropContainer [container] [group]
[aliases: dc, dropC]
Drop HDI container and clean up HDI Container users

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --container, --Container  Container Name                          [string]
  -g, --group, --Group          Container Group Name   [string] [default: empty]

dropGroup

hana-cli dropGroup [group]
[aliases: dg, dropG]
Drop HDI container group

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -g, --group, --Group           Container Group Name                   [string]

features

hana-cli features
[aliases: fe, Features]
SAP HANA Features and Version

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

features example

featureUsage

hana-cli featureUsage
[aliases: fu, FeaturesUsage]
Usage Statistics by Feature

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

featureUsage example

functions

hana-cli functions [schema] [function]
[aliases: f, listFuncs, ListFunc, listfuncs, Listfunc, listFunctions,
                                                                  listfunctions]
Get a list of all functions

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -f, --function, --Function  Function                   [string] [default: "*"]
  -s, --schema, --Schema      schema    [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                 Limit results              [number] [default: 200]

functions example

hdi

hana-cli hdi
[aliases: hdiInstances, hdiinstances, hdiServices, listhdi, hdiservices, hdis]
List all SAP HANA Cloud HDI service instances in your target Space

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]
Options:
  -c, --cf, --cmd  Cloud Foundry?                      [boolean] [default: true]

hdi example

hc

hana-cli hc [name]
[aliases: hcInstances, instances, listHC, listhc, hcinstances]
List all SAP HANA Cloud instances in your target Space

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -n, --name  SAP HANA Cloud Instance name     [string] [default: "**default**"]

hc example

hc #2 example

hcStart

hana-cli hcStart [name]
[aliases: hcstart, hc_start, start]
Start SAP HANA Cloud instance

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -n, --name  SAP HANA Cloud Instance name     [string] [default: "**default**"]

hcStop

hana-cli hcStop [name]
[aliases: hcstop, hc_stop, stop]
Stop SAP HANA Cloud instance

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -n, --name  SAP HANA Cloud Instance name     [string] [default: "**default**"]

hdbsql

hana-cli hdbsql

Launch the hdbsql tool (if installed separately) using the locally persisted
credentials default-env*.json

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

hdbsql example

help

hana-cli help
List all Commands and their Aliases

hostInformation

hana-cli hostInformation
[aliases: hi, HostInformation, hostInfo, hostinfo]
Host technical details

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

hostInformation example

indexes

hana-cli indexes [schema] [indexes]
[aliases: ind, listIndexes, ListInd, listind, Listind, listfindexes]
Get a list of indexes

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -i, --indexes, --Indexes  Function                     [string] [default: "*"]
  -s, --schema, --Schema    schema      [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit               Limit results                [number] [default: 200]

indexes example

iniContents

hana-cli iniContents [file] [section]
[aliases: if, inifiles, ini]
Contents of INI Configuration (filtered by File Name)

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -f, --file, --File        File Name                    [string] [default: "*"]
  -s, --section, --Section  Section                      [string] [default: "*"]
  -l, --limit               Limit results                [number] [default: 200]

iniContents example

iniFiles

hana-cli iniFiles
[aliases: if, inifiles, ini]
List of INI Configuration Files for SAP HANA

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

iniFiles example

inspectFunction

hana-cli inspectFunction [schema] [function]
[aliases: if, function, insFunc, inspectfunction]
Return metadata about a Function

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -f, --function, --Function  Function                                  [string]
  -s, --schema, --Schema      schema    [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output      Output Format for inspection
                               [string] [choices: "tbl", "sql"] [default: "tbl"]

inspectFunction example

inspectIndex

hana-cli inspectIndex [schema] [index]
[aliases: ii, index, insIndex, inspectindex]
Return metadata about an Index

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -i, --index, --Index    DB Table Index                                [string]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]

inspectIndex example

inspectJWT

hana-cli inspectJWT
[aliases: jwt, ijwt, iJWT, iJwt]
Inspect JWT Token Configuration

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

inspectLibMember

hana-cli inspectLibMember [schema] [library] [libraryMem]
[aliases: ilm, libraryMember, librarymember, insLibMem, inspectlibrarymember]
Return metata about a Library Member

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --library, --lib, --Library           Library                     [string]
  -m, --libraryMem, --libMem,               Library Member
  --LibraryMember                                                       [string]
  -s, --schema, --Schema                    schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output                    Output Format for inspection
                               [string] [choices: "tbl", "sql"] [default: "tbl"]

inspectLibMember example

inspectLibrary

hana-cli inspectLibrary [schema] [library]
[aliases: il, library, insLib, inspectlibrary]
Return metadata about a Library

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --library, --lib, --Library  Library                              [string]
  -s, --schema, --Schema           schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output           Output Format for inspection
                               [string] [choices: "tbl", "sql"] [default: "tbl"]

inspectLibrary example

inspectProcedure

hana-cli inspectProcedure [schema] [procedure]
 [aliases: ip, procedure, insProc, inspectprocedure, inspectsp]
Return metadata about a Stored Procedure

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -p, --procedure, --Procedure, --sp  Stored Procedure                  [string]
  -s, --schema, --Schema              schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output              Output Format for inspection
                               [string] [choices: "tbl", "sql"] [default: "tbl"]

inspectProcedure example

inspectTable

hana-cli inspectTable [schema] [table]
[aliases: it, table, insTbl, inspecttable, inspectable]
Return metadata about a DB table

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table        Database Table                            [string]
  -s, --schema, --Schema      schema    [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output      Output Format for inspection
        [string] [choices: "tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl",
     "annos", "edm", "edmx", "swgr", "openapi", "hdbtable", "hdbmigrationtable",
                                             "hdbcds", "jsdoc"] [default: "tbl"]
      --useHanaTypes, --hana  Use SAP HANA-Specific Data Types See (https://cap.
                              cloud.sap/docs/cds/cdl#predefined-types)
                                                      [boolean] [default: false]
      --useExists, --exists, --persistence  Use Persistence Exists Annotation
                                                       [boolean] [default: true]
  -q, --useQuoted, --quoted, --quotedIdent  Use Quoted Identifiers ![non-identif
  ifiers                                    ier]      [boolean] [default: false]                                                      

inspectTable example

inspectTrigger

hana-cli inspectTrigger [schema] [trigger]
[aliases: itrig, trigger, insTrig, inspecttrigger, inspectrigger]
Return metadata about a Trigger

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --trigger, --Trigger  Sequence                     [string] [default: "*"]
  -s, --schema, --Schema    schema      [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output    Output Format for inspection
                               [string] [choices: "tbl", "sql"] [default: "tbl"]

inspectUser

hana-cli inspectUser [user]
[aliases: iu, user, insUser, inspectuser]
Return metadata about a User

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User  User                                              [string]

inspectUser example

inspectView

hana-cli inspectView [schema] [view]
[aliases: iv, view, insVew, inspectview]
Return metadata about a DB view

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -v, --view, --View          Database View                             [string]
  -s, --schema, --Schema      schema    [string] [default: "**CURRENT_SCHEMA**"]
  -o, --output, --Output      Output Format for inspection
        [string] [choices: "tbl", "sql", "sqlite", "cds", "json", "yaml", "cdl",
       "annos", "edm", "edmx", "swgr", "openapi", "hdbview", "hdbcds"] [default:
                                                                          "tbl"]
      --useHanaTypes, --hana  Use SAP HANA-Specific Data Types See (https://cap.
                              cloud.sap/docs/cds/cdl#predefined-types)
                                                      [boolean] [default: false]
      --useExists, --exists, --persistence  Use Persistence Exists Annotation
                                                       [boolean] [default: true]
  -q, --useQuoted, --quoted, --quotedIdent  Use Quoted Identifiers ![non-identif
  ifiers                                    ier]      [boolean] [default: false]                                                      

issue

Report an Issue with the hana-cli

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output t
                             hat is only helpful to human readable interface. Us
                             eful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of i
                             ntermediate details      [boolean] [default: false]

libraries

hana-cli libraries [schema] [library]
[aliases: l, listLibs, ListLibs, listlibs, ListLib, listLibraries,
                                                                  listlibraries]
Get a list of all libraries

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --library, --lib, --Library  Library               [string] [default: "*"]
  -s, --schema, --Schema           schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                      Limit results         [number] [default: 200]

libraries example

massConvert

hana-cli massConvert [schema] [table]

Convert a group of tables to CDS or HDBTable format

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table                     Database Table[string] [default: "*"]
  -s, --schema, --Schema                   schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                              Limit results [number] [default: 200]
  -f, --folder, --Folder                   DB Module Folder Name
                                                        [string] [default: "./"]
  -n, --filename, --Filename               File name                    [string]
  -o, --output, --Output                   Output Format for inspection
     [string] [choices: "hdbtable", "cds", "hdbmigrationtable"] [default: "cds"]
      --useHanaTypes, --hana               Use SAP HANA-Specific Data Types See
                                           (https://cap.cloud.sap/docs/cds/cdl#p
                                           redefined-types)
                                                      [boolean] [default: false]
      --useCatalogPure, --catalog, --pure  Use "Pure" catalog definitions in a
                                           massConvert. Will include additional
                                           metadata such as Associations and
                                           Merge settings but will also include
                                           some references that are incompatible
                                           with HDI   [boolean] [default: false]
      --useExists, --exists, --persistence  Use Persistence Exists Annotation
                                                       [boolean] [default: true]
  -q, --useQuoted, --quoted, --quotedIdent  Use Quoted Identifiers ![non-identif
  ifiers                                    ier]      [boolean] [default: false]                                           
      --namespace, --ns                    CDS namespace  [string] [default: ""]
      --synonyms                           Filename to store sysnonyms
                                                          [string] [default: ""]
      --keepPath                           Keep table/view path (with dots)
                                                      [boolean] [default: false]
      --noColons                           Replace :: in table/view path with
                                           dot        [boolean] [default: false]

massConvertUI

hana-cli massConvertUI [schema] [table]

Convert a group of tables to CDS or HDBTable format via a browser based UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table                     Database Table[string] [default: "*"]
  -s, --schema, --Schema                   schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                              Limit results [number] [default: 200]
  -f, --folder, --Folder                   DB Module Folder Name
                                                        [string] [default: "./"]
  -n, --filename, --Filename               File name                    [string]
  -o, --output, --Output                   Output Format for inspection
     [string] [choices: "hdbtable", "cds", "hdbmigrationtable"] [default: "cds"]
      --useHanaTypes, --hana               Use SAP HANA-Specific Data Types See
                                           (https://cap.cloud.sap/docs/cds/cdl#p
                                           redefined-types)
                                                      [boolean] [default: false]
      --useCatalogPure, --catalog, --pure  Use "Pure" catalog definitions in a
                                           massConvert. Will include additional
                                           metadata such as Associations and
                                           Merge settings but will also include
                                           some references that are incompatible
                                           with HDI   [boolean] [default: false]
      --namespace, --ns                    CDS namespace  [string] [default: ""]
      --synonyms                           Filename to store sysnonyms
                                                          [string] [default: ""]
      --keepPath                           Keep table/view path (with dots)
                                                      [boolean] [default: false]
      --noColons                           Replace :: in table/view path with
                                           dot        [boolean] [default: false]

massConvertUI example

massRename

hana-cli massRename
[aliases: mr, massrename, massRN, massrn]
Mass Rename fields based upon a CDS-based massExport file

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

massUsers

hana-cli massUsers [user] [password]
[aliases: massUser, mUsers, mUser, mu]
Mass Create 50 Developer Users (for workshops)

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User          User
  -p, --password, --Password  Password

matrix

hana-cli matrix

Blue or Red Pill?

objects

hana-cli objects [schema] [object]
[aliases: o, listObjects, listobjects]
Search across all object types

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -o, --object, --Object  DB Object                      [string] [default: "*"]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit             Limit results                  [number] [default: 200]

objects example

openbas

hana-cli openbas

Open SAP Business Appplication Studio

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output t
                             hat is only helpful to human readable interface. Us
                             eful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of i
                             ntermediate details      [boolean] [default: false]

bas example

openDBX

hana-cli opendbx
[aliases: open, openDBX, opendb, openDBExplorer, opendbexplorer]
Open DB Explorer

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

ports

hana-cli ports

Display port assignments for internal SAP HANA services

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

privilegeError

hana-cli privilegeError [guid]
[aliases: pe, privilegeerror, privilegerror,
                                          getInsuffficientPrivilegeErrorDetails]
Get Insufficient Privilege Error Details

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -g, --guid, --error  GUID from original error message                 [string]

privilegeError example

procedures

hana-cli procedures [schema] [procedure]
[aliases: p, listProcs, ListProc, listprocs, Listproc, listProcedures,
                                                                 listprocedures]
Get a list of all stored procedures

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -p, --procedure, --Procedure  Stored Procedure         [string] [default: "*"]
  -s, --schema, --Schema        schema  [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                   Limit results            [number] [default: 200]

procedures example

querySimple

hana-cli querySimple
[aliases: qs, querysimple]
Execute single SQL command and output results

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -q, --query, --Query        SQL Statement                             [string]
  -f, --folder, --Folder      DB Module Folder Name     [string] [default: "./"]
  -n, --filename, --Filename  File name                                 [string]
  -o, --output, --Output      Output Type for Query Results
                 [string] [choices: "table", "json", "excel", "csv"] [default: "table"]

querySimple example

querySimpleUI

hana-cli querySimpleUI
[aliases: qsui, querysimpleui, queryUI, sqlUI]
Execute single SQL command and output results via HTML UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -q, --query, --Query        SQL Statement                             [string]
  -f, --folder, --Folder      DB Module Folder Name     [string] [default: "./"]
  -n, --filename, --Filename  File name                                 [string]
  -o, --output, --Output      Output Type for Query Results
                 [string] [choices: "table", "json", "excel", "csv"] [default: "table"]

readMe

hana-cli readMe
Display Read Me in CLI

readMeUI

hana-cli readMeUI
Display Read Me in Browser UI

readme

hana-cli readme
[aliases: openreadme, openReadme, openReadMe, openHelp, openhelp]
Open Readme Documentation in browser

reclaim

hana-cli reclaim
[aliases: re]
Reclaim LOB, Log, and Data Volume space

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

rick

hana-cli rick

For expert users only

roles

hana-cli roles [schema] [role]
[aliases: tc, traceContents, traceContent, tracecontent]
Get a list of roles

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -r, --role, --Role      Database Role                  [string] [default: "*"]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit             Limit results                  [number] [default: 200]

roles example

sbss

hana-cli sbss                             List all SAP HANA Cloud SBSS service
                                           instances in your target Space
[aliases: sbssInstances, sbssinstances, sbssServices, listsbss, sbssservices,
                                                                       sbsss]
Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --cf, --cmd  Cloud Foundry?                      [boolean] [default: true]

schemas

hana-cli schemas [schema]
[aliases: sch, getSchemas, listSchemas]
Get a list of all schemas

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -s, --schema, --schemas        schema                  [string] [default: "*"]
  -l, --limit                    Limit results           [number] [default: 200]
      --all, --al, --allSchemas  Show all schemas regardless of permissions
                                                      [boolean] [default: false]

schemas example

schemasUI

hana-cli schemasUI [schema]
[aliases: schui, getSchemasUI, listSchemasUI, schemasui]
Get a list of all schemas in the Browser UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -s, --schema, --schemas        schema                  [string] [default: "*"]
  -l, --limit                    Limit results           [number] [default: 200]
      --all, --al, --allSchemas  Show all schemas regardless of permissions
                                                      [boolean] [default: false]

schemaInstances

hana-cli schemaInstances                  List all SAP HANA Cloud Schema
                                            service instances in your target
                                            Space
         [aliases: schemainstances, schemaServices, listschemas, schemaservices]
Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --cf, --cmd  Cloud Foundry?                      [boolean] [default: true]

securestore

hana-cli securestore                      List all SAP HANA Cloud SecureStore
                                            service instances in your target
                                            Space
      [aliases: secureStoreInstances, securestoreinstances, secureStoreServices,
                             listSecureStore, securestoreservices, securestores]
Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -c, --cf, --cmd  Cloud Foundry?                      [boolean] [default: true]

serviceKey

hana-cli serviceKey [instance] [key]
[aliases: key, servicekey, service-key]
Connect and write default-env.json via service key

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -i, --instance, --Instance                CF/XS Service Instance Name
  -e, --encrypt, --Encrypt, --ssl           Encrypt connections (required for
                                            SAP HANA service for SAP BTP or SAP
                                            HANA Cloud)[boolean] [default: true]
  -v, --validate, --Validate,               Validate Certificate
  --validateCertificate                               [boolean] [default: false]
  -c, --cf, --cmd                           Cloud Foundry?
                                                       [boolean] [default: true]
  -s, --save, --Save                        Save Credentials to default-env.json
                                                       [boolean] [default: true]

sequences

hana-cli sequences [schema] [sequence]
[aliases: seq, listSeqs, ListSeqs, listseqs, Listseq, listSequences]
Get a list of all squences

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --sequence, --seq, --Sequence  Sequence            [string] [default: "*"]
  -s, --schema, --Schema             schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                        Limit results       [number] [default: 200]

status

hana-cli status
[aliases: s, whoami]
Get Connection Status

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -p, --priv, --privileges  Includes Privileges in Output (will be long)
                                                      [boolean] [default: false]

status example

sub

BTP Active Subscriptions and their URL

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output t
                             hat is only helpful to human readable interface. Us
                             eful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of i
                             ntermediate details      [boolean] [default: false]

synonyms

hana-cli synonyms [schema] [synonym] [target]
[aliases: syn, listSynonyms, listsynonyms]
List of all synonyms

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --synonym, --syn, --Synonym  Database Synonym      [string] [default: "*"]
  -t, --target, --Target           Target object         [string] [default: "*"]
  -s, --schema, --Schema           schema
                                        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                      Limit results         [number] [default: 200]

systemInfo

hana-cli systemInfo
[aliases: sys, sysinfo, sysInfo, systeminfo]
General System Details

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

systemInfo example

systemInfoUI

hana-cli systemInfoUI
[aliases: sysUI, sysinfoui, sysInfoUI, systeminfoui]
General System Details displayed in a Web Browser

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

systemInfoUI example

tables

hana-cli tables [schema] [table]
[aliases: t, listTables, listtables]
Get a list of all tables

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table    Database Table                 [string] [default: "*"]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit             Limit results                  [number] [default: 200]

tables example

tablesUI

hana-cli tablesUI [schema] [table]
[aliases: tui, listTablesUI, listtablesui, tablesui]
Get a list of all tables in browser based UI

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --table, --Table    Database Table                 [string] [default: "*"]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit             Limit results                  [number] [default: 200]

traces

hana-cli traces
[aliases: tf, Traces]
List all trace files

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

traceContents

hana-cli traceContents [host] [file]
[aliases: tc, traceContents, traceContent, tracecontent]
Contents of a selected trace file - Reading from the end of the file backwards

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
      --host, --ho, --Host  Hostname                                    [string]
  -f, --file, --File        File Name                                   [string]
  -l, --limit               Limit results               [number] [default: 2000]

traceContents example

triggers

hana-cli triggers [schema] [trigger] [target]
[aliases: trig, listTriggers, ListTrigs, listtrigs, Listtrig, listrig]
List of all triggers

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -t, --trigger, --Trigger      Sequence                 [string] [default: "*"]
      --target, --to, --Target  Target object            [string] [default: "*"]
  -s, --schema, --Schema        schema  [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit                   Limit results            [number] [default: 200]

UI

hana-cli UI
[aliases: ui, gui, GUI, launchpad, LaunchPad, launchPad]
Launch Browser Based UI Version of hana-cli

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]

UI example

ups

hana-cli ups
[aliases: upsInstances, upsinstances, upServices, listups, upsservices]
List all Cloud Foundry user provided service instances in your target Space

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]
Options:
  -c, --cf, --cmd  Cloud Foundry?                      [boolean] [default: true]

users

hana-cli users [user]
[aliases: u, listUsers, listusers]
Get a list of all users

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -u, --user, --User  User                               [string] [default: "*"]
  -l, --limit         Limit results                      [number] [default: 200]

users example

version

hana-cli version
[aliases: ver]
Version details

Troubleshooting:
  --disableVerbose, --quiet  Disable Verbose output - removes all extra output
                             that is only helpful to human readable interface.
                             Useful for scripting commands.
                                                      [boolean] [default: false]
  --debug, --Debug           Debug hana-cli itself by adding output of LOTS of
                             intermediate details     [boolean] [default: false]

version example

views

hana-cli views [schema] [view]
[aliases: v, listViews, listviews]
Get a list of all views

Connection Parameters:
  -a, --admin, --Admin  Connect via admin (default-env-admin.json)
                                                      [boolean] [default: false]
      --conn            Connection Filename to override default-env.json

Troubleshooting:
      --disableVerbose, --quiet  Disable Verbose output - removes all extra
                                 output that is only helpful to human readable
                                 interface. Useful for scripting commands.
                                                      [boolean] [default: false]
      --debug, --Debug           Debug hana-cli itself by adding output of LOTS
                                 of intermediate details
                                                      [boolean] [default: false]

Options:
  -v, --view, --View      Database View                  [string] [default: "*"]
  -s, --schema, --Schema  schema        [string] [default: "**CURRENT_SCHEMA**"]
  -l, --limit             Limit results                  [number] [default: 200]

How to obtain support

This project is provided "as-is": there is no guarantee that raised issues will be answered or addressed in future releases.

License

Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.

hana-developer-cli-tool-example's People

Contributors

6of5 avatar btbernard avatar gregorwolf avatar jung-thomas avatar meyer-j avatar sbarzaghialteaup avatar theplenkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hana-developer-cli-tool-example's Issues

cli unable to connect to HANA on node v12.18.1 on macOS - Error Abort trap: 6

Any commands which require a connect to HANA are failing (Error Abort trap: 6) with node v12.18.1 on macOS 10.15.5, Example: When try to connect to HANA System (here SystemDB on HXE on docker) with connect command:

hana-developer-cli-tool-example $ node bin/cli.js connect
Input: Connection String  <host>[:<port>]:  hxehost:39017
Input: User:  SYSTEM
Input: Password:  ***********

Input: Encrypt connections (required for HANA As A Service or HANA Cloud):  false
Input: Optional: HDB User Store Key - Overrides all other Connection Parameters:  
Input: SSL Trust Store:  
โ ™ 
Abort trap: 6

Environment is: node v.12.18.1 (using nvm) on macOS 10.15.5. When I switch to v12.14.1 of node everything is working fine. I have not tested other node releases

Debugging leads that the error happens in line 23 in client-factory.js of hdbext (v6.2.2 with hana-client 2.4.196) when client.connect(cb) is executed:

var hdb = require('@sap/hana-client');
........


function createConnection(options, callback) {
  options = normalizeOptions(options);

  var client = hdb.createClient(options);

........

  async.series([
    function (cb) {
// Line 23
      client.connect(cb);
    },

BR HP

adminHDI grants privileges to SYSTEM

adminHDI.js creates a new user and grants the privileges from _SYS_DI.T_DEFAULT_DI_ADMIN_PRIVILEGES to this user. In addition these privileges are also always granted to SYSTEM. Is this the expected behavior or should it be fixed? Not an issue for my use case, so I'm fine with keeping it as it is.

At the very least the grant to the Built-In Admin user should be optional and default to false. But it should also be smart enough to target SYSTEM in on premise and DBADMIN in Cloud.

hana-cli based Containers and XS based Containers

Hello, The containers are getting created fine using hana-cli. We are looking to use the container in the Database explorer of Web IDE for Data Preview/SQL console. However, this container is not listed in Web IDE, and not also in the XSA Service Instances.

Do we have an option to make it interchangeably work between XSA based containers - web ide and hana-cli

Reason: We are trying to build cap project completely based on VS Code and hana-cli. However, we need to use Web IDE for additional developments like Graphical Calc.Views, DB Explorer (Data Preview) etc.

Great Videos

hello Thomas,

i would like to say the videos are great.

VG
Damian

Issue with connecting to XS Advance Database

Hi Thomas,
As suggested by you on the youtube video to move the conversation here, I have attached a screenshot of the error I am getting while connecting to the XS Advance Database using the hana-cli command. I tried to use the admin credentials for connecting but it still shows the same issue.
hana-cli issue

But if I try to make a default-env.json using credentials I take from the application by going into the cockpit and getting the specific credentials I am able to do it but that gives me a access to a specific HDI Container, whereas what I want to do is make a new application and deploy it to XSA Databse like we do it in cloud by using the 'cf' command.

Regards
Atharva

Which port do I need to use for connect?

Hi! Could you please advice which port do i need to use to connect via CLI?

Somehow it doesn't allow me to use 30015 ( we have instance 00 ) and it connects to 30041, but no commands work actually.

Can it be connected that it's not a system database by a tenant?

Thank you!

not able to execute commands in HANA 1.0 sps12 - VError: No service matches hana

Hi Team, I have connected hana-cli to hana 1.0 sps 12. I was intending to use massConvert to convert all table in a schema to .hdbtable files.

But I am not able to execute any commands as the below error is thrown.

{ VError: No service matches hana at Object.getServices (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\@sap\xsenv\lib\xsservices.js:50:15) at Promise (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\sap-hdbext-promisfied\index.js:15:33) at new Promise (<anonymous>) at Function.createConnectionFromEnv (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\sap-hdbext-promisfied\index.js:9:16) at dbStatus (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\bin\status.js:49:48) at prompt.get (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\bin\status.js:43:10) at C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:336:32 at C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\utile\node_modules\async\lib\async.js:154:25 at assembler (C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:333:9) at C:\Users\<username>\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:342:32 jse_shortmsg: 'No service matches hana', jse_info: {},

sudo

Hi Tom,

i hope this is not a wrong entry point for my issue and maybe it can confirmed. if i want to use BTP to install binaries from scratch i think i may need sudo , however if run it in my BTP dev space i get this error:
bash: sudo: command not found

when i put Azure to the side and try either Google or Amazon they both come back with
usage: sudo -h | -K | -k | -V

if there's a better place to raise this issue, please close it here and let me know where to try it next.

thank you,
greg

Add support for HANA XSA in the UPS and HDI commands.

  • Add new utility library xs.js that mimics the commands in cf.js and allows for calling the controller APIs via the xs curl command. This library and the functionality described here will require the xs client to be installed locally and you have to already be logged in with xs login.
  • Add --cf option (that defaults to Cloud Foundry) on the ups and hdi commands
  • If the --cf option is set to false, then connect via the xs client and perform the same operation for XSA

Add filename option for massConvert operation

Hi @jung-thomas

Thanks again for a tip to use massConvert command.

One more issue I would love to add - is it possible to provide also filename as a parameter?

For example it could be useful for those who prefer to have all exported schemas in one folder.

Thank you!

WSL: hana-cli hdi --cf false --> **/bin/sh: 1: Syntax error: Unterminated quoted string**

I did the same request with PowerShell ans WSL. PS works fine, but WSL gives me an error. /bin/sh: 1: Syntax error: Unterminated quoted string

But I do have one more question.
Is there a filter for only hana instances with hdi-shared plans? I miss hana services with securestore and sbss plans in the result.

Latest hana-cli version available on npmjs.com: 2.202106.1
**PS**
PS C:\git\Secure-Store-with-NodeJS> hana-cli hdi --cf false
name                                                      last_operation   
--------------------------------------------------------  -----------------
DIRASCHK-16tb4r1uvw6vpwms-capm-capm-db-hdi-container      create succeeded
dr-hdi-shared                                             create succeeded
**WSL**
Latest hana-cli version available on npmjs.com: 2.202106.1
diraschk@vmn-it-ful-05:/mnt/c/git/Secure-Store-with-NodeJS$ hana-cli hdi --cf false
Error: Command failed: xs curl "/v2/service_instances/?q=space_guid:f74450b6-af3a-4c90-9d1a-da3b30e4dd49%3Bservice_plan_guid:6126d8a3-949%3Bservice_plan_guid:6126d8a3-9ebf-4c70-ab30-e9626b40b1ca&results-per-page=5000
**/bin/sh: 1: Syntax error: Unterminated quoted string**

Dependency to deprecated node pregyp in node modules of hana-cli with issues

Hi there,

I am not able to build my mtar for my SAP CAP based application because of node-pre-gyp that is part of the hana-cli node modules. There are some dependencies with the deprecated node pregyp (latest is: @mapbox/node-pre-gyp": "^1.0.5").
I had to delete the hana-cli module and refresh my node modules in order to be able to successfully build an mtar file...because then the dependency to node pregyp was gone...

I already used these commands:
npm uninstall node-pre-gyp --save
npm install @mapbox/node-pre-gyp --save

In my package.json I have added the dependency: "@mapbox/node-pre-gyp": "^1.0.5",

...no effect...
I am getting this error:
ERROR could not package the "app-39818-srv" module when archiving: could not read the "/home/user/projects/app-39818-arbeitskleidung/gen/srv/node_modules/hana-cli/node_modules/.bin/detect-libc" symbolic link: stat /home/user/projects/app-39818-arbeitskleidung/gen/srv/node_modules/hana-cli/node_modules/detect-libc/bin/detect-libc.js: no such file or directory
make: *** [Makefile_20210714125238.mta:37: app-39818-srv] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20210714125238.mta p=cf mtar= strict=true mode=" command: exit status 2

Please check this issue from your side as well.

Thank you and BR
Rufat

Error while creating HDI using CLi

#53
Thank you for making changes, I am able to connect to the database now.

Now I am not able to create a HDI Container using my Admin user. While debugging I found the following error:
cli_issue_1
cli_issue_2
cli_issue_3

'No service matches hana'

when try to command hana-cli cds init bookshop -add hana

I got the following error :

VError: No service matches hana
    at Object.getServices (C:\Driver\code\hana\hana-developer-cli-tool-example\node_modules\@sap\xsenv\lib\xsservices.js:50:15)
    at C:\Driver\code\hana\hana-developer-cli-tool-example\utils\dbPromises.js:13:21
    at new Promise (<anonymous>)
    at Function.createConnectionFromEnv (C:\Driver\code\hana\hana-developer-cli-tool-example\utils\dbPromises.js:8:10)
    at cds (C:\Driver\code\hana\hana-developer-cli-tool-example\bin\cds.js:86:40)
    at C:\Driver\code\hana\hana-developer-cli-tool-example\bin\cds.js:80:5
    at C:\Driver\code\hana\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:336:32
    at C:\Driver\code\hana\hana-developer-cli-tool-example\node_modules\async\lib\async.js:154:25
    at assembler (C:\Driver\code\hana\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:333:9)
    at C:\Driver\code\hana\hana-developer-cli-tool-example\node_modules\prompt\lib\prompt.js:342:32 {
  jse_shortmsg: 'No service matches hana',
  jse_info: {},
  message: 'No service matches hana'
\
/
Error: Invalid Input Table
    at Object.getTable (C:\Driver\code\hana\hana-developer-cli-tool-example\utils\dbInspect.js:59:9)

massConvert command is not working for table names with lower case letters

Hi @jung-thomas ,

I am not able to make "massConvert" command work for tables with case sensitive names or lowercase letters.
Default option for tables which is "*" also is not working in this scenario. It is working perfectly fine for table names with upper case letters only.
I have hundreds of tables in different schemas with lowercase and case sensitive naming which are created by .hdbdd files.
Can you help me to figure out the solution?

Command used:
hana-cli massConvert -a -s "SCHEMANAME" -o "hdbtable"

Error is:

Schema: SCHEMANAME, Table: *
{ code: 397,
  message:
   'invalid object name: SCHEMANAME.COM.MYCOMPANY.DB::VENDORS has an unknown type.',
  sqlState: 'HY000' }
TypeError: Cannot read property 'stop' of undefined
    at process.errorHandler (C:\Users\SUCHEN\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\bin\cli.js:14:22)
    at process.emit (events.js:198:13)
    at emitPromiseRejectionWarnings (internal/process/promises.js:119:20)
    at process._tickCallback (internal/process/next_tick.js:69:34)
C:\Users\SUCHEN\Documents\Suchen Workspaces\vscode files\hana-developer-cli-tool-example\bin\cli.js:14
    global.__spinner.stop()

Thanks.

Research: add commands from the HANA Cloud controller

The commands for the HANA Cloud controller are nicely REST APIs but does require oAuth. I'd like to research how we might perform this oAuth login in a both a security and nice manner (not once per command). If it can be done well then we can add a whole bunch of HANA Cloud commands to the CLI as well.

Add support for hdbmigrationtable in massConvert and inspectTable

https://help.sap.com/viewer/c2cc2e43458d4abda6788049c58143dc/2021_01_QRC/en-US/52d1f5acfa754a7887e21226641eb261.html

  • Added hdbmigrationtable output format to inspectTable and massConvert

Also

  • Add option useCatalogPure to massConvert command. Defaults to false and uses the cds.compile api to produce its hdbtable or hdbmigrationtable output. When set to true it will instead use the HANA SYS.GET_OBJECT_DEFINITION which includes more metadata but might produce results which are incompatible with HDI
  • Remove the Schema from output of massConvert commands

no colons mode for massConvert

Hi!

Since we've introduced namespace option in #43
and also have automatic synonyms generation #48

i thought how to combine those two things. Pretent we have a table like that in the database:

com.my_company.flights_model::flights

So right now hana-cli mc gives us ![com_my_company_flight_model::flights] entity. We can use it in the next cds like that:

using { ![com_my_company_flight_model::flights]  as flights } from './flights'

If we use --namespace option we can make it simple to import just namespace, but because of :: we still have to escape table name later

So what my proposal is - to introduce a special mode when actually the original path will be kept, but :: symbol will be replaced with one more dot.

So we will have in the generated file

entity com.my_company.flights_model.flights {}

then we'll be able to use this cds in a very flexible way using com.my_company.flights_model as model or using com.my_company and so on. Also because we don't have colons we can access table like that model.flights in CAP cds.

error Verification failed while extracting @sap/[email protected]:

Hi Thomas,

do you have an idea, how we can fix this issue:
error Verification failed while extracting @sap/[email protected]

This is a new issue for our long existing db-modul, when we try to build it in a new space with our WebIDE.
We never had this issue in the past. But after playing with the hana-client for local developments (with VSC) some weeks ago, I came now across to this issue while building our db-modul.

  1. Checked the project. Couldn't find any reference to the hana-client. Don't where this comes from...

  2. removed the devx-npm-cache-fs
    xs unbind-service di-local-npm-registry devx-npm-cache-fs
    xs delete-service devx-npm-cache-fs
    xs create-service fs-storage free devx-npm-cache-fs
    xs bind-service di-local-npm-registry devx-npm-cache-fs
    xs restage di-local-npm-registry
    xs restart di-local-npm-registry

  3. Already existing projects with the same db-modul don't have this issue.

316 warn tarball tarball data for @sap/[email protected] (sha512-SLAXY230hcI7QpksnYUzYEyghyzlZYs0/5K8HzdVYNE2oGf4Z4XN8Zm8cIeQ5LCGyB27apsmSjMZ0tE+z2HrZw==) seems to be corrupted. Trying one more time. 317 warn tarball tarball data for @sap/[email protected] (sha512-SLAXY230hcI7QpksnYUzYEyghyzlZYs0/5K8HzdVYNE2oGf4Z4XN8Zm8cIeQ5LCGyB27apsmSjMZ0tE+z2HrZw==) seems to be corrupted. Trying one more time. 318 timing action:extract Completed in 7771ms 319 verbose unlock done using /hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/cache/node8.15/.npm/_locks/staging-3afc96fa8c407585.lock for /hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-3773557706351202928/db/node_modules/.staging 320 timing stage:rollbackFailedOptional Completed in 0ms 321 timing stage:runTopLevelLifecycles Completed in 8335ms 322 silly saveTree deploy@ 322 silly saveTree -- @sap/[email protected]
322 silly saveTree +-- @sap/[email protected]
322 silly saveTree | -- [email protected] 322 silly saveTree | -- [email protected]
322 silly saveTree +-- @sap/[email protected]
322 silly saveTree | -- [email protected] 322 silly saveTree +-- @sap/[email protected] 322 silly saveTree | +-- [email protected] 322 silly saveTree | | -- [email protected]
322 silly saveTree | -- [email protected] 322 silly saveTree | +-- [email protected] 322 silly saveTree | +-- [email protected] 322 silly saveTree | -- [email protected]
322 silly saveTree +-- [email protected]
322 silly saveTree -- [email protected] 322 silly saveTree +-- [email protected] 322 silly saveTree +-- [email protected] 322 silly saveTree +-- [email protected] 322 silly saveTree +-- [email protected] 322 silly saveTree -- [email protected]
323 warn deploy@ No description
324 warn deploy@ No repository field.

325 warn deploy@ No license field.
326 verbose stack Error: sha512-SLAXY230hcI7QpksnYUzYEyghyzlZYs0/5K8HzdVYNE2oGf4Z4XN8Zm8cIeQ5LCGyB27apsmSjMZ0tE+z2HrZw== integrity checksum failed when using sha512: wanted sha512-SLAXY230hcI7QpksnYUzYEyghyzlZYs0/5K8HzdVYNE2oGf4Z4XN8Zm8cIeQ5LCGyB27apsmSjMZ0tE+z2HrZw== but got sha512-HPVCHKnghU2t9ni6Eut0iwNMVqPIcJlTPe/QtRSgtc4ZBlAXrSbOD4CmztfSQa0o7Pinu3UyQX9EpoX4G7/+8A==. (53837145 bytes)
326 verbose stack at Transform.on (/hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/resources/nodejs/vendor/node8.15/lib/node_modules/npm/node_modules/ssri/index.js:310:19)
326 verbose stack at emitNone (events.js:111:20)
326 verbose stack at Transform.emit (events.js:208:7)
326 verbose stack at endReadableNT (_stream_readable.js:1064:12)
326 verbose stack at _combinedTickCallback (internal/process/next_tick.js:139:11)
326 verbose stack at process._tickCallback (internal/process/next_tick.js:181:9)
327 verbose cwd /hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/hdi-builder/builds/build-3773557706351202928/db
328 verbose Linux 4.12.14-150.17-default
329 verbose argv "/hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/resources/nodejs/vendor/node8.15/bin/node" "/hana/shared/TBD/xs/app_working/tbase-dev/executionroot/313656e1-5a46-4199-b24f-7170c27408f6/app/META-INF/resources/nodejs/vendor/node8.15/lib/node_modules/npm/bin/npm-cli.js" "install"
330 verbose node v8.15.0
331 verbose npm v6.4.1
332 error code EINTEGRITY
333 error Verification failed while extracting @sap/[email protected]:
333 error Verification failed while extracting @sap/[email protected]:`

Best Regards

Optional namespace for generated cds

In our CAP project we use hana-cli mc to convert database schema to cds. Later we use this cds in service cds views.

However it's quite time consuming to export every time table by table if schema contains many tables.

To improve the experience we can just declare namespace and then use this namespace in using instruction.

As an example if mc generates this file as model.cds:

entity![com.company.package::Table_1]{
  ...
};
entity![com.company.package::Table_2]{
  ...
};
entity![com.company.package::Table_3]{
  ...
};
entity![com.company.package::Table_4]{
  ...
};

then it requires us to write manually in each cds:

using {![com.company.package::Table_1], ![com.company.package::Table_2], ![com.company.package::Table_3] ... } from './model';

What is the proposal:

use hana-cli mc --namespace schema. Then generated file will look like this:

namespace schema;
entity1, entity2....

and we can reuse it already much easier

using schema from './model';

No service definitins found in loaded models.

Hi,
I am getting the below error when I run npm start

[email protected] start /home/usr/sap/bookshop

npx cds run

[cds] - model loaded from 1 file(s):

db/schema.cds

[cds] - connect to db undefined
[ERROR] No service definitins found in loaded models.
at serve (/home/usr/sap/bookshop/node_modules/@sap/cds/bin/serve.js:142:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: npx cds run
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/usr/.npm/_logs/2020-04-27T07_35_00_800Z-debug.log

Output of hana-cli status is
Current User Current Schema


BOOKSHOP_1A8C95B4450E4A78B58C342E7DEAC1F1_RT BOOKSHOP

I did see that on cds build my schema.cds is automatically deleted.

npm Version 6.4.1
Node v10.14.2

Thanks

Verification failed while extracting @sap/[email protected]

Hi Thomas,

to successfully install hana-cli, I had to change the package-lock.json file

replacing integrity line such as after:

"@sap/hana-client": {
"version": "2.5.86",
"resolved": "https://npm.sap.com/@sap/hana-client/-/hana-client-2.5.86.tgz",
"integrity": "sha512-Rk8WrhKSSFMrGWoOOT3tzYow3NdGZtSCMyDc06w3354fsUaaTyWZG9p/av5UTGCf9n1no1oa9X/HcSbhxwQGfQ==",
"requires": {
"debug": "3.1.0"
},

otherwise, I would get :

npm WARN tarball tarball data for @sap/[email protected] (sha512-m1ECPz0OwqcmNtzB/Y92m3zuT+ePOI8Ypr9Z+GPtEHtJFCGgHYx8N/oaa/WGmA7xmwfNvDV9HLtasJnndewErw==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @sap/[email protected] (sha512-m1ECPz0OwqcmNtzB/Y92m3zuT+ePOI8Ypr9Z+GPtEHtJFCGgHYx8N/oaa/WGmA7xmwfNvDV9HLtasJnndewErw==) seems to be corrupted. Trying one more time.
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting @sap/[email protected]:
npm ERR! Verification failed while extracting @sap/[email protected]:
npm ERR! sha512-m1ECPz0OwqcmNtzB/Y92m3zuT+ePOI8Ypr9Z+GPtEHtJFCGgHYx8N/oaa/WGmA7xmwfNvDV9HLtasJnndewErw== integrity checksum failed when using sha512: wanted sha512-m1ECPz0OwqcmNtzB/Y92m3zuT+ePOI8Ypr9Z+GPtEHtJFCGgHYx8N/oaa/WGmA7xmwfNvDV9HLtasJnndewErw== but got sha512-Rk8WrhKSSFMrGWoOOT3tzYow3NdGZtSCMyDc06w3354fsUaaTyWZG9p/av5UTGCf9n1no1oa9X/HcSbhxwQGfQ==. (55293167 bytes)

This issue can then be closed

Refactoring: move some parts to reuse

As the hana-cli has grown some parts are unfortunately duplicated between similar commands (for example inspectTable and inspectView). While we already have some central reuse libraries outside the /bin command files there are opportunities to move even more out of the commands. This issue is an enhancement request to set aside some time to invest in further improvements here.

adminHDIGroup.js fails with a 'grantor and grantee are identical' error in a specific case

adminHDIGroup.js fails with a 'grantor and grantee are identical' error in a specific case:
a) I create an hdiadmin user with adminHDI.js first
b) the hdiadmin user is used to create the container group
c) then the hdiadmin user is used to grant the container group admin privileges to hdiadmin (needed to create the container afterwards)
In this case the GRANT USER/ROLE ADMIN TO hdiadmin fails with the above error
I have a quick fix that simply reads the database user name from the configuration file again and if this user name equals the user given in the command-line, the statements are skipped.

Error: Cannot find module 'fs/promises' in Node 12.x

Tool crashes with Error: Cannot find module 'fs/promises' when used in Node 12.x. This is due to this feature being introduced in Node 10 but then removed in later patches for Node 10 and Node 12. Works fine in Node 14. Node.js documentation was incorrectly listing this as supported in Node 12. See nodejs/node#35740

Will fix in hana-cli by changing to require('fs').promises

Restructure the Readme page

As the content of the Readme page has grown it needs some reorganization. Should it be broken down into sub-pages? List the command alphabetically? Or group them by use case? But something needs to be done to make it easier to find and discover functionality.

Exclude user-defined table types from generated CDS (or support them as CDS types)

Hi!

I just noticed that if we declare table type in the system like that:

image

it ends up in CDS like this:
image

if we'll try to select from such an entity - that will fail of course.
image

Therefore I propose for now just to exclude such user-defined types from the selection. And if needed to return the back already as CDS types.
Luckily we can simply filter out them with IS_USER_DEFINED_TYPE = FALSE

command serviceKey throws TypeError: Cannot set property 'encrypt' of undefined

The error occurs with the current version 2.202201.7 of hana-cli using HDI Container on BTP Trial. Output

hana-cli serviceKey repapp-hdi-dev repapp-hdi-dev-key2
Service Key repapp-hdi-dev-key2 created
Getting key repapp-hdi-dev-key2 for service instance repapp-hdi-dev as ......
TypeError: Cannot set property 'encrypt' of undefined

with version 2.202112.1 it works fine. The commit 681e734 from 202201-06 seems responsible, also it is marked as fix. I'm using cf version 7.2.0+be4a5ce2b.2020-12-10. Is there any newer version of cf cli necessary?

Add Type Definitions via JSDoc

Will really only impact the maintainers but should provide better internal type checking and code completion within the project

Connection issue

Hi Team,

trying to connect to CF service using below command
hana-cli serviceKey <> default

Connection failed (RTE:[89006] System call 'connect' failed, rc=10061:No connection could be made because the target machine actively refused it

Regards,
Anil

Error: Connection failed (RTE:[89001] Cannot resolve host name

I do get this error msg "Cannot resolve host name" sometimes, when running hana-cli commands.

To solve this issue I changed the default-env.json host value to the FQDN.
Maybe it would be better, to set the FQDN value when the env.json file is created?

In my case I had to change it, because the UI wasn't working. After I changed the host manually it worked.
Thanks for the new UI! Great work!

Generate hdbsynonyms along with CDS for massConvert operation

Hi!

One more suggestion which I would like to come with:

Right now when we generate schema CDS with hana-cli massConvert operation we have CDS with renamed tables/views.

However after HDI deployment to consume CAP CDS views we will also need .hdbsynonyms file containing all those views. If it's like couple views - it's OK to recreate, however when we have large schemas, especially in cross-schema projects - the amount of manual work is quite high.

That's why I just thought - what if we generate also synonym file along with cds file:

hana-cli mc SFLIGHT --filename sflight.cds --synonyms sflight.hdbsynonyms

It's quite simple to save this file as we have all the data from SCHEMA

Container Runtime User Created with only SELECT authorization

When using the createContainer command, the runtime container technical user was getting created with SELECT only authorizations. This would result in unauthorized errors when running services for this container that performed CUD operations.
image

With commit 061e334 the problem is solved by extending the standard DEFAULT_CONTAINER_USER_PRIVILEGES with INSERT, CREATE TEMPORARY TABLE, DELETE, EXECUTE, UPDATE, and SELECT CDS METADATA as well.

You do have to drop and then recreate your container for this fix to have an effect. The other workaround which avoids dropping the container would be to add a default_access_role.hdbrole to your db module which grants the necessary security. This is automatically applied to the container technical runtime user by the hdi-deployer.

Does not create tables in HDI Container

Hi,
On running npm start , it does not create the tables in HANA, this is console output

[email protected] start /home/usr/mysaperp
npx cds run

[cds] - model loaded from 2 file(s):

db/schema.cds
srv/admin-service.cds

[cds] - connect to db undefined
[cds] - serving AdminService { at: '/admin' }

[cds] - launched in: 1321.084ms
[cds] - server listening on { url: 'http://localhost:4004' }

logs of hana-cli status
Privileges Granted to the Current User
PRIVILEGE OBJECT_TYPE GRANTOR IS_GRANTABLE


CREATE ANY SCHEMA SYS TRUE
SELECT SCHEMA MYSAPERP FALSE

My package and default-env.json enable me to connect to HANA express but there are no visible tables when hana-cli tables as well.

Error message invalid name of function or procedure: no procedure with name CREATE_CONTAINER found

Hello,

i am working on the first video ( https://www.youtube.com/watch?v=FWOo_mm0sfQ ) and i try with hana-cli createContainer to create a Container on a hana cloud. You do the tasks with a local hana database but i didnt have anyone.
But i got this message:
Isnt possible to do the same tasks with a hana cloud ? hana-cli connect was successfully.

[damian@centos db]$ hana-cli createContainer
Input: Container Name: BOOKSHOP
Input: Encrypt connections (required for HANA As A Service or HANA Cloud): t
โ ฆ
{
code: 328,
message: 'invalid name of function or procedure: no procedure with name CREATE_CONTAINER found: line 1 col 14 (at pos 13)',
sqlState: 'HY000'
[damian@centos db]$

Missing guide to connect hana-cli to hana services

Maybe i'm blind but i didn't finde any guide which information i need to take from which places to be able to connect to my hana cloud trial service.

The host name i found by myself,
to allow connection form any ip checked
found the admin user checked
the port i'm not 100% sure if this is the index service port or something else?
Encrypt connections - you mention in on of you videos that needs to be enabled
hdb user store key - i don't need i guess?
ssl trust store - dunno

so far i get with my guessing game:

PS F:\github\typeormhana> hana-cli connect
Input: Connection String  <host>[:<port>]:  (node:17284) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
**********************************.hana.trial-eu10.hanacloud.ondemand.com:30041
Input: User:  aaaaaaaaa
Input: Password:  *************

Input: Encrypt connections (required for HANA As A Service or HANA Cloud):  t
Input: Optional: HDB User Store Key - Overrides all other Connection Parameters:
Input: SSL Trust Store:
-
Error: Connection Problem {}
    at dbConnect (D:\Programme\nvm\v15.5.0\node_modules\hana-cli\bin\connect.js:142:15)

Support HANA 1.0

Remove some columns from the catalog lookup that aren't present in HANA 1.0. This will allow for the massMigrate command to be ran against HANA 1.0 systems in order to support the move to HANA 2.0 or HANA Cloud.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.