MCPcopy Create free account
hub / github.com/brimdata/super / Open

Method Open

cli/dbflags/flags.go:64–81  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

62}
63
64func (l *Flags) Open(ctx context.Context) (api.Interface, error) {
65 uri, err := l.ClientURI()
66 if err != nil {
67 return nil, err
68 }
69 if api.IsRemote(uri.String()) {
70 conn, err := l.Connection()
71 if err != nil {
72 return nil, err
73 }
74 return api.NewRemoteDB(conn), nil
75 }
76 DB, err := api.Connect(ctx, zap.Must(zap.NewProduction()), uri.String())
77 if errors.Is(err, db.ErrNotExist) {
78 return nil, fmt.Errorf("%w\n(hint: run 'super db init' to initialize a database at this location)", err)
79 }
80 return DB, err
81}
82
83func (l *Flags) AuthStore() *auth0.Store {
84 return auth0.NewStore(filepath.Join(l.ConfigDir, "credentials.json"))

Callers 15

ParseFileFunction · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45
writeValueMethod · 0.45
RunMethod · 0.45
RunMethod · 0.45

Calls 8

ClientURIMethod · 0.95
ConnectionMethod · 0.95
IsRemoteFunction · 0.92
NewRemoteDBFunction · 0.92
ConnectFunction · 0.92
MustMethod · 0.80
IsMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected