You may want to look into
https://github.com/mevdschee/php-crud-api yes, its a full blown API for databases. If you just need to insert data from MCU into Database- create quite simple PHP (or whatever language works for you) server side script. I have PHP scrip that accept parameters for temperature, humidity via GET, and on my MCU i just make request to
http://example.com/insert.php?t=23.5&h=57
Another option, would be to install client on your ESP32
https://github.com/dvrhax/uPyMySQL but its very resource hungry. I've tried to play around with it. It works. But selecting data result size is very limited. Inserting only should works as expected. But you may need to
mpy-cross some files or freeze in firmware to lower ram usage.
I would go with API solution, either full blown or custom (insert data only) but this involves additional infrastructure.
Also, for my personal need i've set up following
http://bukys.eu/_media/project/smarthom ... tok=ce013e
where SmartHome central (Node-Red) read MQTT messages, filters what is required and write data into database. Proxy is the device, that read BLE broadcasts and send MQTT messages. Works stable, without major issues almost a year now