this post was submitted on 24 Dec 2025
22 points (92.3% liked)

Programming

24097 readers
244 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

For the last year, I've been working on a query language that aims to replace SQL and data frame libraries. It's continuation of my work on PRQL and EdgeQL.

Now I need feedback on usability, ergonomics and overall design. Read trough the examples, check out the CLI & tell me what could be better.

top 4 comments
sorted by: hot top controversial new old
[–] atzanteol@sh.itjust.works 10 points 5 days ago (1 children)

Looks like an ORM? I used to use these a lot but these days I just write SQL. Far too many performance issues and fighting with a library to do what I could just write in SQL in 5 mins. Type safety doesn't really seem like a big sell here. Most SQL libs already let you "getInt()".

[–] verstra@programming.dev 1 points 4 days ago

Haven't thought about but yes - it solves a few of the same problems as ORMs. Maybe the front page does not mention it, but with Lutra, you don't get result.getInt(). You get generated Python classes / Rust structs that reflect the Lutra types.

[–] entwine@programming.dev 2 points 4 days ago (1 children)
func get_album_by_id(album_id: int16): Album -> (
  get_albums()
  | find(func (this) -> this.id == album_id)
)

I'll admit I'm not a database guy, but isn't this inefficient? It looks like it's first querying the DB for all albums, then filtering the results in the interpreter. I assume the db engine has a more optimal implementation for when you do SELECT WHERE query, designed for whatever data structures it's using internally.

Also, minor nitpick but why does it have so many different ways to define a function body?

func something() -> { ... }
func something() -> ( ... )
func something() -> ...
[–] verstra@programming.dev 2 points 2 days ago* (last edited 2 days ago)

Two great questions!

First one comes down to how database query optimization and predicate pushdown in particular. In this case, albums would probably have an index on albums.id column, which would optimize get_album_by_id into a single index lookup. Ideally, I would want to have an explicit function for this, something like sql::from_index("albums", "id", 3), but there is no such thing as explicit index lookup in PostgreSQL right now.

Regarding different function syntaxes:

  • curly braces { ... } construct a new tuple (think object, struct, record),
  • parenthesis are used for precedence. They are not strictly needed for function bodies, but they do give a better visual guide to multi-line definitions, especially when using pipe operator.

So:

func something() -> { ... }  # constructs a new tuple
func something() -> ( ... )  # returns a value
func something() -> ...      # equivalent to ( ... )