Note: This repository should be imported as
API to access the database for Diego.
A general overview of the BBS is documented here.
Reporting issues and requesting features
Please report all issues and feature requests in cloudfoundry/diego-release.
To interact with the BBS from outside of Diego, use the methods provided on the
Components within Diego may use the full
interface to modify internal state.
The protobuf models in this repository require version 3.5 or later of the
On Mac OS X with Homebrew, run the following to install it:
brew install protobuf
- Download a zip archive of the latest protobuf release from here.
- Unzip the archive in
/usr/local(including /bin and /include folders).
chmod a+x /usr/local/bin/protocto make sure you can use the binary.
If you already have an older version of protobuf installed, you must uninstall it first by running
brew uninstall protobuf
gogoproto compiler by running:
go install github.com/gogo/protobuf/protoc-gen-gogoslick
go generate ./... from the root directory of this repository to generate code from the
.proto files as well as to generate fake implementations of certain interfaces for use in test code.
Generating ruby models for BBS models
The following documentation assume the following versions:
Run the following commands from the
models directory to generate
files for the BBS models:
sed -i'' -e 's/package models/package diego.bbs.models/' ./*.proto
protoc -I../../vendor --proto_path=. --ruby_out=/path/to/ruby/files *.proto
/path/to/ruby/files with the desired destination of the
.pb.rb files. That directory must exist before running this command.
Note The above steps assume that
github.com/gogo/protobuf/gogoproto/gogo.proto is on the
See the instructions in Running the SQL Unit Tests for testing against a SQL backend
See Migrations for information about writing database migrations.
- First setup your GOPATH and install the necessary dependencies for running tests.
- Setup a MySQL server or a postgres server. Please follow these instructions.
- Run the tests from the root directory of the bbs repo:
SQL_FLAVOR=mysql ginkgo -r -p -race