# How do i store activity result into my database

**URL:** <https://community.temporal.io/t/how-do-i-store-activity-result-into-my-database/7039>\
**Category:** Community Support\
**Tags:** typescript-sdk, postgresql\
**Created:** [January 24, 2023, 12:04pm UTC](https://community.temporal.io/t/how-do-i-store-activity-result-into-my-database/7039 "2023-01-24T12:04:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rahul1/32/4945_2.png) [@Rahul1](https://community.temporal.io/u/Rahul1)\
**Post date:** [January 24, 2023, 12:04pm UTC](https://community.temporal.io/t/how-do-i-store-activity-result-into-my-database/7039/1 "2023-01-24T12:04:39Z")

</div>

Hi Team  
I would like to have a workflow where i write a certain data to temporal and then i have to write this data to a table in my local db. How can i do it through temporal, through another activity or some other way?  
My use case is that i have a table A and i have some data, i use defineSignal to set the data in temporal but i also need to write this data to the table A. How is it possible using temporal and if so are there any examples in typescript where this has been done?  
My understanding right now is that i will have to write a raw postgres query to add it to the table. Please tell me if there is any other way to approach this?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [January 24, 2023, 2:49pm UTC](https://community.temporal.io/t/how-do-i-store-activity-result-into-my-database/7039/2 "2023-01-24T14:49:20Z")

</div>

Your db writes should be done through activity.  
You could add these db write activities in your workflow code (signal handler it seems in your case if the data to write is delivered via signal payload) or could use [interceptors](https://legacy-documentation-sdks.temporal.io/typescript/interceptors) to intercept delivered signals as well.

---

<div class="post-metadata">

**Author:** ![Rahul1](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/rahul1/32/4945_2.png) [@Rahul1](https://community.temporal.io/u/Rahul1)\
**Post date:** [January 25, 2023, 4:46am UTC](https://community.temporal.io/t/how-do-i-store-activity-result-into-my-database/7039/3 "2023-01-25T04:46:34Z")

</div>

Thank you for the response tihomir,  
So would i just need to inject my repository into the activity like what i would do with my service in a normal typescript call or would i need to write raw queries of the db write in the activity code?
