MCPcopy Create free account
hub / github.com/upper/db / Clone

Method Clone

adapter/mongo/database.go:132–147  ·  view source on GitHub ↗

Clone returns a cloned db.Session session.

()

Source from the content-addressed store, hash-verified

130
131// Clone returns a cloned db.Session session.
132func (s *Source) Clone() (db.Session, error) {
133 clone := &Source{
134 Settings: db.NewSettings(),
135
136 name: s.name,
137 connURL: s.connURL,
138 version: s.version,
139 collections: map[string]*Collection{},
140 }
141
142 if err := clone.open(); err != nil {
143 return nil, err
144 }
145
146 return clone, nil
147}
148
149// Ping checks whether a connection to the database is still alive by pinging
150// it, establishing a connection if necessary.

Callers

nothing calls this directly

Calls 1

openMethod · 0.95

Tested by

no test coverage detected