Initial values and Default Database values
This page was created by Lars.olofsson@mdriven.net on 2024-01-16. Last edited by Stephanie@mdriven.net on 2025-03-13.

Property inspector for an modelled attribute

InitalValuesInPropertinspectorForAttribute.png

DefaultDbValue

Initial value used when evolving the database or creating the database. If the attribute is nullable, i.e. has Allow Null = true, the DefaultDbValue is not needed

This value should be in the format expected by the database engine.

Examples using SQL Server;

  • Non-nullable Decimal: 0
  • String: 'stringvalue' (quoted) (note: strings are always nullable if not using very old database types as char)

Initial value

Initial value used in-memory. Should be a value depending on type of attribute, or nothing/empty for null (if nullable).

Examples;

  • Non-nullable Boolean: false or true
  • Non-nullable Decimal: 0
  • String: stringvalue (no quotes)

Allow Null

Controls both the in-memory nullability and database attribute setting.

Please note! If this is false, most database engines require a DefaultDbValue to evolve the database. If no value is provided, the existing rows (objects) in database will get an invalid value and the evolve will fail.