@saptools/sqltools
A command line that turns the HANA service binding of a Cloud FoundrySAP BTP, Cloud Foundry RuntimeThe Cloud Foundry runtime of SAP BTP: memory for applications in a Cloud Foundry org, run from SAP's Java, Node.js and Python buildpacks or community buildpacks and managed with the standard Cloud Foundry tools.sap official, btp app into a connection for the SQLTools extension in VS Code, written to the workspace's .vscode/settings.json.
Connecting the SQLTools extension in VS Code to an app's database otherwise means copying host, user, password and schema out of VCAP_SERVICES by hand. sqltools-export reads the bindings from a live app (from-app logs in with SAP_EMAIL and SAP_PASSWORD, from-cf uses the current cf target), from a saved JSON file or from stdin, and writes a SAPHana connection named <app> (<region>) together with a hana-credentials.json backup of every binding, both holding live credentials. It writes the connection and stops there: queries run in the SQLTools extension and the SQLTools SAP HANA driver, which have to be installed. Only bindings under the hana service label are read, the default for SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp and HDI bindings on BTP.
Facts
Where it sits
Who is behind it
In the atlas: maintains 18, contributes to 18@dongitranmaintainer
What it declares
Every artifact
- Type
- CLI
- Origin
- Independently maintained
- Runs on
- Cloud Foundry
As a CLI
- Distributed through
- npm
Connections
Editor help with source: completion, navigation, errors, refactoring
A cross-platform JavaScript runtime that servers, command line tools and scripts written in JavaScript are run with. For the things here, the prerequisite a repository names when its build is a set of npm scripts.
Managed SAP HANA database service on BTP
Download
Install
npm add @saptools/sqltoolsDerived from the package name. No recipe recorded; the README has the configuration.
Architecture
Download
README
quoted from dongitran/saptools under MIT, read🗄️ @saptools/sqltools
Stop copy-pasting HANA credentials out of VCAP_SERVICES.
One command turns a SAP BTP Cloud Foundry HANA service binding into a ready-to-use VS Code SQLTools connection — no cockpit clicking, no JSON surgery.
Install • Quick Start • CLI • FAQ
✨ Features
- 🔌 One-shot export — pulls
VCAP_SERVICESfrom any CF app and writes.vscode/settings.jsonwith a valid SAPHana connection - 🪄 Four input paths — read from a real CF app, a saved JSON file, stdin, or an already-targeted CF session
- 🧷 Non-destructive — preserves unrelated VS Code settings and, with
--merge, unrelated SQLTools connections too - 💾 Backup JSON — drops a
hana-credentials.jsonbeside the settings so HDI users / URLs / certificates stay within reach - 🔒 Type-safe — shipped with full TypeScript definitions for every input and output shape
- 🪶 Tiny — two runtime deps (
@saptools/cf-sync,commander) and zero runtime magic
📦 Install
# Global CLI
npm install -g @saptools/sqltools
# Or as a dependency
npm install @saptools/sqltools
# pnpm add @saptools/sqltools
# yarn add @saptools/sqltools
Note
Requires Node.js ≥ 20. The
from-cf/from-appcommands also need thecfCLI onPATH. Forfrom-app, setSAP_EMAILandSAP_PASSWORDso the tool can authenticate and target the org/space for you.
Updates
Every command first checks npm for a newer @saptools/sqltools (at most once an hour, one small request
with a 2-second timeout) and, when one exists, installs that exact version with the package manager
that owns the running binary and re-runs the command you typed on the new version. Both steps are
announced on stderr; nothing is printed when the install is already current:
sqltools-export: updating 0.2.0 -> 0.3.0 ...
sqltools-export: updated to 0.3.0; re-running the command
If the install cannot complete, one stderr line gives the manual command and the command runs on the
installed version; that version is not retried for a day. sqltools-export self-update forces the check and
install now; sqltools-export self-update --check only reports.
| Control | Effect |
|---|---|
SAPTOOLS_AUTO_UPDATE=on|notify|off | on (default) installs and re-runs; notify prints the manual command once per version; off never checks. Applies to every @saptools CLI. |
SQLTOOLS_AUTO_UPDATE | same values, this CLI only; wins over the global variable |
SAPTOOLS_UPDATE_INTERVAL_MINUTES | minutes between checks (default 60; 0 checks on every run) |
SAPTOOLS_NPM_REGISTRY | registry to check and install from (default: npm's configured registry, then npmjs) |
SAPTOOLS_UPDATE_DEBUG=1 | explain on stderr why nothing happened |
The updater switches itself off in CI (CI set), under NODE_ENV=test or NO_UPDATE_NOTIFIER, when
the binary runs from a source checkout, an npm link or an npx cache, and inside the re-run itself.
It never writes to stdout, never asks for input, never uses sudo, and never moves onto a prerelease.
Its state lives in ~/.saptools/updates/.
🚀 Quick Start
# Already logged in and targeted with `cf login`? One command is enough.
sqltools-export from-cf \
--app my-srv --region eu10 --org my-org --space dev
Result:
✔ Updated SQLTools connections (1) → /workspace/.vscode/settings.json
Credentials JSON saved → /workspace/hana-credentials.json
• my-srv (eu10) host.hana.ondemand.com:443 schema=SCHEMA_MY_SRV
Open the workspace in VS Code, install the SQLTools + SQLTools SAP HANA driver extensions, and the new connection is already wired up.
🧰 CLI
Every command identifies an app with the same four labels — they are written into the SQLTools connection name as "<app> (<region>)".
| Flag | Description | Example |
|---|---|---|
--app <name> | CF app name (also the label) | my-srv |
--region <key> | CF region key | ap10, eu10, us10 |
--org <name> | CF org name | my-org |
--space <name> | CF space name | dev |
Common output options:
| Flag | Description |
|---|---|
--cwd <dir> | Workspace root that owns .vscode/settings.json (default: cwd) |
--merge | Merge with existing connections by name (default: overwrite) |
--credentials-out <path> | Custom path for the backup JSON |
--no-credentials-file | Skip writing hana-credentials.json |
🌐 sqltools-export from-app
Full end-to-end: cf api → cf auth → cf target → cf env → write settings. Great for CI and fresh machines.
export SAP_EMAIL="you@company.com"
export SAP_PASSWORD="your-sap-password"
sqltools-export from-app \
--app my-srv --region eu10 --org my-org --space dev
📡 sqltools-export from-cf
Assumes you are already targeted (cf login && cf target -o ... -s ...). Shells out to cf env <app> and writes the settings.
sqltools-export from-cf --app my-srv --region eu10 --org my-org --space dev
📄 sqltools-export from-file
Already have a VCAP_SERVICES JSON saved somewhere? Point to it.
sqltools-export from-file --input ./vcap.json \
--app my-srv --region eu10 --org my-org --space dev
📥 sqltools-export from-stdin
Classic pipe:
cf env my-srv | jq '."VCAP_SERVICES"' | sqltools-export from-stdin \
--app my-srv --region eu10 --org my-org --space dev
🔁 sqltools-export convert
Print a single SQLTools connection JSON to stdout — no files written. Perfect for scripting.
sqltools-export convert --input ./vcap.json \
--app my-srv --region eu10 --org my-org --space dev
Tip
Use
--mergeto keep hand-crafted connections in.vscode/settings.jsonuntouched while only overwriting the one matching<app> (<region>).
📁 Output Files
After a successful export you get two files in the workspace root:
.vscode/settings.json # SQLTools connections + sqltools.useNodeRuntime
hana-credentials.json # Backup of every extracted binding (HDI user, URL, cert…)
🔬 Shape of the SQLTools connection entry
{
"sqltools.useNodeRuntime": true,
"sqltools.connections": [
{
"name": "my-srv (eu10)",
"driver": "SAPHana",
"server": "host.hana.ondemand.com",
"port": 443,
"username": "USER_1",
"password": "…",
"database": "SCHEMA_MY_SRV",
"connectionTimeout": 30,
"previewLimit": 50,
"hanaOptions": {
"encrypt": true,
"sslValidateCertificate": true,
"sslCryptoProvider": "openssl"
}
}
]
}
Important
Both files contain live HANA credentials. They live inside your workspace, not under
~— keep them out of git (add to.gitignoreif your repo doesn't already excludehana-credentials.json).
❓ FAQ
Do I still need the SQLTools SAP HANA driver extension?
Yes. @saptools/sqltools only writes the connection definition. You still need the SQLTools extension and the SQLTools SAP HANA driver to actually run queries.
Will this overwrite my other connections in settings.json?
By default, yes — sqltools.connections is replaced with the newly-exported entries, while every other key in settings.json is preserved. Pass --merge to keep existing connections whose name does not match <app> (<region>).
Is the backup file safe to commit?
No. hana-credentials.json contains the HANA password, schema, HDI user, and the certificate payload. Add it to .gitignore.
What does the CLI do with SAP_EMAIL / SAP_PASSWORD?
They are only read by from-app. The tool forwards them directly to cf auth — no storage, no logging. from-cf assumes you are already targeted and ignores both env vars.
My binding is not called hana in VCAP_SERVICES. Does this still work?
Not yet. The parser looks for the hana service label (the default for SAP HANA Cloud / HDI service bindings on BTP). If you have a bespoke label, open an issue and we'll add support.
🛠️ Development
From the monorepo root:
pnpm install
pnpm --filter @saptools/sqltools... build
pnpm --filter @saptools/sqltools typecheck
pnpm --filter @saptools/sqltools lint
pnpm --filter @saptools/sqltools test:unit
pnpm --filter @saptools/sqltools test:e2e:fake
pnpm --filter @saptools/sqltools test:e2e:live # needs SAP_EMAIL / SAP_PASSWORD
The live e2e suite auto-discovers a real CF app with a hana service binding by scoring candidates from ~/.saptools/cf-structure.json (populated by cf-sync). To pin a specific target:
export E2E_TARGET="eu10/my-org/my-space/my-srv"
Live e2e only performs read-only CF operations (cf api, cf auth, cf target, cf env) — nothing is created, updated, or deleted in Cloud Foundry.
🌐 Related
- 📦
@saptools/cf-sync— sync the CFregion → org → space → apptree to disk - 🔐
@saptools/cf-xsuaa— fetch XSUAA client credentials and OAuth2 tokens - 🗂️ saptools monorepo — the full toolbox
👨💻 Author
dongtran ✨
📄 License
MIT
Made with ❤️ to make your work life easier!
History
Others providing
Compare all 32 on the Editor support page →- abap-adt-apiabap-adt-apiA JS/TS client for the ADT resources an ABAP system exposes, so a program outside the system can do against it what the maintainer calls a good share of what the Eclipse tools do.independent, abapJS/TS client for the ADT resources of an ABAP systemfrom ABAP
- abap2UI5 Playgroundabap2UI5 PlaygroundABAP in the editor on the left and the abap2UI5 app it builds on the right, both inside one browser tab: the framework is transpiled to JavaScript at build time and the class in the editor is compiled when Run is pressed.community org, abapIn-browser ABAP editor beside the abap2UI5 app it buildsfrom ABAP
- abap2UI5 for VS Codeabap2UI5 for VS CodeA VS Code extension for abap2UI5 apps: F9 starts the app class in a preview beside the source, Ctrl+F3 activates the class and reloads it, and the abap2UI5 linter runs in the editor while you type.community org, abapVS Code extension to preview, activate and lint abap2UI5 appsfrom ABAP
- vscode-tabl-ddicvscode-tabl-ddicA VS Code extension that registers .tabl.ddic files, the DDIC DDL form of an ABAP table definition, as a language of their own with a TextMate grammar for syntax highlighting, and nothing more.community org, abapVS Code syntax highlighting for .tabl.ddic table definitionsfrom ABAP
- HammerHammerA native macOS code editor for ABAP and CDS, with an Object Navigator, Transport Organizer, Data Browser and Gateway Client in the same app as the editor.independent, abapNative macOS code editor for ABAP and CDSfrom ABAP
- cds-eclipse-plugincds-eclipse-pluginEclipse plugin for the CDS language.independent, capEclipse plugin for the CDS languagefrom CAP
- @arc-mcp/adt-ls@arc-mcp/adt-lsA TypeScript SDK over adt-ls, the headless language server SAP ships inside ABAP Development Tools for VS Code, so a program drives it without the discovery, JVM and handshake work.independent, abapTypeScript SDK over SAP's headless adt-ls language serverfrom ABAP
- abapthemesabapthemesThree colour themes for ABAP source in ABAP Development Tools for Eclipse, shipped as an Eclipse plugin and installed from the maintainer's own update site.independent, abapThree colour themes for ABAP source in ADT for Eclipsefrom ABAP
- SAP Build CodeSAP Build CodeSAP's development environment on BTP for SAPUI5, SAP Fiori, mobile and CAP applications that run on the SAP BTP, Cloud Foundry Runtime, in which Joule generates models, services, logic, tests and apps.sap official, btpDevelopment environment on BTP for UI5, Fiori, mobile and CAPfrom BTP/BAIP
- SAP Business Application StudioSAP Business Application StudioSAP's development environment for business applications, delivered as a cloud service and opened in a browser, where work happens in preconfigured dev spaces.sap official, btpBrowser-based development environment with dev spacesfrom BTP/BAIP
- SAP Web IDE Full-StackSAP Web IDE Full-StackSAP's IDE service on BTP for SAPUI5 and SAP Fiori apps, full-stack SaaS applications, SAP S/4HANA extensions, hybrid mobile apps and IoT apps, with an SDK for extending the IDE itself.sap official, btpIDE service on SAP BTP for SAPUI5, Fiori and full-stack appsfrom BTP/BAIP
- cds-intellijcds-intellijSAP CDS language support for IntelliJ IDEA.sap official, capSAP CDS language support for IntelliJ IDEAfrom CAP
- Cloud ALM Link for ADTCloud ALM Link for ADTAn Eclipse plugin that shows the transports and SAP Cloud ALM features behind an ABAP object, and turns Cloud ALM IDs in source comments into links.independent, abapEclipse plugin linking ABAP transports to SAP Cloud ALM featuresfrom ABAP
- ABAP Call HierarchyABAP Call HierarchyAn Eclipse plugin that shows which members a class method, function module or subroutine calls, read from its own ADT backend in the system and published on a beta update site only.independent, abapEclipse plugin showing the call hierarchy of ABAP membersfrom ABAP
- abap-call-hierarchyabap-call-hierarchyThe ADT backend needed by the separate ABAP Call Hierarchy Eclipse plugin, installed in the ABAP system with abapGit and still in beta, which its maintainer calls not feature complete.independent, abapADT backend for the ABAP Call Hierarchy Eclipse pluginfrom ABAP
- abap-tags-backendabap-tags-backendThe ADT backend needed by the separate ABAP Tags Eclipse plugin, installed in the ABAP system with abapGit; an upgrade to v2.0.0 or later runs a migration program for its new database tables.independent, abapADT backend for the ABAP Tags Eclipse pluginfrom ABAP
- ABAP TagsABAP TagsAn Eclipse plugin for putting arbitrary tags on repository objects, with a Tag Manager view, tagged object search and tag import and export, served by its own ADT backend in the system.independent, abapEclipse plugin for tagging ABAP repository objectsfrom ABAP
- BellaBellaAn Eclipse plugin that puts Claude into ABAP Development Tools: explain, generate, rework and implement from the editor's context menu, completion as ghost text, and a chat whose tools reach the system through the developer's existing ADT logon.independent, abapEclipse plugin bringing Claude into ABAP Development Toolsfrom ABAP
- ABAP Syntax HighlightingABAP Syntax HighlightingA VS Code extension that registers .abap files as the language abap and colours them with a TextMate grammar.independent, abapVS Code syntax highlighting for .abap filesfrom ABAP
- abapfs_extensionsabapfs_extensionsABAP imported with abapGit that sets the stateful session flag on systems older than 7.51, so an HTTP client of the ADT resources can update objects there.independent, abapABAP objects enabling ADT updates on systems older than 7.51from ABAP
- ABAP remote filesystemABAP remote filesystemA Visual Studio Code extension that opens an ABAP system over ADT as an editable filesystem and exposes system tools to GitHub Copilot and external MCP clients.independent, abapVS Code extension editing ABAP systems over ADT as a filesystemfrom ABAP
- ABAP Development Tools for EclipseABAP Development Tools for EclipseSAP's Eclipse plugins for ABAP: source, dictionary and CDS editors, Project Explorer, Outline and ABAP Unit, calling ADT resources on the connected system.sap official, abapSAP's Eclipse plugins for ABAP development over ADTfrom ABAP
- ABAP Development Tools for VS CodeABAP Development Tools for VS CodeSAP's ABAP tools in VS Code: editing, debugging, ABAP Unit, ATC and transports for classes, CDS and RAP objects, over RFC to an on-premise or Private Cloud system and HTTP to a cloud one, with Joule's ADT MCP server and code completion behind an AI-unit licence.sap official, abapSAP's ABAP tools in VS Code for editing, debugging, ATC and transportsfrom ABAP
- @sap/cds-lsp@sap/cds-lspLanguage server for CDS — the engine behind completion, navigation and inline errors in every supported editor.sap official, capLanguage server for CDSfrom CAP
- cds-textmate-grammarcds-textmate-grammarThe TextMate grammar for the CDS language, which highlights .cds files where the CDS language server does not run, most visibly in GitHub's own file viewer through Linguist.sap official, capTextMate grammar for the CDS languagefrom CAP
- @sap/ux-cds-odata-language-server-extension@sap/ux-cds-odata-language-server-extensionAdds the OData annotation features to @sap/vscode-cds, the CDS plug-in for Visual Studio Code: completion, micro-snippets, diagnostics, vocabulary documentation, Go to Definition and an i18n check inside a .cds file.sap official, capOData annotation features for the @sap/vscode-cds extensionfrom CAP
- @sap/vscode-cds@sap/vscode-cdsSAP CDS language support for Visual Studio Code and Business Application Studio, published as an npm library.sap official, capCDS language support for VS Code and Business Application Studiofrom CAP
- vscode-ui5-language-assistantvscode-ui5-language-assistantSAP's VS Code extension for SAPUI5 and OpenUI5: completion, validation, hover tooltips, go to definition, quick fix and formatting for XML views, and completion and validation for manifest.json.sap official, ui5VS Code extension for SAPUI5 and OpenUI5 XML views and manifestfrom UI5
- @saptools/hana-lens@saptools/hana-lensCompiles every CAP package in a workspace into one minified CSN cache, so "where is this entity and what columns does it have" is a query rather than a monorepo load.independent, capWorkspace-wide CSN cache for querying CAP entities and columnsfrom CAP
- zed-cds-extensionzed-cds-extensionCDS language support for the Zed editor, wiring the CDS language server into it.independent, capCDS language support for the Zed editorfrom CAP
- my-ide-actionsmy-ide-actionsA collection of eight ABAP Development Tools IDE Actions covering class creation, conversion of classic Open SQL to ABAP SQL, code snippets and RAP tooling.independent, abapCollection of ABAP Development Tools IDE Actionsfrom ABAP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:saptools-sqltools- JSON
- /artifacts/saptools-sqltools.json
- MCP
- Connecting an agent