Results for “JSON & binary formats”
Small, practical examples. Search by task or narrow things down below.
Build a JSON array from rows
Aggregate ordered text values into JSON.
json_group_array✓ Tested
Check JSONB containment
Test whether an object contains a key-value pair.
jsonb✓ Tested
Check whether bytes contain valid JSON
Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.
Go✓ Tested
Check whether text is valid JSON
Reject malformed input before processing it.
json_valid✓ Tested
Compare binary buffers including zero bytes
C: memcmp checks an explicit byte length rather than stopping at a string terminator.
C✓ Tested
Copy a file in bounded binary chunks
C: Check read, write, and close errors while copying without loading the entire file.
C✓ Tested
Decode JSON into a typed struct
Decode JSON into a typed struct using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode a struct with JSON field names
Encode a struct with JSON field names using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode and decode binary data as Base64
Python: Use Base64 when a text format must carry bytes; it is encoding, not encryption.
Python✓ Tested
Expand a JSON array into rows
Iterate array elements using a table-valued function.
json_each✓ Tested
Extract a JSON field
Read a scalar value from JSON text.
json_extract✓ Tested
Fetch and display JSON
jQuery: getJSON parses a successful JSON response.
jQuery✓ Tested