CinematicCow / Lumora

A key value database in go
Other
0 stars 0 forks source link

Database File Overwrites Existing Content Instead of Appending #1

Closed CinematicCow closed 10 months ago

CinematicCow commented 10 months ago

Description: When using the AddToDB function, the database file is overwriting the existing data instead of appending new data. We want the data to be appended to the file without affecting the existing content.

Solution: Modify the code to open the database file in append mode using the os.O_APPEND|os.O_WRONLY flags, ensuring that new data is appended to the end of the file.

CinematicCow commented 10 months ago

After some tinkering, it was found that gob wasn't handling encoding and decoding as previously thought. Even though the file was being appended after implementing the suggested solution, de-serializing was still a headache. Instead of wasting resources on it, it was decided to use msgpack at 88a9f15