MerginMaps / MerginMaps/mobile

Support for PostgreSQL Arrays is missing for Value Relation multiple selection

Open
#3,859 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

Using a Value Relation Widget with the option Allow multiple selections works both in QGIS Desktop and Mergin maps app, in a PostgreSQL table as long as the field type is a varchar with enough size for storing a list of values separated by commas.

On the other hand, QGIS Desktop also works fine if the field column is an array of values, like a _varchar.

Mergin maps app doesn't seem to be ready for it yet. Although it looks good in the interface, showing all possible values and even showing previous selections, once you modify a value and save it, the database "stores" a NULL value instead of the selected values.

On PostgreSQL side, having an array allows better management of the list of values, powered by a good set of functions, so I think it would be interesting to be supported also by mergin maps.

Thanks for all your work!

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

Reproduce the issue with a Value Relation Widget, multiple selections enabled, and a PostgreSQL array column, comparing behavior before and after saving in Mergin Maps. Trace the mobile app's value serialization and save path for array fields. Done means selected values persist instead of being stored as NULL.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.