Skip to content

Fuzzycomplete

Better SQL autocomplete for the DuckDB CLI.

41,436
extension loads · last 90 days
On this page

Technical Overview

Tab-completion that matches the way VS Code does

What this extension is for

  • Smarter keyword & identifier completion: Suggests SQL keywords and identifiers (databases, schemas, tables, columns) ranked by fuzzy score instead of edit distance. Typing usrs finds users; typing gnst finds getNotificationStatus.
  • Cross-database, cross-schema: Suggestions span every ATTACH-ed database and every schema on the search path, with the right qualifier prepended automatically — useful in multi-database sessions.
  • Drop-in replacement: Implements the same sql_auto_complete table function as the built-in autocomplete extension, so the CLI picks it up without any configuration change.
  • Zero SQL surface to learn: There's nothing to call from queries. Install, load, hit Tab. Inspect the ranked suggestions with sql_auto_complete only if you want to.

How the matcher works

  • Ordered subsequence matching: Every character of your query must appear in the candidate, in order — usr matches both users and user_settings, but not setUR.
  • Word-boundary bonuses: Characters following a separator (_, .) or at a camelCase word start score higher — gNS cleanly hits getNotificationStatus.
  • Sequential-run bonuses: Contiguous matches outscore scattered ones, so users beats u_e_r_s for the query usr.
  • Tie-breakers favour shorter, lexical: On equal fuzzy score, shorter candidates rank first; ties beyond that are broken lexicographically — so the obvious answer wins.

Scope & caveats

  • DuckDB CLI only: Tab-completion is a feature of the DuckDB CLI's line editor. Loading this extension from the Python / Node / JDBC / ODBC / Rust / WASM clients has no effect on those clients' input — they don't have a CLI line editor to plug into.
  • Conflicts with the built-in autocomplete: Fuzzycomplete and the built-in autocomplete both register a sql_auto_complete table function. The last one loaded wins — so load fuzzycomplete after any session start-up that auto-loads autocomplete.
  • Suggestions reflect the live catalog: Identifiers come from whatever databases and schemas are currently visible. Newly ATTACH-ed catalogs become available immediately; nothing needs to be reindexed.
  • Algorithm choice is a matter of taste: Edit-distance (the default) and fuzzy matching favour different mistakes. If you mostly fix typos, the default may suit you better; if you mostly type partial names, fuzzy matching usually wins.

When you'll feel the difference

Deep Dive

Technical Details

Install

INSTALL fuzzycomplete FROM community;
LOAD fuzzycomplete;

Reference

Extension Contents

Quick reference to all available functions and settings organized by category.

Name Description
Autocomplete
sql_auto_complete() Return ranked autocomplete suggestions for a partial SQL string using the VS-Code-derived fuzzy matcher.

API Reference

Function Documentation

Practical Examples

Cookbook

Real-world recipes and patterns for common use cases.

Platform Support

Compatibility

Extension availability may vary by platform and DuckDB version. Check below to ensure this extension supports your environment before installation.

Quick Facts

Release status Stable
Software License MIT
Pricing Free
Written In Rust
Source Available Yes
View on GitHub
Usage
41,436
loads · last 90 days

Platforms

  • Linux x86_64 aarch64
  • Linux (musl) Not available
  • macOS Intel Apple Silicon
  • Windows x86_64
  • WASM Not available
Compiled binary sizes
Platform Architecture Size
Linux x86_64 4.14 MB
Linux aarch64 3.75 MB
macOS Intel 1.64 MB
macOS Apple Silicon 1.49 MB
Windows x86_64 7.45 MB

Compressed download size from the Haybarn extension repository.

DuckDB & Haybarn

Release calendar