mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.52k stars 1.24k forks source link

[QUESTION] Export CRUD statements? #2350

Closed Amplificator closed 3 months ago

Amplificator commented 1 year ago

Is it possible to save CRUD statements as a string, json or something else, for then to execute the actual command, maybe using .Execute(), on another machine?

I've been tinkering with the idea of building a server that handles the actual database and for clients to send commands and get updates from the server.

My idea was to have all clients export their CRUD statements as a string, json or something else, send it to the server which then does the actual processing and later update the clients with a status message.

I'm completely new to networking projects like these, but the above is the gist of what I want to do. I'm looking into NetworkStream and Sockets in general.

So my question is, besides being able to export/save CRUD statements, if there would be a better way to expose the database to several clients at once?

JKamsker commented 3 months ago

Originally, this seems to be the plan; it would be possible. You can give it SQL strings, and it returns a serializable BSON document.

But actually hooking it up to a wire protocol... well, I am sure you can do that without changing anything in LiteDB itself.