sqls icon indicating copy to clipboard operation
sqls copied to clipboard

completion support for non default schema

Open aokiji opened this issue 1 year ago • 7 comments

As seen in https://github.com/sqls-server/sqls/issues/99 and https://github.com/sqls-server/sqls/issues/121 there is lack of support for completion when working with other schemas/databases other than the default schema/database. So this in the initial effort to fix this issue bringing support for:

  • table completion when given the schema
  • table description for table in any schema
  • column completion when given table in any schema
  • column completion for tables in any schema referenced in the join clause

Test were added so that the new features/changes are covered

aokiji avatar Apr 06 '24 10:04 aokiji

Looks good.

mattn avatar Apr 14 '24 17:04 mattn

Any updates on this? I'd like to use it awesome feature.

v2okimochi avatar Sep 05 '24 12:09 v2okimochi

Hello. Tried to build from [aokiji:feature/add-non-default-schema-support] branch, and completion for non-default schemas still not works (ಥ_ಥ)

BotNikos avatar Jan 23 '25 07:01 BotNikos

Hello. Tried to build from [aokiji:feature/add-non-default-schema-support] branch, and completion for non-default schemas still not works (ಥ_ಥ)

Built it recently and tested on a postgres database successfully, if you have a large database as was my case, you may need to include also changes from https://github.com/sqls-server/sqls/pull/147

aokiji avatar Jan 23 '25 22:01 aokiji

Yeah, i was too fast with my conclusions, autocomplete works, but its behavior seem a little bit strange. For example when i type schema name - nothing happens, however if i try to type name of a table then completion let me choose from tables with similar names in all schemas in a database. Also completion don't works when i want to choose columns for output in select statement

https://github.com/user-attachments/assets/8364c4cf-161b-4fc3-a414-b37a9bcf6928

BotNikos avatar Jan 24 '25 11:01 BotNikos

Ready to merge?

mattn avatar Feb 15 '25 13:02 mattn

This has issues. Can't use schema names in joins:

Screencast From 2025-05-20 17-21-24.webm

As you can see I don't get completions after using stores (which is the schema name). But I get them without the schema name.

Using table alias names doesn't help either.

ahmafi avatar May 20 '25 13:05 ahmafi