Getting the name of the Database Dynamically

I don't think getConnections() is getting the default project database... From what I can see in the docs, it gets all of the connections that are defined on the gateway. It looks like you may only have one, so in this case it works, but if what I'm assuming is true, I don't believe this is a good future-proof way to accomplish your task.

I'm interested to see why you have to pass in a database connection name if you have a project default database specified and you're calling system.db.runPrepUpdate from the Perspective scope. Can you add a screenshot of your project configuration, specifically the "Default Database" portion?