Skip to content

MySQL column autocomplete is not suggesting table columns #1

Description

@x0Mazen
Image

Hi, first of all, I really like GoTermSQL! The interface and overall experience are great, and I especially like the schema browser. However, I noticed an issue with the autocomplete when using MySQL

GoTermSQL correctly loads my database schema and knows the columns of my Employee table:

EmployeeID
BranchID
FirstName
LastName

However, when I type:

SELECT * FROM Employee WHERE First

the autocomplete suggests:

FIRST_VALUE function

instead of:

FirstName column

Similarly, when I type WHERE F, I get generic SQL functions such as:

FLOOR
FIRST_VALUE
NULLIF

but FirstName is not suggested, even though GoTermSQL has already loaded the table schema.

The table itself is:

CREATE TABLE Employee (
EmployeeID INT PRIMARY KEY,
BranchID INT,
FirstName VARCHAR(100),
LastName VARCHAR(100)
);

The table can be completely empty; the issue still occurs. SHOW TABLES and DESCRIBE Employee work correctly, and the schema browser displays the database/table information correctly.

Expected behavior

I would expect:

SELECT * FROM Employee WHERE First

to suggest:

FirstName column

Ideally, column suggestions should be prioritised over generic SQL functions when the current SQL context indicates that a column is expected.

For example:

SELECT * FROM Employee WHERE Last

should suggest LastName, and:

SELECT * FROM Employee WHERE Employee

should suggest EmployeeID.

It would also be great if aliases were handled contextually, for example:

SELECT e.
FROM Employee e

should suggest the columns belonging to Employee.

I believe the schema introspection is working correctly, but the schema columns don't seem to be properly integrated into or prioritised by the autocomplete engine.

Thanks for the great project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions