TypeDB distinguishes missing data from stored nulls: entities, relations, and attributes are never stored as “absent”; instead, a query may leave a variable unset when a pattern has no match. Since version 3.4, optional matching has allowed one query to return both companies with office addresses and those without them. Initially, however, using an optional variable implicitly discarded rows where it was empty. That convenience could silently change a query’s results, and offered no way to branch on whether a value was missing. Unlike SQL’s nulls and three-valued logic, TypeDB models emptiness as a typed None value, which can appear alongside ordinary types in a variable’s type union.
TypeDB 3.15 replaces implicit handling with explicit checks so that optionality must be addressed wherever it affects results. The system now warns about deprecated uses, including patterns that silently exclude rows. In read patterns, an isset constraint lets queries require that an optional variable has a value; expressions can use question-mark short-circuiting to propagate emptiness rather than treating it as an ordinary value. Conditional operators in write clauses allow updates to take different actions depending on whether a variable is set, addressing cases that previously could not be expressed cleanly. The change aims to make query behavior more predictable, catch mistakes earlier, and support more composable reads and updates.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.