FIND YOUR NEXT FEW LINES

Results for “Encoding & structured values”

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

391 snippets foundClear filters
PostgresConstraints & defaults

Make a pair of columns unique together

Postgres: A composite primary key permits repeated individual values while forbidding a duplicate combination.

Postgres✓ Tested
SQLiteConstraints & defaults

Make a pair of columns unique together

SQLite: A composite primary key permits repeated individual values while forbidding a duplicate combination.

SQLite✓ Tested
SQLGetting Started

Match one value from a short list

SQL: Use IN for a set of allowed values.

SQL✓ Tested
SQL ServerGetting Started

Match one value from a short list

SQL Server: Use IN for a set of allowed values.

SQL Server✓ Tested
PostgresGetting Started

Match one value from a short list

Postgres: Use IN for a set of allowed values.

Postgres✓ Tested
SQLiteGetting Started

Match one value from a short list

SQLite: Use IN for a set of allowed values.

SQLite✓ Tested
TypeScriptTypes & functions

Narrow a union using typeof

Handle text and numeric values with separate branches.

union✓ Tested
PostgresWindows & text

Number rows within each group

Assign ordered row numbers with a window function.

row_number✓ Tested
C#Asynchronous work & URI handling

Parse a GUID without an exception

C#: TryParse reports malformed values with a boolean return.

C#✓ Tested
PythonJSON & CSV

Parse a JSON string

Convert a JSON string into a Python dictionary and read values by key.

json✓ Tested
C#Types & reliable control flow

Parse an enum name without throwing

C#: Combine TryParse and IsDefined when only named declared values should be accepted.

C#✓ Tested
JavaStream transformations

Partition a collection by a predicate

Java: Use partitioningBy to retain both matching and nonmatching values.

Java✓ Tested