-
Notifications
You must be signed in to change notification settings - Fork 7
Multi value text choices #7323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Multi value text choices #7323
Conversation
| protected void setValue(ObjectProperty property, Object value) | ||
| { | ||
| throw new UnsupportedOperationException("TODO MultiChoice"); | ||
| if ((value instanceof java.sql.Array array)) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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[].
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