dbeaver/pro#6505 adds min value for object property info (#4565)

* dbeaver/pro#6505 adds min value for object property info

* dbeaver/pro#6605 implements constraints interface

* dbeaver/pro#6505 uses only min/max property constraints

---------

Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: Ainur <59531286+yagudin10@users.noreply.github.com>
This commit is contained in:
sergeyteleshev
2026-08-20 13:01:06 +02:00
committed by GitHub
co-authored by Evgenia Ainur
parent 50f6835caf
commit 2650b4dccd
5 changed files with 28 additions and 1 deletions
@@ -27,6 +27,7 @@ import org.jkiss.dbeaver.model.impl.PropertyDescriptor;
import org.jkiss.dbeaver.model.impl.ProviderPropertyDescriptor;
import org.jkiss.dbeaver.model.meta.IPropertyValueListProvider;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.meta.PropertyConstraints;
import org.jkiss.dbeaver.model.meta.PropertyLength;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
@@ -139,6 +140,12 @@ public class WebPropertyInfo {
return defaultValue;
}
@Nullable
@Property
public PropertyConstraints getConstraints() {
return property instanceof ObjectPropertyDescriptor descriptor ? descriptor.getConstraints() : null;
}
@Nullable
@Property
public Object getValue() throws DBException {
@@ -25,6 +25,8 @@ type ObjectPropertyInfo {
validValues: [ Object ]
"Default property value"
defaultValue: Object
"Constraints for the property value"
constraints: PropertyConstraints @since(version: "26.2.0")
"Property value length"
length: ObjectPropertyLength!
"List of supported features (e.g., system, hidden, inherited, foreign, expensive)"
@@ -41,6 +43,13 @@ type ObjectPropertyInfo {
conditions: [Condition!] @since(version: "25.0.1")
}
type PropertyConstraints @since(version: "26.2.0") {
"Minimum allowed value for numeric properties"
min: Float
"Maximum allowed value for numeric properties"
max: Float
}
enum ObjectPropertyLength {
"1 character"
TINY,
@@ -924,4 +933,3 @@ extend type Mutation {
"Get async task info by ID"
asyncTaskInfo(id: String!, removeOnFinish: Boolean!): AsyncTaskInfo!
}
@@ -305,6 +305,8 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
<InputField
required={required}
type={type}
min={property.constraints?.min}
max={property.constraints?.max}
title={isPassword ? property.description || property.displayName : undefined}
labelTooltip={property.description || property.displayName}
name={property.id!}
@@ -328,6 +330,8 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
<InputField
required={required}
type={type}
min={property.constraints?.min}
max={property.constraints?.max}
title={isPassword ? property.description || property.displayName : undefined}
labelTooltip={property.description || property.displayName}
name={property.id!}
@@ -9,6 +9,10 @@ query getEngineProperties($engineId: ID!, $profileId: ID, $settings: AIEngineCon
required
dataType
defaultValue
constraints {
min
max
}
validValues
length
features
@@ -9,6 +9,10 @@ fragment ObjectPropertyInfo on ObjectPropertyInfo {
value
validValues
defaultValue
constraints {
min
max
}
length
features
order