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

Method Run

cmd/super/db/init/command.go:37–67  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

35}
36
37func (c *Command) Run(args []string) error {
38 ctx, cleanup, err := c.Init()
39 if err != nil {
40 return err
41 }
42 defer cleanup()
43 var u *storage.URI
44 if len(args) == 0 {
45 if u, err = c.DBFlags.URI(); err != nil {
46 return err
47 }
48 } else if len(args) == 1 {
49 path := args[0]
50 if path == "" {
51 return errors.New("single database path argument required")
52 }
53 if u, err = storage.ParseURI(path); err != nil {
54 return err
55 }
56 }
57 if api.IsRemote(u.String()) {
58 return fmt.Errorf("init command not valid on remote database")
59 }
60 if _, err := api.CreateLocalDB(ctx, zap.Must(zap.NewProduction()), u.String()); err != nil {
61 return err
62 }
63 if !c.DBFlags.Quiet {
64 fmt.Printf("database created: %s\n", u)
65 }
66 return nil
67}

Callers

nothing calls this directly

Implementers 15

Displaypkg/display/display.go
Serverpkg/httpd/server.go
Commandcmd/gentoken/main.go
Commandcmd/super/dev/command.go
Commandcmd/super/dev/vector/command.go
Commandcmd/super/dev/vector/copy/command.go
Commandcmd/super/dev/vector/project/command.g
Commandcmd/super/dev/vector/search/command.go
Commandcmd/super/dev/dig/command.go
Commandcmd/super/dev/dig/frames/command.go
Commandcmd/super/dev/dig/slice/command.go
Commandcmd/super/dev/csup/command.go

Calls 8

StringMethod · 0.95
ParseURIFunction · 0.92
IsRemoteFunction · 0.92
CreateLocalDBFunction · 0.92
URIMethod · 0.80
NewMethod · 0.80
MustMethod · 0.80
InitMethod · 0.65

Tested by

no test coverage detected