Autocomplete functions in the Fuzzycomplete DuckDB extension
Function category
Autocomplete
1 functionInspect what the fuzzy completer would suggest for a given partial query. Once the extension is loaded the DuckDB CLI uses this internally for Tab-completion — the function exists mainly for testing and for scripts that want to surface suggestions programmatically.
Signature
sql_auto_complete(query: VARCHAR) →
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
query
|
Type
VARCHAR
|
Mode Positional | Description The partial SQL text the user has typed. Suggestions are ranked by fuzzy match score against keywords and identifiers (databases, schemas, tables, columns) currently visible to the session. |
Description
Return ranked autocomplete suggestions for a partial SQL string using the VS-Code-derived fuzzy matcher. Loaded by the DuckDB CLI to power Tab-completion; you can also call it directly in SQL to inspect what the completer would suggest. Replaces the function of the same name from the built-in autocomplete extension when this extension is loaded.
1
Complete a SQL keyword — the top suggestion for `SEL` is `SELECT`.
SELECT trim(suggestion) AS suggestion
FROM sql_auto_complete('SEL')
LIMIT 3;
2
Suggest a table name after `FROM` — the completer walks every attached database and schema in the search path.
SELECT suggestion
FROM sql_auto_complete('SELECT * FROM tables')
LIMIT 1;
3
Substring + camelCase matching — typing `gnst` finds `getNotificationStatus` even though it isn't a prefix.
SELECT suggestion
FROM sql_auto_complete('SELECT * FROM gnst');