model.go 831 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package model
  2. import (
  3. "reflect"
  4. )
  5. type Model struct {
  6. ModelType reflect.Type
  7. Table string
  8. PrioritizedPrimaryField *Field
  9. PrimaryFields []*Field
  10. Fields []*Field
  11. FieldsByName map[string]*Field
  12. FieldsByDBName map[string]*Field
  13. Relationships Relationships
  14. }
  15. type Field struct {
  16. Name string
  17. DBName string
  18. DataType reflect.Type
  19. DBDataType string
  20. Tag reflect.StructTag
  21. TagSettings map[string]string
  22. PrimaryKey bool
  23. AutoIncrement bool
  24. Creatable bool
  25. Updatable bool
  26. Nullable bool
  27. Unique bool
  28. Precision int
  29. Size int
  30. HasDefaultValue bool
  31. DefaultValue string
  32. StructField reflect.StructField
  33. Model *Model
  34. }