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
- Host: GitHub
- URL: https://github.com/a8m/entspatial
- Owner: a8m
- License: apache-2.0
- Created: 2021-02-26T13:13:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-07T07:01:33.000Z (about 5 years ago)
- Last Synced: 2025-03-25T15:13:01.436Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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()),
}
}
```