✅ .db file to rest api

Hello I need help, I have a server for a roleplay game (chsarp unity) which is hosted on a pterodactyle egg. The game creates a .db file with all player information. How should I go about creating a rest api so that my website can retrieve information from the database (The problem is that the .db file is only accessible on the game server thanks to plugins that interact with the game). At the beginning I had thought of creating a rest api in my plugins which will take care of sending the information to another api which will manipulate them in order to be able to make type calls (players/{name}/stats etc... ). But I don't think it's effective. So how should I go about it? (The rest api is with chsarp too, API Web ASP.NET)
7 Replies
Pobiega
Pobiega16mo ago
.db isnt a dedicated format, so it could be anything. do you know what format the file has? sqlite? json?
⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟
yes sql and i maange it through "SQLiteAsyncConnection" in my plugins
Pobiega
Pobiega16mo ago
okay, so its sqlite you could easily use EF Core with DB first in your web api then
cap5lut
cap5lut16mo ago
just as a side note, SQLite doesnt scale well for a lot of concurrent accesses which u basically have in server environments. Might be better to switch to a more scalable solution like PostgreSQL, MSSQL or MariaDB just to name a few
⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟⃟
Thanks, yeah i know it but unfortunately i have to use sqlite asked by someone Thanks for the help i made everything, but since it is a .db file which is constantly updated when the server is open. So I have to launch my web api application in the same vps than my server?
Pobiega
Pobiega16mo ago
how else would it access that one file? but as cap5 said, SQLite doesnt like concurrent access so reading it while its being written to might not work
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server