pub(crate) enum FieldNullInterpretation {
Distinct,
NotDistinct,
NotNull,
}
Expand description
How to interpret missing value (NULL
) or assert that value must
always be present.
Variants§
Distinct
Missing value (NULL
) are allowed multiple times in unique
index (PostgreSQL NULLS DISTINCT
, Java RecordLayer
Evaluated.Nullstandin.NULL
,
RecordMetaDataProto.Field.NullInterpretation.NOT_UNIQUE
).
This is the default for PostgreSQL and Java RecordLayer.
NotDistinct
Missing value (NULL
) cannot be repeated in a unique
index (PostgreSQL NULLS NOT DISTINCT
, Java
RecordLayer Evaluated.Nullstandin.NULL_UNIQUE
,
RecordMetaDataProto.Field.NullInterpretation.UNIQUE
).
This is very restrictive as a column can have only one NULL
value.
NotNull
Field is not NULL
(PostgreSQL NOT NULL
).
Note: Here we are following PostgreSQL semantics and not
Java RecordLayer semantics. In Java RecordLayer
Evaluated.Nullstandin.NOT_NULL
and
RecordMetaDataProto.Field.NullInterpretation.NOT_NULL
means
when a field is missing, the Protobuf default value for that
field is returned. In our case, all fields have presence
information. The field must be present, and we return that
value. When NotNull
variant is specified, and the field is
not present, it is an error.