Use the app’s configured database target, not an attached service
On Railway, an attached Postgres service is not necessarily the database the application actually uses. Before any live lookup, resolve the selected project, environment, and service with explicit CLI flags; then derive the external database identity from both the public Supabase…