typelevel / typelevel/doobie

PostGIS issues with 0.6

Open
#900 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2.2k
Forks
379
Avg merge
14m
Merged PRs (30d)
8

Description

When using this method to fetch a table entry with a MultiPolygon field:

override def fetch(id: model.SubmarketId): F[Submarket] =
    selectById(id)
      .query[Submarket]
      .unique
      .transact(xa)

I get the following error:
doobie.util.invariant$InvalidObjectMapping: SQL object of class org.postgresql.util.PGobject cannot be cast to mapped class org.postgis.PGgeometry.

Is it possible that this is a compatibility issue with Postgres 10? This repo is also using Postgis and doobie 0.6

Here is the Submarket case class for reference:

final case class Submarket(
  id: SubmarketId,
  name: NonEmptyString,
  shape: MultiPolygon,
  marketId: MarketId
)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the fetch method using selectById, query[Submarket], and unique, then inspect how the MultiPolygon shape is mapped with doobie 0.6, PostgreSQL 10, and PostGIS. Reproduce the PGobject-to-PGgeometry error and determine whether the mapping works for the shown Submarket case class.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, scala
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.