An open API service indexing awesome lists of open source software.

https://github.com/a8m/entspatial

An example repository for working with MySQL spatial data types in ent
https://github.com/a8m/entspatial

Last synced: about 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

## entspatial

An example repository for working with [MySQL spatial data types](https://dev.mysql.com/doc/refman/8.0/en/spatial-type-overview.html) in [ent](https://entgo.io).

```go
// 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()),
}
}
```