Results for “default”
Small, practical examples. Search by task or narrow things down below.
Understand default zero values
Understand default zero values using a complete Go program with explicit sample inputs.
Go✓ Tested
Use a default value for an unset variable
Supply a fallback without changing the original variable.
parameter expansion✓ Tested
Block deletion of a referenced parent
SQL: The default foreign-key action prevents deletion while a child still refers to the parent.
SQL✓ Tested
Block deletion of a referenced parent
SQL Server: The default foreign-key action prevents deletion while a child still refers to the parent.
SQL Server✓ Tested
Block deletion of a referenced parent
Postgres: The default foreign-key action prevents deletion while a child still refers to the parent.
Postgres✓ Tested
Block deletion of a referenced parent
SQLite: The default foreign-key action prevents deletion while a child still refers to the parent.
SQLite✓ Tested
Enforce a bounded numeric range
SQL: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQL✓ Tested
Enforce a bounded numeric range
SQL Server: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQL Server✓ Tested
Enforce a bounded numeric range
Postgres: A named CHECK constraint keeps numeric values inside an inclusive interval.
Postgres✓ Tested
Enforce a bounded numeric range
SQLite: A named CHECK constraint keeps numeric values inside an inclusive interval.
SQLite✓ Tested
Initialize a map entry only when absent
Java: Use computeIfAbsent when creating a collection for a new key.
Java✓ Tested
Keep children while clearing a deleted relationship
SQL: ON DELETE SET NULL requires a nullable foreign-key column.
SQL✓ Tested