- Easily extendable for different SQL dialects (PostgreSQL/MySQL/MS-SQL/SQLLite)
- Completion should always work, also with invalid/incomplete SQL
- Use sqlparse and prompt_toolkit as much as possible, don't try to abstract either
- Prioritize suggestions, the top suggestions always should complete to valid SQL. Tab-tab-tab-tab should complete to something like select * from firsttable
SQLComplete will provide an implementation of prompt_toolkit.completion.Completer. For this completer specific SQL completers can be registered (like SelectComplete, InsertComplete, UpdateComplete etc). These SQL completers can make use of each other (for queries like INSERT INTO table SELECT * FROM table). SQLComplete also provides partial completers like WhereComplete for completing for example the WHERE part of a SQL query.
The purpose of these completers is to return prioritized completions which would pull the current query to valid SQL. For example: SelectComplete would suggest table names for the following query SELECT | FROM table (| = cursor). Or more complex, SelectComplete would suggest WHERE for SELECT abc FROM table | SELECT.
To make SQL specific dialect changes these SQL completers should be subclassed.