TugQL

TugQL FAQ

Answers about the DTQL rename, TugQT, SQL-like syntax, backend support, schemas and where to try a query.

Why did DTQL become TugQL?

DTQL is the former name. TugQL is the canonical name of the SQL-like query language, and TugQT names its structured query tree. The specification repository records the rename. On 10 November 2026, http://dtql.org/ returned a 301 to https://tugql.org/.

Is TugQL SQL?

TugQL has an SQL-like text form, but it is not a PostgreSQL or SQLite dialect and is not raw SQL sent to a database. Its structured form can be resolved to a DALgo query. A feature must be supported by the chosen implementation and backend; unsupported constructs should fail explicitly. See the syntax cheat sheet.

What is TugQT?

TugQT is the structured YAML/JSON query tree associated with TugQL. It can be saved, reviewed and diffed as data. The Go library also publishes a JSON Schema for its YAML serialization of the core relational read-only subset. That schema is distinct from the versioned trees used by text authoring parsers. See the TugQT guide and specification snapshot.

Does the same query work on every backend?

Portability is a goal of the language, but backend capabilities and adapter coverage vary. DALgo has paths for Git-backed, SQLite, PostgreSQL and Firestore data; a query that runs with one adapter is not proof that every adapter accepts it. Check the relevant adapter capabilities and test the exact query on each target.

Can a query read more than one database?

Yes, when the executing tool supplies the database bindings and federated execution path. Declare database aliases, qualify sources with alias::, and state cross-database join conditions explicitly. The tool must check every source against its database access policy. See the Chinook and geo-ingitdb example.

Where can I try an example?

The connected example opens its exact TugQL text in DataTug. QueryDock is a separate SQL playground for PostgreSQL-compatible PGlite, SQLite and DuckDB; its present SQL editors should not be treated as TugQL execution.

All documentation