The direct connection is for a fixed set of details that are used by the Wappler UI to run queries and fetch schema while building APIs. The connection that is used when the API file is running (and therefore has the dynamic data available) is under global>database and can have dynamic data using the binding tool.