Skip to content

QUERY_STRING_NULL_HANDLING

Control how NULL values are interpreted in query string parameters.

Keywords

query_string_null_handling, query_null_handling, query_string_null, query_null

Syntax

query_null <mode>
query_string_null_handling <mode>

Values

ValueDescription
empty_stringEmpty value (?param=) treated as empty string
null_literalString "null" treated as NULL
nullSame as null_literal
ignoreEmpty values are ignored
empty_keyKey without value (?param) treated as NULL

Examples

Treat Empty as Empty String

sql
comment on function search(_query text) is
'HTTP GET
query_null empty_string';

GET /search?_query=_query = ''

Treat "null" String as NULL

sql
comment on function get_data(_filter text) is
'HTTP GET
query_null null_literal';

GET /get-data?_filter=null_filter = NULL

Empty Key as NULL

sql
comment on function optional_param(_value text) is
'HTTP GET
query_null empty_key';

GET /optional-param?_value_value = NULL

Released under the MIT License.