vim-dadbod icon indicating copy to clipboard operation
vim-dadbod copied to clipboard

SET Session as READONLY on connect

Open jay-babu opened this issue 1 year ago • 3 comments

Hello,

I am using postgres as my connection. What is the recommendation on setting a session as readonly by default? This is a safeguard that I want by default. I want to opt out of readonly when I want to modify data. Is there an autocmd I can use to run something after connect? https://stackoverflow.com/questions/41960217/connecting-to-postgres-database-with-read-only-access - a few options are listed here on how to set as readonly. I believe the psqlrc is ignored when connecting. Thanks!

jay-babu avatar Oct 17 '24 17:10 jay-babu

I believe the psqlrc is ignored when connecting.

First things first, what does this mean? When is it ignored, and when isn't it?

tpope avatar Oct 18 '24 23:10 tpope

https://github.com/tpope/vim-dadbod/blob/master/autoload/db/adapter/postgresql.vim

maybe I am looking at this file wrong. I see this flag, --no-psqlrc, passed in. Maybe line 13 is run when running a sql command

jay-babu avatar Oct 20 '24 02:10 jay-babu

Yeah, --no-psqlrc is only for tab completing database and table names.

tpope avatar Oct 20 '24 18:10 tpope