MCPcopy
hub / github.com/ent/ent / createSpec

Method createSpec

entc/integration/migrate/entv2/conversion_create.go:206–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204}
205
206func (_c *ConversionCreate) createSpec() (*Conversion, *sqlgraph.CreateSpec) {
207 var (
208 _node = &Conversion{config: _c.config}
209 _spec = sqlgraph.NewCreateSpec(conversion.Table, sqlgraph.NewFieldSpec(conversion.FieldID, field.TypeInt))
210 )
211 if value, ok := _c.mutation.Name(); ok {
212 _spec.SetField(conversion.FieldName, field.TypeString, value)
213 _node.Name = value
214 }
215 if value, ok := _c.mutation.Int8ToString(); ok {
216 _spec.SetField(conversion.FieldInt8ToString, field.TypeString, value)
217 _node.Int8ToString = value
218 }
219 if value, ok := _c.mutation.Uint8ToString(); ok {
220 _spec.SetField(conversion.FieldUint8ToString, field.TypeString, value)
221 _node.Uint8ToString = value
222 }
223 if value, ok := _c.mutation.Int16ToString(); ok {
224 _spec.SetField(conversion.FieldInt16ToString, field.TypeString, value)
225 _node.Int16ToString = value
226 }
227 if value, ok := _c.mutation.Uint16ToString(); ok {
228 _spec.SetField(conversion.FieldUint16ToString, field.TypeString, value)
229 _node.Uint16ToString = value
230 }
231 if value, ok := _c.mutation.Int32ToString(); ok {
232 _spec.SetField(conversion.FieldInt32ToString, field.TypeString, value)
233 _node.Int32ToString = value
234 }
235 if value, ok := _c.mutation.Uint32ToString(); ok {
236 _spec.SetField(conversion.FieldUint32ToString, field.TypeString, value)
237 _node.Uint32ToString = value
238 }
239 if value, ok := _c.mutation.Int64ToString(); ok {
240 _spec.SetField(conversion.FieldInt64ToString, field.TypeString, value)
241 _node.Int64ToString = value
242 }
243 if value, ok := _c.mutation.Uint64ToString(); ok {
244 _spec.SetField(conversion.FieldUint64ToString, field.TypeString, value)
245 _node.Uint64ToString = value
246 }
247 return _node, _spec
248}
249
250// ConversionCreateBulk is the builder for creating many Conversion entities in bulk.
251type ConversionCreateBulk struct {

Callers 2

sqlSaveMethod · 0.95
SaveMethod · 0.45

Calls 12

NewCreateSpecFunction · 0.92
NewFieldSpecFunction · 0.92
NameMethod · 0.65
SetFieldMethod · 0.65
Int8ToStringMethod · 0.45
Uint8ToStringMethod · 0.45
Int16ToStringMethod · 0.45
Uint16ToStringMethod · 0.45
Int32ToStringMethod · 0.45
Uint32ToStringMethod · 0.45
Int64ToStringMethod · 0.45
Uint64ToStringMethod · 0.45

Tested by

no test coverage detected