-
Notifications
You must be signed in to change notification settings - Fork 96
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
Oracle database not opening up properly #227
Comments
Hi, I fixed this behavior changing the code of vim-dadbod-ui/autoload/db_ui/schemas.vim, commenting out the following: |
still the same issue happening when instead of packages, procedures, functions, tables etc - I get only listed db users under schemas (screenshot below) P.S. Or maybe I'm doing something wrong here or don't understand something. I'm pretty new to this |
Hi @dartey25, I'm pretty new to this also :D Well, yesterday just figured out a better solution for this, install sqlcl from Oracle (it will need Java), put in your path and use the original code of the plugin. It works out of the box and does a much better format on the query output. Don't forget to define the new oracle binary with this variable (I use init.lua):
|
I had the same problem and after some debugging I got to a simple solution. This if statement does not correctly work in case the global variable is not set. No matter which word you compare with ("sql", "sqlplus", "bar", "foo"...), it will always be true and will execute the code inside the if statement. As I don't want to install additionaly SW, I changed the statement to return empty string in case the variable is not set: In my debugging, I saw that this global variable was not set. It is strange, because it should be set by the dadbod oracle adapter to sqlplus, and in fact, it really uses sqlplus to query the database. I guess more debugging is needed there. After this change, it still does not work correctly for me. Following change does it. Inside the This slice removes some lines from the output of sqlplus (at the beginning and at the end), so that only the schemas and tables are extracted. I am using Oracle Instant Client 12.2, so I guess that using a newer version will work with [15:-5]. I will check if I am granted to install a newer version of the oracle instant client and check it again. |
@kristijanhusak
And at the end, a disconnection message:
I made some tests using VMs where I installed the last oracle instant client sqlplus package (Version 23.4). The values in the slice must be different to extract the information correctly:
The plugin should not have to deal with sqplus versions. The solutions is not in this plugin, but in dadbod plugin. The adapter is calling sqlplus as Note: I only checked parse_results and not parse_virtual_results I will create an issue in the dadbod plugin. Thx a lot for your plugin!! It is amazing :) |
Hi @nlinaje, I was also looking into this issue and found out in the vim-dadbod plugin there's an option already implemented but I'm not sure how this could be done from vim-dadbod-ui (I'm pretty new to nvim/vimscript). The oracle.vim have this piece of code which uses -S option to sqlplus: |
@dbmatheus I am pretty new to vimscript too, in fact I am learning it while debugging this great plugin :) |
Nice @nlinaje, I see filter is implemented for the other drivers in vim-dadbod so maybe this will be a good solution, and with this we would need to remove the slicing expression from |
@nlinaje @dbmatheus I pushed a change that should use the |
@kristijanhusak This works only if you change the slice to [3:], because [15:-5] removes 3 empty lines and the first 12 databases from the top and deletes 2 or 3 schemas from the bottom (rest are empty lines). |
@nlinaje does this mean that Oracle is now broken? |
Well, it was broken for me before too, in versions 12.2 and 23.4. If I put [3:0] in the slice it works with both versions. |
@nlinaje in which slice? Can you give a diff or create a PR with the suggested changes? |
This is my first PR! I hope I did not miss anything! |
@nlinaje @dartey25 @dbmatheus I pushed a change to trim only first 3 lines, per @nlinaje suggestion. Can you pull latest master and give it a try with both sqlplus and the ORA_bin = 'sql' ? |
currently have been using sqlplus 23.5 and couldn't get it to work other than schemas. installed sqlcl and set the ora_bin to sql inside init lua the way dbmatheus described and can't get that working either I hardcoded The Oracle Database Version is 19c |
Would be awesome to have oracle database analized properly on connection. Ex. getting all the tables, packages, procedures, etc.
Right now I'm just getting list of other users in database under the "schemas" dir
P.S. Otherwise, I love it! Would be really happy to be able to use it working with oracle though
The text was updated successfully, but these errors were encountered: