MCPcopy Index your code
hub / github.com/upper/db / Open

Function Open

adapter/mongo/database.go:73–86  ·  view source on GitHub ↗

Open stablishes a new connection to a SQL server.

(connURL db.ConnectionURL)

Source from the content-addressed store, hash-verified

71
72// Open stablishes a new connection to a SQL server.
73func Open(connURL db.ConnectionURL) (db.Session, error) {
74 ctx := context.Background()
75 settings := db.NewSettings()
76
77 d := &Source{
78 Settings: settings,
79 ctx: ctx,
80 }
81 if err := d.Open(connURL); err != nil {
82 return nil, fmt.Errorf("Open: %w", err)
83 }
84
85 return d, nil
86}
87
88func (s *Source) TxContext(context.Context, func(tx db.Session) error, *sql.TxOptions) error {
89 return db.ErrNotSupportedByAdapter

Callers 15

OpenMethod · 0.70
SetUpMethod · 0.70
TestOpenWithWrongDataMethod · 0.70
TestTruncateMethod · 0.70
TestInsertMethod · 0.70
TestResultCountMethod · 0.70
TestGroupMethod · 0.70
TestResultFetchMethod · 0.70
TestUpdateMethod · 0.70
TestOperatorsMethod · 0.70

Calls 2

OpenMethod · 0.95
ErrorfMethod · 0.65

Tested by 14

SetUpMethod · 0.56
TestOpenWithWrongDataMethod · 0.56
TestTruncateMethod · 0.56
TestInsertMethod · 0.56
TestResultCountMethod · 0.56
TestGroupMethod · 0.56
TestResultFetchMethod · 0.56
TestUpdateMethod · 0.56
TestOperatorsMethod · 0.56
TestDeleteMethod · 0.56