Skip to content

Comment on A better SQL in 11 lines of code

Comments

This seems harder to read than SQL, and only less verbose if you assume that an SQL database would be built with Prela's limitations in mind, which doesn't feel like a reasonable assumption.

With some syntax sugar it looks almost exactly like SQL [1]. Here I’m showing the unsweetened edition for didactic purposes.

[1]: https://remy.wang/blog/prela.html

I think you'd want to format it like SQL blocks to separate various concepts and where data is coming from

    movie.with(
      company.s(country).eq("[us]"
    )
    .and(
      keyword.eq("character-name-in-title")
    )
    .select(
      title
      .and(
        cast.s(person).s(alias).s(text)
      )
    )
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.