Skip to content

Add autocompletion capabilities to the kernel #5

@robertbindar

Description

@robertbindar

As part of the Jupyter Messaging protocol, the Jupyter frontend sends a complete_request message to the MariaDB kernel when the user invokes the code completer in a Jupyter notebook.

This message is handled in the do_complete function from the MariaDBKernel class.
In simpler words, whenever the user hits the key shortcut for code autocompletion in a notebook, the MariaDB kernel's do_complete function is called with a number of arguments that help the kernel understand what the user wants to autocomplete.

So the autocompletion infrastructure in the MariaDB kernel is already kindly provided by Jupyter, we only need to send back to Jupyter a list of suggestions based on the arguments that do_complete receives :-).

Ideally we should aim to enable at least database, table and column name completion and also SQL keyword completion.

We should try to not reinvent the wheel here and see if there are some tools around to help us provide this feature with less development effort.
The MariaDB command-line client already has some autocompletion capability, we should first consider using that if possible. Also mycli has some nice autocompletion and their Python API seems quite nice, it is a good candidate as well. If no existing tools can help, we can consider implementing this from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions