Pull data from sqlite and send as response

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?

Hi, @hamzayusuf !
Seems you need additional logic on server side, study video tutorial on how easily expand the server logic yourself: this(golang), this(lua) or this(typescript), depend on programming language you more familiar with. Then just call yourself writed RPC function and get what you wish.

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 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

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

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 this messages and follow the people’s answers, recommendations ang guides.

@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 to transpile the dependencies, and even then not all libraries will be compatible.

Ok thanks for you and @shprot 's help.