Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ Chooses what dialect of database you want. Must be `mysql`.

Connection string for the database.

`GOTRUE_DB_MAX_POOL_SIZE` - `int`

Sets the maximum number of open connections to the database. Defaults to 0 which is equivalent to an "unlimited" number of connections.

`DB_NAMESPACE` - `string`

Adds a prefix to all table names.
Expand Down
7 changes: 5 additions & 2 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ type SamlProviderConfiguration struct {

// DBConfiguration holds all the database related configuration.
type DBConfiguration struct {
Driver string `json:"driver" required:"true"`
URL string `json:"url" envconfig:"DATABASE_URL" required:"true"`
Driver string `json:"driver" required:"true"`
URL string `json:"url" envconfig:"DATABASE_URL" required:"true"`

// MaxPoolSize defaults to 0 (unlimited).
MaxPoolSize int `json:"max_pool_size" split_words:"true"`
MigrationsPath string `json:"migrations_path" split_words:"true" default:"./migrations"`
}

Expand Down
1 change: 1 addition & 0 deletions storage/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Dial(config *conf.GlobalConfiguration) (*Connection, error) {
db, err := pop.NewConnection(&pop.ConnectionDetails{
Dialect: config.DB.Driver,
URL: config.DB.URL,
Pool: config.DB.MaxPoolSize,
})
if err != nil {
return nil, errors.Wrap(err, "opening database connection")
Expand Down