From ca888b96e3ef90ea2141b98067f9f736aa2838bc Mon Sep 17 00:00:00 2001 From: Ryo Takashima Date: Sun, 28 Oct 2018 22:00:05 +0900 Subject: [PATCH] Add NewDB to spanner.go --- database/spanner/spanner.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database/spanner/spanner.go b/database/spanner/spanner.go index f59046a..84ff252 100644 --- a/database/spanner/spanner.go +++ b/database/spanner/spanner.go @@ -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 {