Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package api

import (
"context"

"github.com/sqlc-dev/sqlc/internal/cmd"
)

type Options struct {
Dir string // working directory for relative paths
Filename string
Options *cmd.Options
}

func Generate(ctx context.Context, opt Options) (map[string]string, error) {
return cmd.Generate(ctx, opt.Dir, opt.Filename, opt.Options)
}

func Verify(ctx context.Context, opt Options) error {
return cmd.Verify(ctx, opt.Dir, opt.Filename, opt.Options)
}

func Vet(ctx context.Context, opt Options) error {
return cmd.Vet(ctx, opt.Dir, opt.Filename, opt.Options)
}
Loading