How to design a micro service that provides sql query

the company has built a Spring Cloud micro-service framework and now wants to provide a micro-service interface for executing sql statements.
the question now is how to design better:
1. The interface parameters should contain the sql statement to be executed, the parameters of the sql, and the database in which the sql statement is executed. The problem is: originally, the business code only needs to call the mapper interface, but now it needs to pass the sql statement, which increases the workload of the development
2. Because more than a dozen libraries are involved (the original business has sub-libraries and sub-tables), should a database connection pool be created for each library? Is there a problem with this

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31ef3-2bdcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31ef3-2bdcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?