Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can you use vim-sql-workbench-sql for vim?


Asked by Teresa Corona on Dec 14, 2021 Vim



This is an implementation of SQL Workbench/J in VIM. It works with any DBMS supported by SQL Workbench/J (PostgreSQL, Oracle, SQLite, MySQL, SQL Server etc.). See the complete list here. You can connect to any DBMS directly from VIM. NOTE: this version of vim-sql-workbench is not compatible with vim 7 anymore. Of course you need VIM 8 or above.
Next,
VIM Sql workbench has integration with the CtrlP plugin. You can set the g:sw_config_dir variable (which contains the WbProfiles.xml file) and then you open your buffer, open CtrlP, select SQL Workbench profiles, select your profile and you can begin sending sql queries to your database.
Thereof, If you are on window, your SQL Workbench/J should be configured to not use the jline (set the workbench.console.use.jline=false in your SQL Workbench/J config file). VIM Sql workbench has integration with the CtrlP plugin.
Keeping this in consideration,
In order to allow remote connections to your MySQL from MySQL Workbench, you will need to modify the my.conf file located in /etc/mysql/my.cnf. You will want to sudo vim into that file: Once inside if you don’t see bind-address, you may add it at the bottom of the page under the group [mysqld]. Below is an example:
In respect to this,
The profile type you can see it in the SQL Workbench/J connection window. It's the driver title. Starting with version 4.0 you can also have a vimscript function called instead of a sql query. The function called has to return a string which will be interpreted as the result of the operation.