Search

Search IconIcon to open search

Query databases in Neovim (DBUI)

Last updatedUpdated: by Simon Späti · CreatedCreated:

General:
asciicast

# Features

# Supported DBs

As of 2025-02-23, supports a modern array of backends, including NoSQL databases:
- Big Query
- ClickHouse: clickhouse://[<host>[:port]]/[<database>]
- Details see
- DuckDB: duckdb:/Users/sspaeti/Documents/duckdbs/playground-v1-1-1.duckdb
- Impala
- jq
- MongoDB
- MySQL
- MariaDB
- Oracle
- osquery
- PostgreSQL: postgresql:///foobar
- Presto
- Redis
- Snowflake
- SQL Server
- SQLite: sqlite:myfile.sqlite3 select count(*) from widgets
- Your own easily implemented adapter

  • Easily configurable based on a project directory (as seen in rails.vim, for example), rather than just globally or in a per-file modeline
  • For those that just can’t live without some piece of dbext functionality, the option g:dadbod_manage_dbext is provided to force dbext to use Dadbod’s default database.

# Connect Databases

# DuckDB

1
duckdb:/Users/sspaeti/Documents/duckdbs/playground-v1-1-1.duckdb

My configs in database.lua:

1
2
3
4
5
      vim.g.dbs = {
        local_postgres_sspaeti = 'postgres://postgres@localhost:5432/sspaeti',
        duckdb_memory = 'duckdb:',
        duckdb_file = 'duckdb:///tmp/analytics.duckdb',
      }

In Action:
asciicast

# ClickHouse and encode password

If passwords contain speecial characters such as @ you need to encode it for it to work.

Connection string format:
clickhouse://user:password@host/database?secure

Example - for specific database
clickhouse://default:mypass@myhost.us-east-1.aws.clickhouse.cloud/staging?secure

Example - for all databases
clickhouse://default:mypass@myhost.us-east-1.aws.clickhouse.cloud?secure

  • ?secure is required for ClickHouse Cloud (maps to --secure on the CLI)
  • Requires clickhouse-client (or clickhouse client) installed locally
  • If passwords contain special characters like @, you need to URL-encode them:
Character Encoded
@ %40
# %23
? %3F
/ %2F
% %25

Quick way to get the encoded password:

1
python3 -c "import urllib.parse; print(urllib.parse.quote('YOUR_RAW_PASSWORD', safe=''))"

# Setup

# Alternatives

# Futher Reads


Origin:
References: SQL IDEs