Documentation / Standalone DAP server

Editor-independent core

A PL/pgSQL debugger that speaks standard DAP over stdio.

The TypeScript debug adapter is separate from the VS Code user interface. Any editor or client capable of launching a stdio Debug Adapter Protocol server can integrate it.

DAP client
VS Code · Neovim · Emacs
stdio
PostgreSQL Workbench DAP
SQL
PostgreSQL
pldbgapi

Current distribution

The standalone server is built from this repository and bundled into the VS Code extension. A separate package is planned, but is not published yet. Until then, build and run the repository version:

npm install
npm run build:dap
npm start

Launch contract

The client sends an ordinary DAP launch request containing PostgreSQL connection information and either a replayable SQL call or a structured target. The adapter resolves the routine, creates the pldbgapi listener, runs target SQL on a second connection, and reports standard stack, scope, variable, breakpoint, output, and termination events.

{
  "type": "postgresql-workbench",
  "request": "launch",
  "name": "Debug shop.place_order",
  "host": "127.0.0.1",
  "port": 5432,
  "database": "demo",
  "user": "postgres",
  "password": "...",
  "sql": "SELECT shop.place_order(1, 2, 1)",
  "stopOnEntry": true
}

The standalone protocol needs connection credentials from its DAP client. The VS Code extension instead resolves saved servers and keeps passwords in SecretStorage.

Capabilities

For client implementers

The ordering constraints matter: the adapter emits initialized during Initialize, answers Launch before waiting for the PostgreSQL target, retains breakpoints received before listener creation, and waits for the target during Configuration Done. Clients should follow the standard DAP configuration sequence.

The DAP source and protocol integration tests are the current executable contract.