Can We Write to the Device Preferences Field in the User_Device Table?

Hello,

I’m currently working on a project using Nakama and Unity C# client. While exploring the Nakama database schema, I noticed a preferences column in the user_device table.

My goal is to store some custom data related to user devices in this preferences field. However, I couldn’t find a way in the runtime API to directly write to this field.

Here are my questions:

  1. Is it possible to directly write or update the preferences field in the user_device table through the Nakama API or any other method?

  2. If it’s not possible, what would be the recommended approach to store custom data related to user devices? For example, should I use Nakama’s storage engine to keep device-related preferences?

Thanks in advance for your help!
Anil

Hey @anil-gg It all depends which infos you would like to store.
It is possible through sql api to update table manually and set data, although it may not be 100% recommended as if that table gets changed, and you migrate to new nakama version, you would need to handle migration on its own.

So better approach would be to use storage engine and store it in different collection.

1 Like