Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to achieve sql column name auto completion? #6

Open
melin opened this issue Aug 23, 2022 · 2 comments
Open

How to achieve sql column name auto completion? #6

melin opened this issue Aug 23, 2022 · 2 comments

Comments

@melin
Copy link

melin commented Aug 23, 2022

example: select na from tb1 a left join tb2 b a.code=b.code。
Enter na, how to get the table name: tb1 and tb2, more complex sql, may contain nesting, how to get the corresponding table name, query field information through the table name.

@mtriff The project does not fully implement the modelDBA sqleditor code complete feature.

@mtriff
Copy link
Collaborator

mtriff commented Aug 23, 2022

That's right, there's a lot of database structure information that modelDBA uses to better provide suggestions. That is outside of the scope of this package. The best you can do with this package is provide the table names and column names during instantiation like so:

const sqlAutocomplete = new SQLAutocomplete(SQLDialect.MYSQL,
                                            ['myDatabaseTableName'], // Optional
                                            ['aColumnName']);        // Optional

However, this package can't narrow down suggestions based on which columns belong to which table.

@melin
Copy link
Author

melin commented Aug 24, 2022

However, this package can't narrow down suggestions based on which columns belong to which table.

modeldba editor supports table alias filter column name,are there plans to enhance this feature?

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

No branches or pull requests

2 participants