Perspective is running inside the context of a particular project (by definition), so on the backend, we pass the project's default database in to the running script's context automatically. The individual scripting function implementations "know" to look for this context and extract it, so both things are true:
- All Perspective scripts run on the gateway
- Perspective scripts can assume the default database.
See this thread if you're interested in how that mechanism actually works.