FIND YOUR NEXT FEW LINES

Results for “NULL”

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

100 snippets foundClear filters
TypeScriptSafe data handling

Read a nested optional value

Avoid dereferencing a missing nested object.

optional chaining✓ Tested
ReactGetting Started

Render nothing from an optional component

Render nothing from an optional component with a small React component and explicit browser behavior.

React✓ Tested
SQLText cleanup & matching

Treat an empty trimmed value as missing

SQL: NULLIF converts an empty string to NULL before a fallback is applied.

SQL✓ Tested
SQL ServerText cleanup & matching

Treat an empty trimmed value as missing

SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.

SQL Server✓ Tested
PostgresText cleanup & matching

Treat an empty trimmed value as missing

Postgres: NULLIF converts an empty string to NULL before a fallback is applied.

Postgres✓ Tested
SQLiteText cleanup & matching

Treat an empty trimmed value as missing

SQLite: NULLIF converts an empty string to NULL before a fallback is applied.

SQLite✓ Tested
JavaRecords & reliable control flow

Validate a required argument

Java: Use requireNonNull with a useful message at an API boundary.

Java✓ Tested
SQLSchema design & transactions

Add an optional field to an existing table

SQL: A nullable column permits existing rows to remain valid while data is filled later.

SQL✓ Tested
SQL ServerSchema design & transactions

Add an optional field to an existing table

SQL Server: A nullable column permits existing rows to remain valid while data is filled later.

SQL Server✓ Tested
PostgresSchema design & transactions

Add an optional field to an existing table

Postgres: A nullable column permits existing rows to remain valid while data is filled later.

Postgres✓ Tested
SQLiteSchema design & transactions

Add an optional field to an existing table

SQLite: A nullable column permits existing rows to remain valid while data is filled later.

SQLite✓ Tested
CDynamic memory & ownership

Allocate an independent copy of a C string

C: Include one extra byte for the terminating null character.

C✓ Tested