/entspatial

An example repository for working with MySQL spatial data types in ent

Primary LanguageGoApache License 2.0Apache-2.0

entspatial

An example repository for working with MySQL spatial data types in ent.

// Location holds the schema definition for the Location entity.
type Location struct {
	ent.Schema
}

// Fields of the Location.
func (Location) Fields() []ent.Field {
	return []ent.Field{
		field.String("name"),
		field.Other("coords", &Point{}).
			SchemaType(Point{}.SchemaType()),
	}
}