# PonyORM use for mapping entities with Rasa chatbot and MYSQL database

**URL:** <https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756>\
**Category:** Rasa Open Source\
**Created:** [March 30, 2020, 6:13am UTC](https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756 "2020-03-30T06:13:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharthchauhan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/siddharthchauhan/32/7132_2.png) [@siddharthchauhan](https://forum.rasa.com/u/siddharthchauhan)\
**Post date:** [March 30, 2020, 6:13am UTC](https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756/1 "2020-03-30T06:13:05Z")

</div>

I am trying to build a chatbot that will query MYSQL database using natural language. Is there a way i can use PonyORM to map entities with MYSQL database table with my Rasa chatbot ? If so, than how can i achieve it?

---

<div class="post-metadata">

**Author:** ![chkoss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chkoss/32/7186_2.png) [@chkoss](https://forum.rasa.com/u/chkoss)\
**Post date:** [March 30, 2020, 12:10pm UTC](https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756/2 "2020-03-30T12:10:25Z")

</div>

I saw you got a reply to your question on Stack Overflow. For anyone else wondering about the same thing: [here](https://stackoverflow.com/a/60895750) is the answer.

---

<div class="post-metadata">

**Author:** ![siddharthchauhan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/siddharthchauhan/32/7132_2.png) [@siddharthchauhan](https://forum.rasa.com/u/siddharthchauhan)\
**Post date:** [March 30, 2020, 12:19pm UTC](https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756/3 "2020-03-30T12:19:52Z")

</div>

I am kind a new to Rasa, i didn’t get it exactly what needs to be done. I you can provide solution in detail that will help a lot.

---

<div class="post-metadata">

**Author:** ![chkoss](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chkoss/32/7186_2.png) [@chkoss](https://forum.rasa.com/u/chkoss)\
**Post date:** [April 8, 2020, 7:43am UTC](https://forum.rasa.com/t/ponyorm-use-for-mapping-entities-with-rasa-chatbot-and-mysql-database/26756/4 "2020-04-08T07:43:26Z")

</div>

Hi @siddharthchauhan,

In response to user input, a Rasa bot will always do an action. This can be different things, e.g. simply an utterance (sending back some reply text) or it could also be a custom action. Such custom actions are what you have to use if you want to query a database.

How to set up custom actions in general is explained in our documentation [here](https://rasa.com/docs/rasa/1.2.9/core/actions/#custom-actions). One way to do this is using Rasa SDK. Some explanations on how to use Rasa SDK can be found [here](https://rasa.com/docs/rasa/api/rasa-sdk/#rasa-sdk). On that page, there is also an example of a custom action that queries a database.

If anything is still unclear or not working, please let me know what you have already set up / implemented and where exactly you are stuck.
