Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@a8m
Copy link
Member

@a8m a8m commented Apr 6, 2021

This change adds a little breaking-change in the schema and the codegen but fixes a problem with GoType.

After this change, users that use a GoType(&T{}) will get *T in all generated interfaces (instead of T). However, if users still want to use values (instead of pointers), they can pass T{} to GoType (e.g. GoType(T{})), even if T doesn't implement the sql.Scanner interface (but *T does).

Also, this change now generates the basic predicates to driver.Valuer types (e.g. a struct used in GoType). The basic predicates are: =, <>, <, <=, >, =>, IN, NOT IN. For optional fields, it generates also the IS NULL and IS NOT NULL predicates.

@a8m a8m force-pushed the gotype branch 3 times, most recently from c50a813 to 3e66984 Compare April 6, 2021 13:05
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