We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c34675f commit 38a4684Copy full SHA for 38a4684
database/spanner/spanner.go
@@ -56,6 +56,9 @@ type Config struct {
56
// Parsing outputs clean DDL statements such as reformatted
57
// and void of comments.
58
CleanStatements bool
59
+ // DoNotCloseSpannerClients turns Close() into a no-op so the
60
+ // provided spanner clients are not closed
61
+ DoNotCloseSpannerClients bool
62
}
63
64
// Spanner implements database.Driver for Google Cloud Spanner
@@ -146,6 +149,9 @@ func (s *Spanner) Open(url string) (database.Driver, error) {
146
149
147
150
// Close implements database.Driver
148
151
func (s *Spanner) Close() error {
152
+ if s.config.DoNotCloseSpannerClients {
153
+ return nil
154
+ }
155
s.db.data.Close()
156
return s.db.admin.Close()
157
0 commit comments