v.22.6Improvement

Support NULL/NOT NULL in column declaration

Allows providing NULL/NOT NULL right after type in column declaration. #37337 (Igor Nikonov).
Allows specifying NULL or NOT NULL directly after the type in column declarations.

Why it matters

This feature improves schema clarity and enforcement by enabling explicit NULL or NOT NULL constraints immediately following the data type in table definitions. It helps users define column nullability in a more intuitive and straightforward way, enhancing data integrity.

How to use it

When declaring a column in a table schema, specify the nullability directly after the type, for example:

CREATE TABLE example (
column_name <code>Nullable(Int32)</code> <code>NULL</code>,
another_column <code>String</code> <code>NOT NULL</code>
) ENGINE = ...


This syntax explicitly declares whether the column allows NULL values or not.