Skip to content

Commit

Permalink
Rename Setter method from Insert to InsertMod
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenafamo committed Jan 2, 2024
1 parent e4e6692 commit b03ab30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var (
{{$.Importer.Import (printf "github.com/stephenafamo/bob/dialect/%s/im" $.Dialect)}}
{{$table := .Table}}
{{$tAlias := .Aliases.Table $table.Key -}}
func (s {{$tAlias.UpSingular}}Setter) Insert() bob.Mod[*dialect.InsertQuery] {
func (s {{$tAlias.UpSingular}}Setter) InsertMod() bob.Mod[*dialect.InsertQuery] {
vals := make([]bob.Expression, 0, {{len $table.NonGeneratedColumns}})
{{range $column := $table.NonGeneratedColumns -}}
{{$colAlias := $tAlias.Column $column.Name -}}
Expand Down
2 changes: 1 addition & 1 deletion gen/templates/models/01_types.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (s {{$tAlias.UpSingular}}Setter) Overwrite(t *{{$tAlias.UpSingular}}) {
{{$.Importer.Import (printf "github.com/stephenafamo/bob/dialect/%s/im" $.Dialect)}}
{{$table := .Table}}
{{$tAlias := .Aliases.Table $table.Key -}}
func (s {{$tAlias.UpSingular}}Setter) Insert() bob.Mod[*dialect.InsertQuery] {
func (s {{$tAlias.UpSingular}}Setter) InsertMod() bob.Mod[*dialect.InsertQuery] {
vals := make([]bob.Expression, {{len $table.NonGeneratedColumns}})
{{range $index, $column := $table.NonGeneratedColumns -}}
{{$colAlias := $tAlias.Column $column.Name -}}
Expand Down
2 changes: 1 addition & 1 deletion orm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ type Setter[T any, InsertQ any, UpdateQ any] interface {
// Act as a mod for the update query
bob.Mod[UpdateQ]
// Return a mod for the insert query
Insert() bob.Mod[InsertQ]
InsertMod() bob.Mod[InsertQ]
}

0 comments on commit b03ab30

Please sign in to comment.