Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/modeldba/sql-autocomplete
Autocomplete recommendations for SQL statements
https://github.com/modeldba/sql-autocomplete
autocomplete autocompletion mssql mysql plpgsql plsql sql sql-autocomplete tsql
Last synced: 3 months ago
JSON representation
Autocomplete recommendations for SQL statements
- Host: GitHub
- URL: https://github.com/modeldba/sql-autocomplete
- Owner: modeldba
- License: mit
- Created: 2020-10-06T21:58:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-01T22:32:56.000Z (almost 4 years ago)
- Last Synced: 2024-09-28T18:23:25.086Z (3 months ago)
- Topics: autocomplete, autocompletion, mssql, mysql, plpgsql, plsql, sql, sql-autocomplete, tsql
- Language: TypeScript
- Homepage: https://modeldba.com/sql-autocomplete/
- Size: 212 KB
- Stars: 60
- Watchers: 2
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sql-autocomplete
Generate valid autocomplete suggestions for keywords, tables, or columns.
Supports MySQL, T-SQL (SQL Server), PL/pgSQL (PostgreSQL) and PL/SQL (Oracle) dialects.
## Install
```shell
npm install sql-autocomplete
```## [Full documentation can be found here](https://modeldba.com/sql-autocomplete/docs/)
## Get Started
```typescript
import { SQLAutocomplete, SQLDialect } from 'sql-autocomplete';const sqlAutocomplete = new SQLAutocomplete(SQLDialect.MYSQL,
['myDatabaseTableName'], // Optional
['aColumnName']); // Optional
const sql1 = 'SELECT * FR';
const options1 = sqlAutocomplete.autocomplete(sql1);
console.dir(options1);// [ AutocompleteOption { value: 'FROM', optionType: 'KEYWORD' } ]
const sql2 = 'SELECT * FROM myDatab';
const options2 = sqlAutocomplete.autocomplete(sql2);
console.dir(options2);// [ AutocompleteOption { value: 'myDatabaseTableName', optionType: 'TABLE' } ]
```## Created By
[![modelDBA logo](https://modeldba.com/sql-autocomplete/modelDBA128x128.png "modelDBA")](https://modeldba.com)
sql-autocomplete is a project created and maintained by [modelDBA](https://modeldba.com), a database IDE for modern developers.
modelDBA lets you visualize SQL as you type and edit tables easily with a no-code table editor.