Changed default database creation behavior #78
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, when running
doltgres
, it would look at the current directory to determine if it was a valid DoltgreSQL directory. If it wasn't, then it would attempt to create adoltgres
database within the directory. This behavior was chosen since "it just works", which is a selling point of the product. This was causing issues though, as users would run the tool from within the same directory that they downloaded it in. This caused an error message to appear stating that the file was conflicting with the attempt to create the database, however users were still confused by the behavior even with the error message.This default behavior has been changed. We now use the
~/doltgres/databases
directory as the default directory. It no longer matters where you rundoltgres
from, it will always point to that directory. This directory can be changed by changing the environment variableDOLTGRES_DATA_DIR
to a different directory.In addition, there's another environment variable named
DOLTGRES_DATA_DIR_CWD
. When this is set totrue
, then it causes DoltgreSQL to operate with the previous behavior, in that it will use the current directory rather than the global data directory.