Inside of the Custom Database tab of your database connection you can enable the Context object in database scripts setting which will allow you to pass in additional information from your config file.
But for your use case I would highly recommend you to use different tenants for each environment you have:
If you have any other questions for us feel free to ask.