Supported Environments
HANA CLI works in diverse development environments.
Local Development
SAP HANA Express Edition
Perfect for local development:
bash
# Connect to local HANA Express
export HANA_HOST=localhost
export HANA_PORT=30013
export HANA_USER=SYSTEM
export HANA_PASSWORD=password
hana-cli dbInfoVSCode Integration
- Install SAP Tools for VSCode
- Configure connection in VSCode settings
- Use HANA CLI alongside other tools
Remote HANA Server
Connect to any remote HANA instance:
json
{
"VCAP_SERVICES": {
"hana": [{
"credentials": {
"host": "remote-hana.company.com",
"port": 30013,
"user": "DBUSER",
"password": "password"
}
}]
}
}Cloud Development
SAP Business Application Studio
Built-in Node.js runtime - HANA CLI works out of the box:
bash
# Install in BAS
npm install -g hana-cli
# Use immediately
hana-cli dbInfoFeatures:
- Pre-configured with SAP tools
- Direct access to BTP services
- Integrated terminal
Google Cloud Shell
Using Cloud Shell with HANA in Google Cloud:
bash
# Cloud Shell comes with Node.js
npm install -g hana-cli
# Configure credentials
export HANA_HOST=your-hana-server
export HANA_USER=dbuser
export HANA_PASSWORD=password
hana-cli tables -s SCHEMAAWS Cloud9
AWS Cloud9 IDE environment:
bash
# Cloud9 includes Node.js
npm install -g hana-cli
# Can connect to HANA anywhere (same network, VPN, etc.)
hana-cli import -n data.csv -t TABLEGitHub Codespaces
Development in the cloud using GitHub Codespaces:
bash
# Codespaces includes Node.js
npm install -g hana-cli
# Works with HANA across networks
hana-cli compareSchema -s SCHEMA1 -s SCHEMA2SAP Cloud Platforms
SAP BTP (Business Technology Platform)
Connect to HANA service on BTP:
bash
# Credentials auto-discovered from VCAP_SERVICES
hana-cli dbInfo
# Works with any BTP HANA instance
hana-cli export -s SCHEMA -t TABLE -o data.csvSupported Services:
- SAP HANA Cloud
- SAP HANA service for BTP
- SAP Data Lake
- SAP Analytics Cloud
SAP HANA Cloud
Native cloud HANA:
bash
# Connection details provided by SAP HANA Cloud
export HANA_HOST=xxxxxxxx.hanacloud.ondemand.com
export HANA_USER=DBADMIN
hana-cli dataProfile -s SCHEMA -t TABLEDevelopment Containers
Docker
Containerized development environment:
dockerfile
FROM node:16
# Install HANA CLI
RUN npm install -g hana-cli
# Set working directory
WORKDIR /app
# Your commands
CMD ["hana-cli", "--help"]Run:
bash
docker run -e HANA_HOST=my-hana -e HANA_USER=user \
my-hana-cli-image hana-cli dbInfoVS Code Dev Containers
.devcontainer/devcontainer.json:
json
{
"name": "HANA CLI Development",
"image": "mcr.microsoft.com/devcontainers/javascript-node:16",
"postCreateCommand": "npm install -g hana-cli",
"forwardPorts": [3000],
"remoteEnv": {
"HANA_HOST": "your-hana-server"
}
}Kubernetes
Deploy HANA CLI job in Kubernetes:
yaml
apiVersion: batch/v1
kind: Job
metadata:
name: hana-cli-import
spec:
template:
spec:
containers:
- name: hana-cli
image: node:16
command: ["npm", "install", "-g", "hana-cli"]
env:
- name: HANA_HOST
value: "hana-service:30013"
- name: HANA_USER
valueFrom:
secretKeyRef:
name: hana-credentials
key: username
restartPolicy: NeverCI/CD Pipelines
GitHub Actions
.github/workflows/data-sync.yml:
yaml
name: Data Sync
on: [push]
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm install -g hana-cli
- run: hana-cli dataSync -s1 DEV -t1 TABLE -s2 PROD -t2 TABLE
env:
HANA_HOST: ${{ secrets.HANA_HOST }}
HANA_USER: ${{ secrets.HANA_USER }}
HANA_PASSWORD: ${{ secrets.HANA_PASSWORD }}GitLab CI
.gitlab-ci.yml:
yaml
import-data:
image: node:16
script:
- npm install -g hana-cli
- hana-cli import -n data.csv -t EMPLOYEES
variables:
HANA_HOST: $HANA_HOST
HANA_USER: $HANA_USER
HANA_PASSWORD: $HANA_PASSWORDJenkins
groovy
pipeline {
agent any
stages {
stage('Setup') {
steps {
sh 'npm install -g hana-cli'
}
}
stage('Export Data') {
steps {
withCredentials([string(credentialsId: 'hana-password', variable: 'PASS')]) {
sh 'hana-cli export -s SCHEMA -t TABLE -o backup.csv'
}
}
}
}
}Operating Systems
Windows
bash
# Install globally
npm install -g hana-cli
# Use in PowerShell, CMD, or WSL
hana-cli dbInfomacOS
bash
# Install via npm or Homebrew
npm install -g hana-cli
# Use in Terminal
hana-cli dbInfoLinux
bash
# Works on any Linux distribution
npm install -g hana-cli
# Use in shell/terminal
hana-cli dbInfoNetwork Scenarios
Same Network
bash
hana-cli dbInfo # Direct connection worksVPN/Tunneling
bash
# Connect through VPN - works normally
hana-cli export -s SCHEMA -t TABLE -o data.csvBastion Host / Jump Server
bash
# SSH tunnel through bastion to HANA
# Then use HANA CLI with forwarded port
export HANA_HOST=localhost
export HANA_PORT=3306 # tunneled port
hana-cli dbInfoCompatibility
| Environment | Status | Notes |
|---|---|---|
| Local Dev | ✅ Supported | Works great |
| BAS | ✅ Supported | Recommended |
| Cloud Shell | ✅ Supported | All platforms |
| BTP | ✅ Supported | Native integration |
| HANA Cloud | ✅ Supported | Recommended |
| Docker | ✅ Supported | Containerized |
| Kubernetes | ✅ Supported | Pod/job agent |
| Windows | ✅ Supported | Full support |
| macOS | ✅ Supported | Full support |
| Linux | ✅ Supported | Full support |
