GoblinDBRocks/GoblinDB

Database storage location

CodingCarlos opened this issue · 0 comments

Working in GoblinSocket, I found that GoblinDB has no default file in configuration. Due to that, i got an epic crash when triying to initialize the databse on the first time.

not-goblin

But, when I went to node_modules/goblindb there was a file called goblin_db.json. So, what the hell was happening?

I opened the config.js, and I added the file param, so the file ended as this:

module.exports = {
    logPrefix: "[GoblinDB]",
    file: 'goblin_bd.json'
}

And it started working. But I realized that there was a new file in my GoblinSocket directory, called goblin_bd.json. What was happening? Relative routes.

/GoblinSocket
 - /node_modules
 - - /goblindb
 - - - goblin_db.json   <--- THIS IS NOT THE DB
 - goblin_db.json       <--- THIS IS THE DB
 - index.js

So, maybe next steps could be make a consistent documentation of where the db will be stored, and try to prevent that errors, to avoid unexpected crashes that may damage the data storage.