Add NewDB to spanner.go

This commit is contained in:
Ryo Takashima 2018-10-28 22:00:05 +09:00
parent 2fc1610248
commit ca888b96e3
1 changed files with 7 additions and 0 deletions

View File

@ -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 {