FIND YOUR NEXT FEW LINES

Results for “default”

Small, practical examples. Search by task or narrow things down below.

239 snippets foundClear filters
GoGetting Started

Understand default zero values

Understand default zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsVariables & text

Use a default value for an unset variable

Supply a fallback without changing the original variable.

parameter expansion✓ Tested
SQLConstraints & defaults

Block deletion of a referenced parent

SQL: The default foreign-key action prevents deletion while a child still refers to the parent.

SQL✓ Tested
SQL ServerConstraints & defaults

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
PostgresConstraints & defaults

Block deletion of a referenced parent

Postgres: The default foreign-key action prevents deletion while a child still refers to the parent.

Postgres✓ Tested
SQLiteConstraints & defaults

Block deletion of a referenced parent

SQLite: The default foreign-key action prevents deletion while a child still refers to the parent.

SQLite✓ Tested
SQLConstraints & defaults

Enforce a bounded numeric range

SQL: A named CHECK constraint keeps numeric values inside an inclusive interval.

SQL✓ Tested
SQL ServerConstraints & defaults

Enforce a bounded numeric range

SQL Server: A named CHECK constraint keeps numeric values inside an inclusive interval.

SQL Server✓ Tested
PostgresConstraints & defaults

Enforce a bounded numeric range

Postgres: A named CHECK constraint keeps numeric values inside an inclusive interval.

Postgres✓ Tested
SQLiteConstraints & defaults

Enforce a bounded numeric range

SQLite: A named CHECK constraint keeps numeric values inside an inclusive interval.

SQLite✓ Tested
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
SQLConstraints & defaults

Keep children while clearing a deleted relationship

SQL: ON DELETE SET NULL requires a nullable foreign-key column.

SQL✓ Tested