A NOT NULL constraint requires every row in a database column to contain a non-null value.
A NOT NULL constraint requires a database column to contain a value for every inserted row. In the course schema, tutor_id and course_name cannot be omitted; optional columns remain nullable. section 6.2.1
Course table
The ezy_course_c6 definition marks tutor_id and course_name as INT not null and varchar(140) not null. course_description and other unmarked fields remain optional, matching Option<T> fields in the Rust Course struct. section 6.2.1
How Rust Servers, Services, and Apps covers it
How deep it goes
Defines required columns in SQL and aligns them with non-optional Rust fields, without detailing constraint internals.
Examples
Uses tutor_id and course_name in the ezy_course_c6 SQL table, with psql commands for execution and inspection.
What it assumes
Assumes corresponding Course, CreateCourse, and UpdateCourse structs and a physical database table.
What you can do after
Operate/configure a SQL schema with required columns and verify it through psql.
constraintkind of · A constraint is a condition or rule that restricts the permissible states, values, actions, or solutions in a system or problem.
data integrityproduces · Data integrity is the property that data remains accurate, complete, consistent, and valid, with changes made only through authorized actions.
missing valuecontrasts with · A missing value is a marker or condition indicating that an expected data value or reference is absent, unavailable, unknown, or inapplicable.
default valuecontrasts with · A default value is a predefined or automatically supplied value used when an expected input, argument, field, or configuration setting is omitted or unspecified.
primary keyconfigured by · A primary key is a designated column or attribute, or combination of them, that uniquely identifies each row or item in a table or data store.
This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.