Replacing implicit optionals with a None type in TypeDB
TypeDB 3.15 is replacing implicit optional variable handling with a native, explicit None type integrated into its union-of-types query model.
summary is enough While interesting for language design fans, database engineers can quickly grasp the core mechanics through the summary without reading the full blog post.
summary
TypeDB has deprecated its implicit optional variable matching in version 3.15 in favor of an explicit built-in None type. Previously, auto-unwrapped optionals could silently alter query result sets and make conditioning on emptiness impossible. The new semantics integrate None into TypeDB's union-of-types model, requiring explicit checks via isset constraints and conditional write clauses. This design eliminates three-valued logic and enforces compile-time safety similar to Rust or Kotlin's Option types.
key points
- TypeDB 3.15 replaces implicit optional unwrapping with a built-in None type that participates directly in the union-of-types model.
- New query constructs include isset constraints for read pattern filtering and if conditional operators to manage optionals safely in write clauses.
- The change prevents implicit query result changes and allows developers to explicitly condition logic on whether variables are empty.
who should read it
Database developers and language designers interested in type systems and null-safety semantics.
discussion positive
Hi HN, I work on TypeDB. We recently made a major architectural change to our query language and type system: stripping out implicit optionals and introducing an explicit None type.
Historically, implicit optionals in our schema design caused a few recurring headaches—most notably not being able to switch on emptiness, and queries silently changing behavior when an existing variable was made optional.
We looked at how functional languages handle this with explicit Option/None types and decided to bring that strictness to the database level. We actually ended up borrowing the most from …
The author provides a concise overview of why the architectural shift was necessary to prevent silent query changes.
Generated by an LLM from the article and thread. Check the sources before relying on it.