MCPcopy
hub / github.com/sqlc-dev/sqlc / Push

Function Push

internal/cmd/push.go:72–92  ·  view source on GitHub ↗
(ctx context.Context, dir, filename string, opts *Options)

Source from the content-addressed store, hash-verified

70}
71
72func Push(ctx context.Context, dir, filename string, opts *Options) error {
73 e := opts.Env
74 stderr := opts.Stderr
75 configPath, conf, err := readConfig(stderr, dir, filename)
76 if err != nil {
77 return err
78 }
79 up := bundler.NewUploader(configPath, dir, conf)
80 if err := up.Validate(); err != nil {
81 return err
82 }
83 p := &pusher{}
84 if err := Process(ctx, p, dir, filename, opts); err != nil {
85 return err
86 }
87 if e.DryRun {
88 return up.DumpRequestOut(ctx, p.results)
89 } else {
90 return up.Upload(ctx, p.results, opts.Tags)
91 }
92}

Callers 1

push.goFile · 0.85

Calls 6

ValidateMethod · 0.95
DumpRequestOutMethod · 0.95
UploadMethod · 0.95
NewUploaderFunction · 0.92
readConfigFunction · 0.85
ProcessFunction · 0.85

Tested by

no test coverage detected