You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\*\*\*\* MySQL added a native JSON type in version 5.7.8, if you're using earlier versions,
114
114
remember to use TEXT column for your JSON field.
115
115
116
-
\*\*\*\*\* Encoding/decoding between `Geo.*` structs and the OpenGIS WKB binary format is
117
-
done using the [Geo](https://github.com/bryanjos/geo) package. If you're using MyXQL geometry
118
-
types with Ecto and need to for example accept a WKT format as user input, consider implementing an
119
-
[custom Ecto type](https://hexdocs.pm/ecto/Ecto.Type.html). Note, some structs like `%Geo.PointZ{}`
120
-
does not have equivalent on the MySQL server side and thus shouldn't be used.
116
+
\*\*\*\*\* See "Geometry support" section below
121
117
122
118
## JSON support
123
119
124
-
MyXQL comes with JSON support out of the box via the [Jason](https://github.com/michalmuskala/jason) library. To use it, add `:jason` to your dependencies:
120
+
MyXQL comes with JSON support via the [Jason](https://github.com/michalmuskala/jason) library.
121
+
122
+
To use it, add `:jason` to your dependencies:
125
123
126
124
```elixir
127
125
{:jason, "~> 1.0"}
@@ -133,6 +131,22 @@ You can customize it to use another library via the `:json_library` configuratio
133
131
config :myxql, :json_library, SomeJSONModule
134
132
```
135
133
134
+
## Geometry support
135
+
136
+
MyXQL comes with Geometry types support via the [Geo](https://github.com/bryanjos/geo) package.
137
+
138
+
To use it, add `:geo` to your dependencies:
139
+
140
+
```elixir
141
+
{:geo, "~> 3.3"}
142
+
```
143
+
144
+
Note, some structs like `%Geo.PointZ{}` does not have equivalent on the MySQL server side and thus
145
+
shouldn't be used.
146
+
147
+
If you're using MyXQL geometry types with Ecto and need to for example accept a WKT format as user
148
+
input, consider implementing an [custom Ecto type](https://hexdocs.pm/ecto/Ecto.Type.html).
0 commit comments