Skip to content

Conversation

@XingY
Copy link
Contributor

@XingY XingY commented Jan 12, 2026

Rationale

This PR adds support for multi-value text choice properties, enabling users to select multiple values for text choice fields. This functionality is controlled by an experimental feature flag and is only supported on PostgreSQL databases for data types that are backed by provisioned table.

Related Pull Requests

Changes

  • Added allowMultiChoiceProperties() method to various DomainKind implementations (DatasetDomainKind, ListDomainKind, DataClassDomainKind, SampleTypeDomainKind)
  • Implemented new array comparison operators (ARRAY_CONTAINS_ALL, ARRAY_CONTAINS_ANY, ARRAY_CONTAINS_NONE, ARRAY_MATCHES, ARRAY_NOT_MATCHES) for filtering multi-choice fields
  • Added support for PostgreSQL array types in SQL dialects and JDBC type handling
  • Updated frontend dependencies to version for @labkey/components and @labkey/api

This comment was marked as resolved.

protected void setValue(ObjectProperty property, Object value)
{
throw new UnsupportedOperationException("TODO MultiChoice");
if ((value instanceof java.sql.Array array))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we expect a limited number possible types for value we could assert here, or else maybe use MultiChoice.Converter.getInstance().convert()

{
if (value.toString().trim().isEmpty())
{
values.add(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we want this to be an zero-length list? e.g. return List.of()?

_register(new JSONTypeConverter(), JSONObject.class);
_register(new ShortURLRecordConverter(), ShortURLRecord.class);
_register(new ColumnHeaderType.Converter(), ColumnHeaderType.class);
_register(MultiChoice.Converter.getInstance(), MultiChoice.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiChoice.Array.class

{
elements[i] = jsonArray.get(i);
}
return new MultiChoice.Array(Arrays.stream(elements));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the right approach. I think we want to keep the distinction between PropertyType.MULTI_CHOICE and JdbcType.ARRAY. Otherwise, it might be confusing when connecting to tables that use ARRAY or even filtering on columns created using ARRAY[] SQL syntax which might not be text[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants