sofwerx / cdb2-concept

CDB modernization
0 stars 1 forks source link

Text Attribute Minimum Length #26

Open UnclePoole opened 3 years ago

UnclePoole commented 3 years ago

The CDB 1.1 standard specifies text attributes to have a maximum text length, which is typically important for specially formatted text fields.

There is no corresponding minimum text length definition. The proposed CDB X attribute constraint mechanism can provide one. Should this be done? If so, should this also be added as a backward compatible XML element to the existing CDB 1.x XML metadata?

cnreediii commented 3 years ago

Others will need to weigh in, but this seems reasonable to me.

ryanfranz commented 3 years ago

Is there a benefit for a minimum length of a text field? I would assume that if the field isn't the max length, you could easily just make it the length of the longest text attribute in the file. I don't know if forcing the field to be longer than necessary is useful or not...

UnclePoole commented 3 years ago

@ryanfranz At the logical level I'm not concerned about actual physical column width, that's an artifact of .dbf and SQL physical encoding and might not even be relevant for alternate encodings like gltf. The main use case at a logical constraint level is for formatted text that's expected to implement a particular pattern such as a date string or an external codelist.

GGDM and NAS does not have a minimum text length so it may be unnecessary to include this, particularly since the text pattern constraint (a separate ticket) more precisely handles the use case for formatted text.