mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.49k stars 299 forks source link

Table Completions not returning all tables #1118

Open TylerR909 opened 1 year ago

TylerR909 commented 1 year ago

Describe the bug

We evidently have 253 tables but when I type SELECT * FROM, Intellisense is only offering me some of my tables. Per Output debug I can see:

[1678406221628] INFO  (ext): EXECUTING COMMAND => sqltools.getConnections
[1678406221629] INFO  (ls): REQUEST RECEIVED => connection/GetConnectionsRequest
[1678406225456] INFO  (ls): completion requested {"line":1,"character":15}
    ns: "intellisense"
[1678406225464] INFO  (ls): got got %d db completions
    ns: "intellisense"
[1678406225500] INFO  (ls): got 100 table completions
    ns: "intellisense"

If I type out a table that won't show up in Intellisense, and then continue on to fill out WHERE or SELECT then intellisense does give me proper column intellisense.

To Reproduce Steps to reproduce the behavior:

  1. Make a couple hundred tables
  2. Type SELECT * FROM and prompt Intellisense to suggest a table
  3. Not all the tables are there
    1. Results appear to be alpha sorted

Expected behavior All my tables appear in Intellisense

Desktop (please complete the following information):

Additional context

I've tried setting "sqltools.results.limit": 200, but no joy

TylerR909 commented 8 months ago

Almost a year later. I just retried with CockroachDB and the Postgres drivers and it still can't intellisense anything past the first 100 tables. I use intellisense to explore and branch out to see what my options are. This is unusable with a limit that low. We're up to 319 tables now describing various entities, many-to-many relationships, Enumeration tables, etc. The inability to see past "E" in an alpha-sorted table intellisense is pretty rough.

gjsjohnmurray commented 8 months ago

If you type an initial letter (e.g. T) before invoking Intellisense do you get shown up to 100 choices beginning with that letter?

TylerR909 commented 8 months ago

Nope. I have a table called projects which alphasorted clocks in at 225.

SELECT * from p does not offer that table up. It's suggesting tables with p in the name, like activity_type, but it's acting like it loaded the first 100 tables, cached those, and now Intellisense is only searching those cached tables. I have 31 other tables that look like project_status or project_team_member etc and none of them are suggested.

Felipe-53 commented 3 months ago

+1, I can confirm this happens. In my case, with MySQL. It only suggests a few of the tables. Plus, as described in other issues such as this one https://github.com/mtxr/vscode-sqltools/issues/1065 it also fetches tables from all of the databases of the connection, not just from the database selected.