TomMalkin / SimQLe

The simplest way to use SQL in Python
MIT License
30 stars 5 forks source link

Conversation: Storing a default .connections.yaml file to be loaded where not specified #19

Closed TomMalkin closed 4 years ago

TomMalkin commented 5 years ago

I would love to hear any thoughts on this.

When load_connections() is called at the start of a project, if the .connections.yaml file is not present in the root folder of the project, and not specified in the load_connections(), instead look in a default, os specific location for the file. This would make it easy to write scripts that use database connections without having to worry about copying the correct .connections.yaml file into the root directory of the script each time.

If the location of the database had to change for that particular script, it would simply be a process of copying a modified version of the file into the project location for the database connection changes to be updated with no changes to the script.

There has been some backlash recently about having too many projects relying on dotfiles in the home folder on linux specifically, so I'm not sure where the best place to have the default location would be.

TomMalkin commented 5 years ago

a .connections.yaml file in the root of the project was added to DEFAULT_FILE_LOCATIONS so the functionality to have default locations is ready - still need a conversation about the best default locations.

Also there should be some printed information when a default file is loaded so the user knows where it was loaded from

TomMalkin commented 5 years ago

I'm going to take this out of the version 1 milestone for now - I don't think it's necessary and also it won't be much of an efficiency gain until this project has way more take up

TomMalkin commented 4 years ago

closed in #69