Closed ghost closed 1 year ago
Since there is no easy way to update the cache, I introduced a command to clear it.
Just run :DBCompletionClearCache
and it will clear all the cache, and if you are in the SQL buffer it will automatically cache new data. Hope this helps.
Thanks
There seems to be an issue with the way that plugin refreshes database tables and columns information.
I was only able to give a cursory look at what is happening here, but it seems that the cache is not being updated after the plugin loads, and I have no idea how to reload the plugin.
For example, if I open a new buffer with
filetype=sql
, completion works with all of the existing tables and columns.However, if I now create a new table,
:enew
withfiletype=sql
appears to reconnect to the database, but completion doesn't consider the new table at all.These lines of code seems to be preventing the plugin from reloading the tables and columns into the cache:
If I use
:DBUI
, refreshing and creating a new query works to include the newly created table for completion, but doesn't seem to be aware of its columns, because they do not appear when I try to complete them.Is there something that I am missing here?