You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Please add .commands support for DuckDB dialect #939
This is currently in similar vein to how \commands in PostgreSQL are not supported. And I guess there are other dialects with similar special command-line commands.
Looks like this page documents the DuckDB syntax for these commands.
Because DuckDB commands begin with a . it's particularly tricky to support because . is already a special symbol in SQL. Even . at the beginning of a line is perfectly valid SQL. So I need to somehow understand when dot at the beginning of a line is inside an SQL expression, like:
SELECT tbl
.help
FROM tbl;
Versus when it's not inside an SQL expression:
SELECT tbl;
.help
Ideally I'd like to distinguish this at the Lexer level, but because of the above, that's not possible. So I would need to do this inside the parser, but until now the parser has been completely dialect-agnostic. I'm not really keen to add such a conditional logic (if DuckDB, parse it differently) in there.
Hmm... possibly I can do a separate pass over the tokens (like I already do for some dialects) to distinguish between the different uses of . before passing it to parser.
In any case, solving the \command problem in PostgreSQL is currently with a higher priority.
Activity
nene commentedon Apr 11, 2026
This is currently in similar vein to how \commands in PostgreSQL are not supported. And I guess there are other dialects with similar special command-line commands.
Looks like this page documents the DuckDB syntax for these commands.
Because DuckDB commands begin with a
.it's particularly tricky to support because.is already a special symbol in SQL. Even.at the beginning of a line is perfectly valid SQL. So I need to somehow understand when dot at the beginning of a line is inside an SQL expression, like:Versus when it's not inside an SQL expression:
SELECT tbl; .helpIdeally I'd like to distinguish this at the Lexer level, but because of the above, that's not possible. So I would need to do this inside the parser, but until now the parser has been completely dialect-agnostic. I'm not really keen to add such a conditional logic (if DuckDB, parse it differently) in there.
Hmm... possibly I can do a separate pass over the tokens (like I already do for some dialects) to distinguish between the different uses of
.before passing it to parser.In any case, solving the
\commandproblem in PostgreSQL is currently with a higher priority.pavlokurochka commentedon Apr 27, 2026
So far figured out a workaround - I wrap .commands in comments like this: