{
  "id": 22785266,
  "title": "The `template` Data Type in ThingsDB",
  "url": "https://urgent.news/2026/11/30/the-template-data-type-in-thingsdb",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-30T13:44:28.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/joente/the-template-data-type-in-thingsdb-4875"
  },
  "original_language": null,
  "account": "The `template` data type in ThingsDB is a recent addition that provides first-class support for template strings. These templates can be validated, stored, and rendered efficiently. To create a template, the `template()` function is used, which parses and validates the template syntax immediately upon creation, catching errors like unclosed braces or invalid expressions upfront. The rendered template can then be generated on demand using the `.render()` method, which accepts any thing whose properties are valid variable names, including plain objects or typed instances. This integration with ThingsDB's type system allows for automatic conversion and validation of plain strings into templates when defining custom types. The `template` type also comes with built-in helper functions such as `is_template()`, `template.len()`, and `str(tpl)`, providing additional functionality for working with templates. Safety features include up-front syntax validation, recursion protection, and context validation to prevent malformed or unsafe templates from being executed.",
  "summary": "ThingsDB has long supported template strings using backtick syntax ( `Hello {name}!` ). While convenient for inline string interpolation, template strings are evaluated immediately at runtime, which means you couldn't store them in a collection, attach them to a typed model, or render them repeatedly across different contexts without manual string building. With the addition of the new template…",
  "summary_source": "publisher",
  "key_points": [
    "template data type supports template strings in ThingsDB",
    "Templates validated, stored, and rendered efficiently",
    "Rendered using .render() method with valid variable names"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}