only-cliches / Nano-SQL

Universal database layer for the client, server & mobile devices. It's like Lego for databases.
https://nanosql.io
MIT License
781 stars 49 forks source link

LOG file "backs up" every change to a row #218

Open codingMASTER398 opened 2 years ago

codingMASTER398 commented 2 years ago

Which version are you using? ^2.3.7

Describe the bug After any edits to a row in the database, it logs/backs up the entire row. For example, I have a "post" object that I want to add likes to. I do so, but it creates a whole new entry in "c1f7-5985"'s log file with the entire row. I only need to change it, not store another version. Nowhere have I stated that it should do this. This is also the same for other things like user data (separate tables).

E.g. when spamming like/unlike, it adds to the file as such

{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,82445,391,2954716879{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1,2],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,82862,393,3960410894{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,83281,391,397385191{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1,2],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,83697,393,3445040025{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,84116,391,1107176446{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1,2],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,84533,393,4220412814{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,84952,391,4210006312{"id":4,"text":"Well, how do YOU eat cheese?","creator":1,"created":1646029794133,"likes":[1,2],"repliesLastID":2,"replies":[{"id":0,"author":2,"text":"I like to eat cheese with my mouth, personally.","likes":[]},{"id":1,"author":1,"text":"I find that quite odd, past me.","likes":[1]},{"id":2,"author":2,"text":"I still agree with my statement about eating cheese with my mouth","likes":[]}]}:1,4,85369,393,569378032

You see, that's way longer than it needs to be.

Expected behavior For it to just update the row instead of back it up every time.

codingMASTER398 commented 2 years ago

More detail: https://stackoverflow.com/questions/71462361/nano-sql-dumping-all-changes-into-a-log-file-clogging-up-storage?noredirect=1#comment126309685_71462361 @only-cliches