Registry / devops / coc-sqlfluff

coc-sqlfluff

JSON →
library0.11.4jsnpmunverified

A coc.nvim extension that integrates SQLFluff, a SQL linter and auto-formatter for humans, into NeoVim/Vim. Version 0.11.4 provides linting, formatting (including format command for SQLFluff v2+), code actions, and a built-in installer that creates an extension-only venv. It supports multiple SQL dialects (ansi, bigquery, postgres, etc.) and respects SQLFluff configuration files (setup.cfg, .sqlfluff, pyproject.toml). Actively maintained, it is the go-to choice for NeoVim users needing SQL linting/formatting inside coc.nvim.

npm install coc-sqlfluff
INSTALL
IMPORT
SIG · COC-SQLFLUFF
C
coc-sqlfluff
devopsjavascriptv0.11.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Activate extension
:CocInstall coc-sqlfluff
Installing via npm directly without coc.nvim
Must be installed via CocInstall or vim-plug; not a regular npm package.
Install sqlfluff
:CocCommand sqlfluff.install
Manually pip installing sqlfluff globally
Uses built-in venv; ensures correct version compatibility.
Format file
:CocCommand sqlfluff.format
Using :CocCommand sqlfluff.fix for formatting
format command available since SQLFluff v2.0.0; fix is a separate command.

Installs coc-sqlfluff, sets a dialect, and maps code action/format keys.

" In init.vim or init.lua " Install coc-sqlfluff inside coc.nvim :CocInstall coc-sqlfluff " If sqlfluff not detected, run built-in install :CocCommand sqlfluff.install " Lint on save (default is true) " Customize dialect (default: ansi) let g:coc_user_config = { \ 'sqlfluff.dialect': 'postgres' \ } " Example keymaps nmap <silent> ga <Plug>(coc-codeaction-line) nmap <silent> <leader>f <Plug>(coc-format) " For SQL files, use :CocCommand sqlfluff.format to format " Or use :CocCommand sqlfluff.fix to apply fixes " Tip: Use :CocConfig to set additional options
Debug
Known issues
gotchaRequires coc.nvim v0.0.80+; older versions may not work
fix
Update coc.nvim to >=0.0.80
affects: <0.11.0
gotchaCommand 'sqlfluff.format' only works with SQLFluff v2.0.0+; on older versions use 'sqlfluff.fix'
fix
Ensure SQLFluff version >=2.0.0 or use :CocCommand sqlfluff.fix
affects: >=0.11.0
gotchaBuilt-in installer may fail if Python 3 is not found; set 'sqlfluff.builtin.pythonPath' to absolute path
fix
Configure 'sqlfluff.builtin.pythonPath' in CocConfig
affects: >=0.11.0
gotchaConfiguration file precedence: setup.cfg > tox.ini > pep8.ini > .sqlfluff > pyproject.toml; later files override earlier ones
fix
Place .sqlfluff at project root for custom rules
affects: >=0.1.0
Errors
Common errors & fixes
E492: Not an editor command: CocInstall coc-sqlfluff
CocInstall command used outside coc.nvim environment
fix
Install coc.nvim first, then run :CocInstall inside a Vim/Neovim instance
sqlfluff: command not found
sqlfluff not installed or not in PATH
fix
Run :CocCommand sqlfluff.install to install via built-in venv, or install sqlfluff manually and set 'sqlfluff.commandPath'
ModuleNotFoundError: No module named 'sqlfluff'
SQLFluff not installed in the expected Python environment
fix
Use built-in installer via :CocCommand sqlfluff.install or ensure system Python has sqlfluff
Upgrade
Version history
0.11.4latest on npm
Audit
Dependencies
coc.nvimrequiredRuntime dependency; coc-sqlfluff runs as a coc extension
sqlfluffoptionalPython package for SQL linting/formatting; managed via built-in venv or system PATH
Agent activity
2 hits · last 30 days
node
2
Resources
coc-sqlfluff — npm install coc-sqlfluff · libregistry