Execute query using a database connection from a different server


I am using Igntion 8.1.25 making a project in Perspective.
I set up the Database connection in my Named Queries as "Parameter", so that I can change it dinamically on my screen. I'm being able to do it, I can change to a different database I have in my server.
But now I'd like to change to a database located in a different server.
How can I do it?

Make a separate db connection in the gateway and point it to the server's hostname and port.

Database Connections - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)

Thank you.
So it means I'll be able to see only the dB connections I have in my server. I can't via script connect directly to a different server.
Is that?

You can add a connection to a database with scripting, but it usually makes more sense to make db connections in the gateway to every db source you want to access.

system.db.addDatasource - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)