Skip to content

feat: pql#1532

Open
BobdenOs wants to merge 12 commits intomainfrom
feat/pql
Open

feat: pql#1532
BobdenOs wants to merge 12 commits intomainfrom
feat/pql

Conversation

@BobdenOs
Copy link
Contributor

@BobdenOs BobdenOs commented Mar 6, 2026

This PR adds a long requested feature to produce human readable statements. With the combined complexity of real cqn queries and the restrictions that sql statements have. The resulting real sql statements produce angst and/or confusion in application developers. Therefor the introduction of pql which is a pseudo query language that looks like sql, but ignores some of the major restrictions sql enforces. The primary restriction is scalar sub selects in pql this is ignored and allows expand queries to be rendered in its principle form. Removing a large amount of visual clutter that prevent sql statements from being easily readable.

SELECT`from ${Books} {ID, title,  author { name, count(books.ID) }}`.toPql()
SELECT 
  ID, title, (
    SELECT 
      author.name, count(books2.ID) as count
    FROM sap_capire_bookshop_Authors as author left JOIN sap_capire_bookshop_Books as books2 ON books2.author_ID = author.ID
    WHERE Books.author_ID = author.ID
    LIMIT 1
  ) as author
FROM sap_capire_bookshop_Books as Books

Possible names for pql:

  • pseudo query language
  • people query language
  • pretty query language (subjective)

@BobdenOs BobdenOs marked this pull request as ready for review March 13, 2026 10:36
@BobdenOs BobdenOs enabled auto-merge (squash) March 13, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants