Skip to content
@tugql

TugQL

An open, portable query language and structured query tree (TugQT) for relational, document, API, and graph-connected data.

TugQL

An open, portable query language and structured query tree (TugQT) for relational, document, API, and graph-connected data.

Website Specification License: Apache-2.0


What is TugQL?

TugQL (formerly known as DTQL) is a vendor-neutral query definition language designed to query disparate SQL, NoSQL, REST/GraphQL APIs, and graph-connected data sources without proprietary query lock-in.

It provides a dual representation with 1:1 lossless round-trip fidelity:

  1. TugQL (Text Syntax): A clean, human-friendly SQL-like query language designed for writing, editing, and interactive exploration.
  2. TugQT — Tug Query Tree (Structured Syntax): A declarative JSON/YAML representation of the parsed/canonical query tree. Perfect for version control, AST manipulation, automated policy evaluation, and execution across heterogeneous storage backends without requiring a bespoke DSL parser.

Core Repositories

Repository Purpose
tugql/tugql The canonical specification, JSON Schema (draft 2020-12), test vectors, and language documentation.
tugql/.github Community health files and organization profile.

Implementations & Ecosystem

TugQL is actively integrated across the open data stack:


Example: TugQL & TugQT

Human-friendly TugQL Syntax

FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.status == 'completed' AND o.total > 100
GROUP BY c.country
HAVING revenue > 1000
ORDER BY revenue DESC
SELECT
  c.country,
  COUNT(*) AS total_orders,
  SUM(o.total) AS revenue

Lossless TugQT (Tug Query Tree) in YAML

from:
  name: orders
  alias: o
join:
  - name: customers
    alias: c
    on:
      op: ==
      left: { field: o.customer_id }
      right: { field: c.id }
where:
  op: AND
  args:
    - { op: ==, left: { field: o.status }, right: { value: completed } }
    - { op: '>', left: { field: o.total }, right: { value: 100 } }
groupBy:
  - field: c.country
having:
  op: '>'
  left: { field: revenue }
  right: { value: 1000 }
orderBy:
  - field: revenue
    desc: true
columns:
  - field: c.country
  - aggregate: { function: count, args: [{ star: true }] }
    as: total_orders
  - aggregate: { function: sum, args: [{ field: o.total }] }
    as: revenue

Rebrand Notice

DTQL has been renamed to TugQL.

  • Canonical website: https://tugql.org
  • Former domain: dtql.org (permanently redirects to tugql.org)
  • Former repository: datatug/dtql (permanently redirects to tugql/tugql)
  • Query Language: TugQL
  • Query Tree Structure: TugQT

Resources & Links

Popular repositories Loading

  1. tugql tugql Public

    TugQL specification — an open, portable query language and structured query tree (TugQT) for relational, document, API, and graph-connected data.

    1

  2. .github .github Public

    Organization profile and global assets for TugQL

Repositories

Showing 2 of 2 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…