# Database Types That Support Direct Execution Without DBX Desktop

> Discover database types like PostgreSQL MySQL and SQLite that support direct DBX execution without the Desktop app. Connect directly via CLI.

- Repository: [skyler/dbx](https://github.com/t8y2/dbx)
- Tags: how-to-guide
- Published: 2026-07-10

---

**DBX supports direct execution for PostgreSQL (including Amazon Redshift), MySQL-compatible databases (MySQL, Doris, StarRocks), and SQLite, allowing the CLI to connect directly without opening the Desktop application.**

The DBX CLI can execute queries against specific database families by embedding native client libraries directly within the `@dbx-app/node-core` package. Understanding which database types support direct execution without DBX Desktop helps developers run automated scripts and CI/CD pipelines without requiring the graphical interface.

## Supported Database Families for Direct Execution

DBX categorizes database drivers into two groups: **direct-execution** drivers bundled in the Node Core package and **bridge-required** drivers that depend on the DBX Desktop bridge. Only three database families currently support direct execution.

### PostgreSQL and Amazon Redshift

The `pg` driver provides native PostgreSQL connectivity. This implementation supports standard PostgreSQL instances as well as Amazon Redshift clusters, which use the PostgreSQL wire protocol.

### MySQL-Compatible Databases (MySQL, Doris, StarRocks)

The `mysql2` driver handles MySQL-compatible connections. According to the source documentation in [`skills/dbx/SKILL.md`](https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.md) (lines 31-34), this single driver covers MySQL, Apache Doris, and StarRocks because they share protocol compatibility.

### SQLite

DBX utilizes `better-sqlite3` for SQLite databases. This native driver opens local database files directly without requiring a TCP connection or external bridge process.

## How Direct Execution Works

When you issue a `dbx query` or `dbx context` command for a supported connection, the CLI loads the appropriate driver from `@dbx-app/node-core` and establishes a TCP connection directly to the database server. No inter-process communication occurs with the Desktop bridge, allowing commands to succeed even when the Desktop app is not running.

For unsupported database types—such as Oracle, GaussDB, or MongoDB—the CLI falls back to the bridge architecture, forwarding requests to the Desktop background service.

## Running Queries Without the Desktop Bridge

You can execute SQL directly against supported databases by referencing a saved connection via the `DBX_CONNECTION` environment variable:

```bash

# PostgreSQL – direct query

DBX_CONNECTION=pg_demo dbx query "SELECT version();" --json

# MySQL – direct query

DBX_CONNECTION=mysql_demo dbx query "SELECT NOW();" --json

# SQLite – direct query

DBX_CONNECTION=sqlite_demo dbx query "SELECT sqlite_version();" --json

```

The `--json` flag returns machine-readable output suitable for downstream tooling. The connection name references profiles stored in DBX Desktop, but the execution occurs entirely within the CLI process for supported drivers.

## Architecture and Source Files

The direct-execution capability is implemented across several key files in the `t8y2/dbx` repository:

- **[`skills/dbx/SKILL.md`](https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.md)** (lines 31-34) — Documents the direct-versus-bridge execution policy and enumerates the supported database families.
- **[`packages/cli/README.md`](https://github.com/t8y2/dbx/blob/main/packages/cli/README.md)** (lines 85-94) — Lists which CLI commands run without Desktop and repeats the direct-execution compatibility matrix.
- **[`packages/node-core/src/drivers/postgres.ts`](https://github.com/t8y2/dbx/blob/main/packages/node-core/src/drivers/postgres.ts)** — Implements the native PostgreSQL client using the `pg` library.
- **[`packages/node-core/src/drivers/mysql.ts`](https://github.com/t8y2/dbx/blob/main/packages/node-core/src/drivers/mysql.ts)** — Implements the MySQL-compatible driver covering MySQL, Doris, and StarRocks.
- **[`packages/node-core/src/drivers/sqlite.ts`](https://github.com/t8y2/dbx/blob/main/packages/node-core/src/drivers/sqlite.ts)** — Implements the SQLite driver wrapper around `better-sqlite3`.

## Summary

- **PostgreSQL, MySQL-compatible databases (Doris, StarRocks), and SQLite** support direct execution without DBX Desktop.
- Direct-execution drivers reside in the `@dbx-app/node-core` package and embed native client libraries.
- **Oracle, GaussDB, MongoDB, and other database types** require the DBX Desktop bridge.
- The CLI automatically selects direct execution when the connection type matches a supported family, falling back to the bridge for all others.

## Frequently Asked Questions

### Which databases can I query without opening DBX Desktop?

You can query **PostgreSQL** (including Amazon Redshift), **MySQL-compatible databases** such as MySQL, Doris, and StarRocks, and **SQLite** without opening DBX Desktop. These three families bundle native drivers in the `@dbx-app/node-core` package, allowing the CLI to connect directly to the database process.

### How do I know if my connection uses direct execution or the bridge?

The CLI determines execution mode based on the connection's driver type as defined in [`skills/dbx/SKILL.md`](https://github.com/t8y2/dbx/blob/main/skills/dbx/SKILL.md). If your database family appears in the direct-execution list, the CLI opens a native TCP connection via the drivers in `packages/node-core/src/drivers/`. All other database types automatically trigger the Desktop bridge fallback.

### Can I use Oracle or MongoDB without the DBX Desktop bridge?

No. According to the documentation in [`packages/cli/README.md`](https://github.com/t8y2/dbx/blob/main/packages/cli/README.md) (lines 85-94), Oracle, GaussDB, MongoDB, and all other database types outside the three supported families require the DBX Desktop bridge. The CLI cannot establish direct connections to these databases without the Desktop background service running.

### Where does the CLI store the direct-execution driver logic?

The driver implementations reside in the **`packages/node-core/src/drivers/`** directory. Specific files include [`postgres.ts`](https://github.com/t8y2/dbx/blob/main/postgres.ts) for PostgreSQL, [`mysql.ts`](https://github.com/t8y2/dbx/blob/main/mysql.ts) for MySQL-compatible systems, and [`sqlite.ts`](https://github.com/t8y2/dbx/blob/main/sqlite.ts) for SQLite. These modules import native libraries like `pg`, `mysql2`, and `better-sqlite3` to handle database communication without bridge overhead.