Skip to content

Custom Geography type doesn't work with jest and/or batch inserts #1841

@darkbasic

Description

@darkbasic

Describe the bug
I have a Geography type ported from an old v3 codebase: https://github.com/darkbasic/mikro4-geog-repro/blob/master/src/mikro-orm/types/Geography.ts
It used to work well in v3 and it still does in v4, except in tests and when using batch inserts.

Note: I'm aware of https://mikro-orm.io/docs/custom-types#advanced-example---pointtype-and-wkt and I will definitely get rid of Knex.raw later.

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/darkbasic/mikro4-geog-repro
  2. yarn
  3. yarn docker (requires docker and docker-compose)
  4. yarn start:docker (everything will work)
  5. yarn test:docker (it won't work because it will fire an update query after the insert)
  6. yarn start:docker --batch-insert (it won't work either)

Expected behavior
It used to work with v3 and I find strange that it doesn't in v4.

Versions

Dependency Version
node v12.22.1
typescript 4.2.4
mikro-orm 4.5.5
pg 8.6.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions