mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.52k stars 306 forks source link

Unable to change default schema in database connection #1069

Open thomasroordaGiG opened 1 year ago

thomasroordaGiG commented 1 year ago

Hi all,

I have just installed this extension, and connected to our database succesfully. However, for the SQL scripts to work, I need to connect to a specific schema within the database connection. Currently, the execution throws the error of ¨relation ´x´ does not exist.¨ I am using the newest version of Visual Code and SQLTools, and I am using PostgreSQL. It seems to default to the public schema, but I need to have the vcs schema connected to by default, see image. This is where the tables are located that I want to use. Can anyone point me to where I can change this setting?

image

Kind regards, Thomas

gjsjohnmurray commented 1 year ago

Can you use the SET search_path TO vcs syntax described in docs here?

thomasroordaGiG commented 1 year ago

@gjsjohnmurray Thanks for the reply. This does work, however I was looking for a way to configure VSCode to do this. I guess that is not a possibility? I used to work with dbeaver, which does have this functionality.

gjsjohnmurray commented 1 year ago

The PostgreSQL driver would need enhancing to do this. I have added the 'feature request' label but can't promise it will be implemented.

Yahud100 commented 3 weeks ago

is there any update on this feature request , i need to get default shema for active connection , is there any way to get that without using any queries , i mean i need to get default schema for all dbs , please help on this.