Skip to content

Conversation

shueybubbles
Copy link
Collaborator

Fixes #31
Bonus feature - tab completion of SQL keywords!
Unfortunately, the keyword list is hard coded based on recent sqlparser updates, as I know of no way to discover a keyword list from SQL itself.
There are other console input modules in the Golang universe but this one appears to be maintained and not-too-complicated.

@shueybubbles
Copy link
Collaborator Author

There are some full-fledged SQL intellisense-like modules available that we could attempt to use to provide a richer completiion experience, including syntax/DDL aware completions of objects like table and column names. I would defer attempting such integrations until we have our core needs addressed. I think our early adopters are more interested in CI/CD pipeline integration than interactive niceties.

return b.String()
}

var keywords = []string{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we could enable users to override the keyword list with their own file. We could also add auto complete for commands.

Copy link
Contributor

@dzsquared dzsquared Mar 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a common format for keywords is the plist file - would be interesting for them to be imported from there - both for our own reuse of work for VS Code as well as for users to import their own.
our prior work for VS Code: https://github.com/microsoft/vscode-mssql/blob/main/syntaxes/SQL.plist

@shueybubbles shueybubbles merged commit 71d3253 into main Mar 14, 2022
@shueybubbles shueybubbles deleted the shueybubbles/newconsole branch March 14, 2022 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasting T/SQL into interactive console is very slow (and omits characters sometimes)
2 participants