Skip to content

theduql/duql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DUQL

Dangerously Usable Query Language

What?

  • A YAML-based query language
  • Compiles to SQL & JSON
  • 100% open-source
  • An abstraction on top of the awesome PRQL project
  • As a result of being directly serializable to (understandable) JSON, great for building frontend query experiences

Priorities

  1. Definition in JSON Schema & Documentation [In Progress]
  2. Validation of translation to PRQL (and as a result SQL)
  3. Query Builder POC
  4. Tooling, etc.

Examples

DUQL vs. SQL

DUQL

basic-duql

SQL

basic-duql-sql-comparison

Advanced Query

duql-advanced

Why?

  • Balanced:
    • DUQL leverages YAML to strike a delicate balance between readability and verbosity.
  • Logical: SQL isn't structured to map well to how humans think about querying and transforming data.
    • DUQL is piped allowing you to think about transformations as sequential steps with clear "in" and "out".
  • The Alternatives:
    • SQL doesn't map well to how humans think about querying and transforming data
    • JSON is too verbose both when writing and reading
    • ORMs lock you into a specific programming language
    • PRQL queries become harder to read as queries become more complex
  • Modern:
    • Queries will increasingly be generated by LLMs, not written; and DUQL is designed to maximize readability.
    • Validating a query and understanding how it works has never been easier.

Install

macOS

Install via Brew:

brew tap theduql/duql
brew install duql

Linux

Run the following command in your terminal:

curl -fsSL https://raw.githubusercontent.com/theduql/duql/main/install.sh | sh

Writing / Editing

Note

DUQL is 100% valid YAML. As a result, you can leverage all your awesome YAML extensions that exist today. We plan to support improved syntax highlighting for expression strings in a custom DUQL IDE extension at some point.

Usage

Coming Soon