Skip to content

Commit

Permalink
Merge branch '107-add-required-packages-to-connect-to-mysql-databae' …
Browse files Browse the repository at this point in the history
…into 'main'

Resolve "Add required packages to connect to MySQL databae"

Closes #107

See merge request pub/terrareg!77
  • Loading branch information
MatthewJohn committed May 6, 2022
2 parents 3b89345 + 0bc27bb commit e24504a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ Default: `True`
URL for database.
Defaults to local sqlite database.

To setup SQLite datbase, use `sqlite:///<path to sqlite DB>`

To setup MySQL, use `mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<database>`

Default: `sqlite:///modules.db`

Expand Down Expand Up @@ -418,6 +421,7 @@ There are common attributes that can be added to each of variable objects, which

### v1.1.0

* Add MySQL connector and document URL format to connect to MySQL
* Provide ability to pass SSH private key through environment variable

### v1.0.3
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ SQLAlchemy==1.4.35
Werkzeug==2.0.0
zipp==3.8.0
alembic==1.7.7
mysql-connector-python==8.0.29
4 changes: 4 additions & 0 deletions terrareg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def DATABASE_URL(self):
"""
URL for database.
Defaults to local sqlite database.
To setup SQLite datbase, use `sqlite:///<path to sqlite DB>`
To setup MySQL, use `mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<database>`
"""
return os.environ.get('DATABASE_URL', 'sqlite:///modules.db')

Expand Down

0 comments on commit e24504a

Please sign in to comment.