dialect/sql/sqlgraph: add builders to create spec (#3288)

This commit is contained in:
Ariel Mashraki
2023-01-31 09:37:51 +02:00
committed by GitHub
parent a0fad09539
commit 037b5a4bc3
125 changed files with 134 additions and 854 deletions

View File

@@ -110,13 +110,7 @@ func (uc *UserCreate) sqlSave(ctx context.Context) (*User, error) {
func (uc *UserCreate) createSpec() (*User, *sqlgraph.CreateSpec) {
var (
_node = &User{config: uc.config}
_spec = &sqlgraph.CreateSpec{
Table: user.Table,
ID: &sqlgraph.FieldSpec{
Type: field.TypeInt,
Column: user.FieldID,
},
}
_spec = sqlgraph.NewCreateSpec(user.Table, sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt))
)
if value, ok := uc.mutation.Name(); ok {
_spec.SetField(user.FieldName, field.TypeString, value)