Skip to content

Commit

Permalink
Add NewDB to spanner.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryo Takashima committed Oct 28, 2018
1 parent 2fc1610 commit ca888b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions database/spanner/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ type DB struct {
data *spanner.Client
}

func NewDB(admin sdb.DatabaseAdminClient, data spanner.Client) *DB {
return &DB{
admin: &admin,
data: &data,
}
}

// WithInstance implements database.Driver
func WithInstance(instance *DB, config *Config) (database.Driver, error) {
if config == nil {
Expand Down

0 comments on commit ca888b9

Please sign in to comment.