From 7dcd89230fc2668a2a8e979f78cd661122a0d42f Mon Sep 17 00:00:00 2001 From: Rudolf Date: Fri, 22 Sep 2023 20:03:20 -0700 Subject: [PATCH] Type Geometry (#173) * type Geometry * actually just delegate to Geo.geometry() --- lib/geo_postgis/geometry.ex | 2 ++ test/ecto_test.exs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/geo_postgis/geometry.ex b/lib/geo_postgis/geometry.ex index dc1ed60..a35197c 100644 --- a/lib/geo_postgis/geometry.ex +++ b/lib/geo_postgis/geometry.ex @@ -57,6 +57,8 @@ if Code.ensure_loaded?(Ecto.Type) do GeometryCollection ] + @type t :: Geo.geometry() + if macro_exported?(Ecto.Type, :__using__, 1) do use Ecto.Type else diff --git a/test/ecto_test.exs b/test/ecto_test.exs index b449197..f9b67ea 100644 --- a/test/ecto_test.exs +++ b/test/ecto_test.exs @@ -37,8 +37,7 @@ defmodule Geo.Ecto.Test do setup _ do {:ok, pid} = Postgrex.start_link(Geo.Test.Helper.opts()) - {:ok, _} = - Postgrex.query(pid, "CREATE EXTENSION IF NOT EXISTS postgis", []) + {:ok, _} = Postgrex.query(pid, "CREATE EXTENSION IF NOT EXISTS postgis", []) {:ok, _} = Postgrex.query(pid, "DROP TABLE IF EXISTS locations, geographies, location_multi", [])