Skip to main content
Just as object-oriented languages let you extend a class to inherit its properties, you can extend an existing Standard to create a new Standard that inherits all of the parent’s constraints. This lets you build on shared definitions without duplicating constraint declarations, keeping your schema DRY and consistent across related record types.

Extension Syntax

To extend a Standard, declare your new Standard name and reference as usual, then append a colon followed by the parent Standard’s reference prepended with @:
The new Standard inherits every constraint defined in the parent Standard. Your existing queries and references to the parent Standard are unaffected — extension creates a completely separate table.

Basic Example

A common use case is modeling different vehicle types. You can extend the base vehicle Standard to create a truck Standard that inherits all vehicle constraints:
With this single line, TRCK has all of the same constraints as VHLvin, make, model, and any others defined in vehicle — stored in its own dedicated table.

Adding Extra Constraints

You can give your extended Standard additional constraints by including a constraint block. The extended Standard will contain all parent constraints plus any new ones you define:
In this example, TRCK inherits all constraints from VHL and adds two more:
  • owner — a reference to a PER (person) Standard record, required on every truck.
  • max_weight — a double value representing the truck’s maximum weight, optional.
Use extension when two record types share a common structure but need to be queried and stored independently. Avoid extending a Standard just to add a single boolean flag — in that case, adding the constraint directly to the parent Standard may be cleaner.
Extension is not inheritance in the runtime sense — it copies the constraint structure at definition time. Changes to the parent Standard’s constraints after extension are not automatically reflected in the extended Standard.