@quangphuc/sql-language-service
v3.0.10
Published
Framework-neutral SQL language service (validation, completion, formatting), built with antlr4
Maintainers
Readme
@quangphuc/sql-language-service
Framework-neutral SQL language service (validation, completion, formatting) for the Dashmax SQL dialect, built with antlr4ng.
Ranges are offset based ({ start, end }, end exclusive); consumers map them
onto their editor's own representation.
import { makeSQLLanguageService } from "@quangphuc/sql-language-service";
const svc = makeSQLLanguageService();
svc.validate("select 1 +"); // → Diagnostic[]
svc.getLinksList("select * from t"); // → table / bind-value links
svc.format("select a,b from t"); // → TextEdit[] (in-house formatter)Formatting is handled by an in-house token-stream formatter built on this
package's own lexer, so custom syntax — {{dxq:...}} embedded queries and
@name / $name bind values — is preserved verbatim. There is no longer a
runtime dependency on @sqltools/formatter, so no Vite optimizeDeps workaround
is required.
