Skip to content

feat(codegen): Insert comments in interfaces#1451

Closed
sbres wants to merge 1 commit intosqlc-dev:mainfrom
sbres:feat/interface-docstring
Closed

feat(codegen): Insert comments in interfaces#1451
sbres wants to merge 1 commit intosqlc-dev:mainfrom
sbres:feat/interface-docstring

Conversation

@sbres
Copy link
Contributor

@sbres sbres commented Feb 21, 2022

Related to #1400 I've added the comments into the interface generation the same way it's done for the auto-generated methods.

I've compiled sqlc using make sqlc-dev. And ran it on this repo https://github.com/sbres/sqlc_example.

The generated output went from:

type Querier interface {
	CheckUserExist(ctx context.Context, email string) (bool, error)
	CreateNewUser(ctx context.Context, arg CreateNewUserParams) (int32, error)
}

To

type Querier interface {
	// CheckUserExist will check if the user exist, retuns true if the exists
	CheckUserExist(ctx context.Context, email string) (bool, error)
	// CreateNewUser will create a new user
	CreateNewUser(ctx context.Context, arg CreateNewUserParams) (int32, error)
}

I was not able to run the full suite of tests.

- Add docstring to interfaces to improve IDE method documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants