It's not possible because each database engine has a different implementation of the database concept, so it's a subject that varies from engine to engine.
What you can do is to use the ExecuteStatement RDS API command https://docs.aws.amazon.com/rdsdataservice/latest/APIReference/API_ExecuteStatement.html to run a select that queries the DB data dictionary for that specific engine for that RDS instance, and then you can get the database names.
It does not avoid to run the SQL, but it is a standardized way to get this info no matters the instance DB engine, as the result output has always the same structure.
Automatically stop and start an Amazon RDS DB instance in a CDK appAccepted Answerasked a month ago
How to pull a list of all folders in a Workdocs instance?asked 3 months ago
How could I find out when an RDS instance would go out of support?Accepted Answerasked 2 years ago
Get a list of all managed instance IdsAccepted Answerasked 4 years ago
Modifying an Amazon RDS DB Instance and first-touch penaltiesAccepted Answerasked 3 years ago
obtaining Timeout expired while connecting from pgadmin to RDS postgres db instanceasked 2 months ago
Can I import an RDS uncrypted mysql snapshot to an RDS encrypted mysql?Accepted Answerasked 6 months ago
RDS for multiple small databasesasked 3 years ago
How can I retrieve the list of all databases in an RDS DB instance via API?Accepted Answerasked 2 years ago
Automatic startup of stopped databasesasked a year ago