sql-autocomplete is a library for generating autocomplete suggestions for SQL statements across multiple dialects, including PostgreSQL, MySQL, SQL Server (T-SQL), and Oracle (PL/SQL). Current stable version is 1.1.1. It supports both browser and Node.js environments, ships TypeScript type definitions, and is maintained by modelDBA. Key differentiator: it provides dialect-specific keyword completion and context-aware table/column suggestions given optional schema input.
npm install sql-autocompleteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a SQLAutocomplete instance with PostgreSQL dialect, tables, and columns, then retrieves autocomplete suggestions for a partial SQL query.
Ensure second and third constructor arguments are arrays of strings.
Select the appropriate SQLDialect enum for your target database.
Pass the known schema elements as constructor arguments or use an external schema retrieval tool.
Use import { SQLAutocomplete } from 'sql-autocomplete' instead of import SQLAutocomplete from 'sql-autocomplete'.Use 'new SQLAutocomplete(...)' to instantiate.
Run 'npm install sql-autocomplete' and ensure import path is correct.
Create an instance first: const ac = new SQLAutocomplete(...); ac.autocomplete(...);
No dependency data recorded yet.