This database package is part of the GoCryptoTrader codebase.
You can track ideas, planned features and what's in progresss on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.
Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack
- Establishes & Maintains database connection across program life cycle
- Multiple database support via simple repository model
- Run migration on connection to assure database is at correct version
This will parse and run all migration files in your $GoCryptoTrader/database/migrations
This is also run from the bot when a connection is established to the database
go run ./cmd/dbmigrate
A Makefile command has also been added for this
make db_migrate
To create a new migrate file you can also run the same command with the -create "migration name" flag
go run ./cmd/dbmigrate -create "alter some table"
- Create Model in github.com/thrasher-corp/gocryptotrader/database/models directory
- Create Repository directory in github.com/thrasher-corp/gocryptotrader/database/repository/
- Create a base Repository interface with any required Methods
- Create a per driver implementation of the Repository that implement all required methods to match the interface
Please feel free to submit any pull requests or suggest any desired features to be added.
When submitting a PR, please abide by our coding guidelines:
- Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Code must be documented adhering to the official Go commentary guidelines.
- Code must adhere to our coding style.
- Pull requests need to be based on and opened against the
master
branch.
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
1F5zVDgNjorJ51oGebSvNCrSAHpwGkUdDB