kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.54k stars 94 forks source link

[FeatureRequest] support comment line in buffer #100

Closed hiberabyss closed 3 years ago

hiberabyss commented 3 years ago

For some db like redis, there is no built-in comment line support.

Is it possible to support comment line in dadbod-ui buffer? Only non-comment lines send to db when write the file.

kristijanhusak commented 3 years ago

There's no any syntax support for any DB type as part of this plugin. For all sql databases I just use builtin filetypes (sql,mysql,plsql), which are already part of Vim. What filetype do you use when you write redis outside of dadbod-ui?

hiberabyss commented 3 years ago

There's no any syntax support for any DB type as part of this plugin. For all sql databases I just use builtin filetypes (sql,mysql,plsql), which are already part of Vim. What filetype do you use when you write redis outside of dadbod-ui?

Both sql (with -- as comment string) or conf (with # as comment string) should be OK.

Maybe we could specify custom filetype in g:dbs, and the comment string is determined by vim.

kristijanhusak commented 3 years ago

We can set that up, but I don't know what filetype is being used for redis in vim?

hiberabyss commented 3 years ago

Another way is to specify custom range specifier instead of the default % (e.g. .), which could temporarily solve the problem.

kristijanhusak commented 3 years ago

You can run parts of the query with <Leader>S. See https://github.com/kristijanhusak/vim-dadbod-ui/blob/master/doc/dadbod-ui.txt#L322

hiberabyss commented 3 years ago

We can set that up, but I don't know what filetype is being used for redis in vim?

Also did not know if there is redis filetype in vim, only connect redis in vim with vim-dadbod-ui.

Thanks for your great work!

hiberabyss commented 3 years ago

You can run parts of the query with <Leader>S. See https://github.com/kristijanhusak/vim-dadbod-ui/blob/master/doc/dadbod-ui.txt#L322

Sometimes I would like to write many queries in file and run chosen query one time, however, all queries will be run when write file.

Could there be a new mapping which only run the current line? It will be better if the map support text object.

kristijanhusak commented 3 years ago

You can run current line with this command:

:.DB

Or you do a visual select of query that you want to run, press : and type DB, which produces this:

:'<,'>DB

Then run it.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.