Skip to content

Commit b09c9cc

Browse files
authored
feat: added soft wrapper around some internal functions
feat: added soft wrapper around some internal functions
1 parent 6389cdc commit b09c9cc

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

pkg/api/api.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package api
2+
3+
import (
4+
"context"
5+
6+
"github.com/sqlc-dev/sqlc/internal/cmd"
7+
)
8+
9+
type Options struct {
10+
Dir string // working directory for relative paths
11+
Filename string
12+
Options *cmd.Options
13+
}
14+
15+
func Generate(ctx context.Context, opt Options) (map[string]string, error) {
16+
return cmd.Generate(ctx, opt.Dir, opt.Filename, opt.Options)
17+
}
18+
19+
func Verify(ctx context.Context, opt Options) error {
20+
return cmd.Verify(ctx, opt.Dir, opt.Filename, opt.Options)
21+
}
22+
23+
func Vet(ctx context.Context, opt Options) error {
24+
return cmd.Vet(ctx, opt.Dir, opt.Filename, opt.Options)
25+
}

0 commit comments

Comments
 (0)