Dev Helpers

SQL / Data cleaning

Build a quoted SQL literal for inspection

Dev Helpers · May 6, 2026

Quoting a value can help inspect how SQLite represents it as a literal. Application queries should still pass user values as bound parameters.

Worked example

SELECT quote('O''Brien') AS literal;

Result

[
  {
    "literal": "'O''Brien'"
  }
]

Implementation notes

SQL quoting conventions are for SQL literals. A value printed for diagnostics still needs separate escaping if it will appear inside HTML or another output format.

Try it yourself

Inspect a value containing an apostrophe and one containing NULL.

Open the SQL example →

Editorial date May 6, 2026 · Published December 6, 2026

Related articles

Compare two literal lists

Set operations compare rows under SQL's rules for duplicates. Check whether the result represents membership or the number of occurrences.

Count jobs per active day

Grouping timestamps by day produces counts only for days present in the data. A continuous chart may need a calendar series as well.