Skip to main content

Module datasource

Module datasource 

Source
Expand description

Named datasources — connect to multiple backends via dsn:name in fetch directives.

Datasources are configured in [datasources.*] sections of what.toml and accessed in templates using the dsn: prefix:

  • dsn:name.collection — DB types (D1, Supabase, SQLite): query a collection
  • dsn:name/path — API type: append path to base URL with configured headers
  • dsn:name — Root: DB types return all data; API types hit the base URL

Enums§

Datasource
A resolved datasource instance, ready for queries.
DsnTarget
Target parsed from a dsn: URL — determines what to fetch from the datasource.

Functions§

parse_dsn
Parse a dsn: URL into a datasource name and target.