Show HN: PRQL – A Proposal for a Better SQL

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • prql

    PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement

  • Yes, I agree with the downsides of the existing approach, and you're absolutely right re "Languages really should not have any implicit way of constructing identifiers".

    I'd still say it's fine if it implicitly names output columns, for convenience.

    I referenced your comment in an issue and listed some options: https://github.com/max-sixty/prql/issues/5

  • tresql

    Shorthand SQL/JDBC wrapper language, providing nested results as JSON and more

  • I'm really excited about languages that build on or are compiled to SQL, in the long-term (because I think it will take a very long time to build adoption).

    The ones that particularly excite me are shorthands for SQL, even though their heavy use of symbols may be a detriment. One particular use case is in easily defining authorization policies.

    I am not very excited by datalog/prolog-based languages because I think logic languages are too unnatural to ever go mainstream. But I'd be excited to be wrong or for logic languages to become more friendly.

    Here are some others I'm watching.

      * https://github.com/mrumkovskis/tresql

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • cytosm

    OpenCypher to SQL Mapper

  • * https://github.com/cytosm/cytosm

  • malloy

    Malloy is an experimental language for describing data relationships and transformations.

  • Thanks!

    I agree that integrating with the DB would allow much more from a lang. But PRQL is a bet that languages which start there (e.g Kusto) get lost because it requires changing DB, which is really hard. I worry EdgeDB may hit this issue too (but I'm really hoping it works, and they have an excellent team).

    As I think you're suggesting — you could imagine a language starting out as a transpiler, and then over time DBs working with it directly, cutting out some of the impediment mismatch.

    Malloy [1] is another point in space — it targets existing DBs through SQL queries but can also ask for schemas etc while developing.

    [1] https://github.com/looker-open-source/malloy

  • Sift

    Sift is a basic, Relational Algebra based query engine built on top of Apache Arrow. It draws inspiration from Andy Grove's KQuery. (by RCHowell)

  • Awesome! Would love to see an implementation. I worked on something similar over the Summer. It’s just relational algebra with pipes for composition. If you are interested, we could get an antlr grammar going and plug it into this basic execution engine to get a feel for the language.

    - https://github.com/RCHowell/Sift

  • BQL

    BQL: A Better Query Language, SQL Superset

  • I also saw a proposal for a better syntax for SQL, called BQL, that was a strict superset but allowed for better modularity

    http://intelligiblebabble.com/a-better-query-language-bql-la...

    It had this github repo https://github.com/lelandrichardson/BQL but never went anywhere

    I hope PRQL has a better fate!

  • libpg_query

    C library for accessing the PostgreSQL parser outside of the server environment

  • I like that everyone is trying to make something like SQL that reads more naturally to them. More alternatives is good! SQL is a widely accepted standard, and has strictly defined and super broadly accepted semantics.

    As someone who has written quite a few half-baked-for-general-use but fit-for-purpose SQL generator utilities over the years, I'll suggest that if you intend for a novel syntax to be a general SQL replacement then being isomorphic to SQL would massively increase usefulness and uptake:

    1. novel syntax to SQL; check! Now novel syntax works with all the databases!

    2. any valid SQL to novel syntax; a bit harder, but I'd start by using a SQL parser like https://github.com/pganalyze/libpg_query and translating the resulting AST into the novel syntax.

    3. novel syntax to SQL back to novel syntax is idempotent; a nice side effect is a validator/formatter for "novel syntax"

    4. SQL to novel syntax back to SQL is idempotent; a nice side effect is a validator/formatter for SQL, which would be awesome. (See also https://go.dev/blog/gofmt, which is where I learned this "round trip as formatter" trick.)

    I don't mean for this to sound negative, and I know that 2, 3, and 4 are kind of hard. Thank you for building prql!

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Preql

    An interpreted relational query language that compiles to SQL.

  • It seems people here are really interested in alternatives to SQL. So perhaps you'd also like to have a look at https://github.com/erezsh/Preql

    (Same name, same goal, different approach, and already working)

  • rfcs

    RFCs for major changes to EdgeDB (by edgedb)

  • EdgeQL is getting support for generic partitioning/aggregating `GROUP` very soon [1], so we are giving some love to the analytical side of things too :-)

    We definitely need more collective effort put into "Better SQL", so PRQL is a welcome sight!

    [1] https://github.com/edgedb/rfcs/blob/21e581a188715c6ff82944b6...

  • logica

    Logica is a logic programming language that compiles to SQL. It runs on Google BigQuery, PostgreSQL and SQLite.

  • Looks pretty cool. I'd be interested if the README had a comparison with Google's Logica (https://github.com/EvgSkv/logica)

  • spyql

    Query data on the command line with SQL-like SELECTs powered by Python expressions

  • I am writing a language and CLI that mixes SQL with Python (spyql: https://github.com/dcmoura/spyql), and it is interesting to see that we are tackling some of the same problems:

  • partiql-lang-kotlin

    PartiQL libraries and tools in Kotlin.

  • PartiQL[0] is an open source library that is a superset of SQL that I really like. It supports querying nested structures inside columns, so if a column contains some JSON data you can use the standard dot notation to query nested JSON data directly

    [0] https://partiql.org/

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts