Any way to connect to more than one db in the same connection? (using SQLtools extension in VScode)

Viewed 350

I'm trying to connect to 2 db's from the same connection simultaneously but I can't seem to find a way to do so. The idea is to get something like this.

{
"sqltools.connections": [

    {
        "previewLimit": 50,
        "server": "localhost",
        "port": 5432,
        "driver": "PostgreSQL",
        "name": "DataBase",
        "username": "sampleuser",
        "password": "samplepasswd",
        "database": "root, database1, database2..."
    }
]
}

How do I go about this? (here's an image for better visibility, I would like the simple_bank db to show under root;)

Can't upload screenshots yet

1 Answers

you can link postgres databases with extension postgres_fdw if you have rights to do so i.e create extension,create server,create user mapping,create schema,import foreign schema. In queries use prefix of the new schema to access the second database.

Related