Pr

PreQL/Trilogy – A Higher-Level, Composable SQL

Hacker News

PreQL/Trilogy – A Higher-Level, Composable SQL

An open-source language implemented in Python that replaces the FROM/JOINs in SQL with a lightweight semantic layer and compiles to SQL against supported backends. Key features are: Reusability - semantic layer supports full reuse of calculations, CTEs, and even entire models through a lightweight python inspired import syntax. Simple - writing queries that combines data at different granularity is straightforward and avoids common error patterns. Easy to refactor - changing the way the semantic layer binds to the database doesn’t require you to rewrite your queries. You don’t need to codemod 100 ETL scripts to deprecate a table! Related packages [basic, links available from https://preqldata.dev/ ]: pypreql-etl -> basic DBT integration. pypreql-nlp -> obligatory GenAI integration. trilogy-studio -> electron IDE for running queries directly. trilogy-public-models -> common repository of public models (mostly BQ public datasets right now) that can be imported/queried. Differs from other approaches to make a modern SQL I’m aware of (links below) in that it attempts to embrace current SQL syntax, not replace it. Each of these linked projects has a distinct value proposition and is worth checking out on their own! Note: as you can see by names in the space, it turns out that I was not nearly as creative as I hoped with ‘PreQL’ as a ‘prequel/sequel’ play; PreQL/Trilogy is the intermediate Star Wars pun and it may migrate to just Trilogy (after the sequel!) to avoid confusion. Other SQL Replacements: Malloy (full rewrite, semantic focus) https://news.ycombinator.com/item?id=30053860 PRQL (pipelined SQL alternative, all new syntax) https://news.ycombinator.com/item?id=36866861 preql (much more ambitious, all new syntax) https://news.ycombinator.com/item?id=26447070 Things to do: - Define/implement better null handling - Rewrite some parsing/CLI in rust - More functions/backends, more window flexibility - Performance hooks/optimization

Share card

Actual performance

3points
5comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Hacker NewsStrong engagement from HN community · Strong signals: ide, pipe, io · Missing: https docs, excited, just released
80%80% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Indie HackersFits the IH revenue-focused audience · Strong signals: supports · Missing: reddit linkedin, podcasting, created
80%80% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Product HuntOn track for Day 1 leaderboard · Strong signals: model, new, models · Missing: mac, agents, macos
64%64% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
43%43% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
42%42% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Hi
Higher-level RabbitMQ library in Go49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Higher-level RabbitMQ library in Go

Hacker News1
fo
forthy2 – a higher level Forth-remix in C++37%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

forthy2 – a higher level Forth-remix in C++

Hacker News65
I
I Solved N Queens in SQL56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I Solved N Queens in SQL

Hacker News2
Li
Lithium::SQL C++17, Header Only MySQL and SQLite Connectors and ORM76%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lithium::SQL C++17, Header Only MySQL and SQLite Connectors and ORM

Hacker News2
Go
Go Fearless SQL67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Go Fearless SQL

Hacker News3
Mo
Mongita is to MongoDB as SQLite is to SQL77%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mongita is to MongoDB as SQLite is to SQL

Hacker News126
SQ
SQL Basics59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SQL Basics

Hacker News26
Qu
Querying OpenAPI Definitions with SQL59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Querying OpenAPI Definitions with SQL

Hacker News1
YA
YAML to SQL57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

YAML to SQL

Hacker News1
ca
can we get rid of SQL?67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

can we get rid of SQL?

Hacker News2