# Pull data from sqlite and send as response

**URL:** <https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675>\
**Category:** Game Design\
**Tags:** typescript\
**Created:** [March 22, 2023, 10:37am UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675 "2023-03-22T10:37:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamzayusuf](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hamzayusuf](https://forum.heroiclabs.com/u/hamzayusuf)\
**Post date:** [March 22, 2023, 10:37am UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/1 "2023-03-22T10:37:59Z")

</div>

Hi, I’m trying to develop a project with nakama and I’m not very experienced. Thanks in advance for your help.

I want to search the word in the request sent by the player as the item name in my sqlite database and send these results as a response. How do I do this?

---

<div class="post-metadata">

**Author:** ![shprot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/shprot/32/1573_2.png) [@shprot](https://forum.heroiclabs.com/u/shprot)\
**Post date:** [March 22, 2023, 12:23pm UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/2 "2023-03-22T12:23:45Z")

</div>

Hi, @hamzayusuf !  
Seems you need additional logic on server side, study video tutorial on how easily expand the server logic yourself: [this](https://www.youtube.com/watch?v=Ru3RZ6LkJEk)(golang), [this](https://www.youtube.com/watch?v=iIlKlOaF0As)(lua) or [this](https://www.youtube.com/watch?v=FXguREV6Zf8)(typescript), depend on programming language you more familiar with. Then just call yourself writed RPC function and get what you wish.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [March 22, 2023, 2:52pm UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/3 "2023-03-22T14:52:16Z")

</div>

Hello @hamzayusuf

To add to what @shprot said, if you’re storing items in a database outside of Nakama you’ll need to import a driver and manage the connection to the DB yourself, as well as the necessary queries etc.

This is achievable in the Nakama runtime, but I’d advise you model the data to be stored in the Nakama [storage engine](https://heroiclabs.com/docs/nakama/concepts/storage/) instead.

You can do a lookup with the storage read API and if needed, write a custom RPC with some additional filtering logic, but this depends on how you model the data.

Best

---

<div class="post-metadata">

**Author:** ![hamzayusuf](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hamzayusuf](https://forum.heroiclabs.com/u/hamzayusuf)\
**Post date:** [March 22, 2023, 10:28pm UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/4 "2023-03-22T22:28:26Z")

</div>

I need to access the sqlite database, when I do it this way in the code, I get an error

 ![image](https://us1.discourse-cdn.com/flex020/uploads/heroiclabs/original/2X/4/46c3517f486857e44144db6a5e0171785aed8b73.png)

---

<div class="post-metadata">

**Author:** ![shprot](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/shprot/32/1573_2.png) [@shprot](https://forum.heroiclabs.com/u/shprot)\
**Post date:** [March 23, 2023, 7:18am UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/5 "2023-03-23T07:18:38Z")

</div>

This question is not related to Nakama, it’s related to programming in general. You can see the problem, that your IDE shows you, it’s clearly written: `Connot compile modules using option 'outFile' unless the '--module' flag is 'amd' or 'system'`. Always make attempts to [google](https://stackoverflow.com/questions/57648285/getting-cannot-compile-modules-using-option-outfile-unless-the-module-flag) this messages and follow the people’s answers, recommendations ang guides.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [March 23, 2023, 10:32am UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/6 "2023-03-23T10:32:59Z")

</div>

@hamzayusuf the Nakama JS runtime is ES5 compliant and bear in mind that it is not a Node.js environment. To include any other JS libraries you’ll need to use something like [rollup](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/#bundling-with-rollup) to transpile the dependencies, and even then not all libraries will be compatible.

---

<div class="post-metadata">

**Author:** ![hamzayusuf](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@hamzayusuf](https://forum.heroiclabs.com/u/hamzayusuf)\
**Post date:** [March 24, 2023, 12:32am UTC](https://forum.heroiclabs.com/t/pull-data-from-sqlite-and-send-as-response/3675/7 "2023-03-24T00:32:40Z")

</div>

Ok thanks for you and @shprot 's help.
