car.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Code generated by entc, DO NOT EDIT.
  2. package car
  3. const (
  4. // Label holds the string label denoting the car type in the database.
  5. Label = "car"
  6. // FieldID holds the string denoting the id field in the database.
  7. FieldID = "id"
  8. // FieldModel holds the string denoting the model field in the database.
  9. FieldModel = "model"
  10. // FieldRegisteredAt holds the string denoting the registered_at field in the database.
  11. FieldRegisteredAt = "registered_at"
  12. // EdgeOwner holds the string denoting the owner edge name in mutations.
  13. EdgeOwner = "owner"
  14. // Table holds the table name of the car in the database.
  15. Table = "cars"
  16. // OwnerTable is the table that holds the owner relation/edge.
  17. OwnerTable = "cars"
  18. // OwnerInverseTable is the table name for the User entity.
  19. // It exists in this package in order to avoid circular dependency with the "user" package.
  20. OwnerInverseTable = "users"
  21. // OwnerColumn is the table column denoting the owner relation/edge.
  22. OwnerColumn = "user_cars"
  23. )
  24. // Columns holds all SQL columns for car fields.
  25. var Columns = []string{
  26. FieldID,
  27. FieldModel,
  28. FieldRegisteredAt,
  29. }
  30. // ForeignKeys holds the SQL foreign-keys that are owned by the "cars"
  31. // table and are not defined as standalone fields in the schema.
  32. var ForeignKeys = []string{
  33. "user_cars",
  34. }
  35. // ValidColumn reports if the column name is valid (part of the table columns).
  36. func ValidColumn(column string) bool {
  37. for i := range Columns {
  38. if column == Columns[i] {
  39. return true
  40. }
  41. }
  42. for i := range ForeignKeys {
  43. if column == ForeignKeys[i] {
  44. return true
  45. }
  46. }
  47. return false
  48. }