- cross-posted to:
- programming@programming.dev
- cross-posted to:
- programming@programming.dev
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.
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() -> ...What do you think about ORMs?
I think that ORMs work great for 90% of cases, and abismally for the rest. They are also limited by the syntax and semantics of the language they are embedded in. For example, if you refer to a non-existing column, it would take a call to database to figure that out, and a cryptic error message with non-helpful code span.
I use prisma ORM with kysely Query Builder. Prisma has its own schema language that we write with great IDE support and provides a parser to generate type-safe clients. It gives you the ts client generator by default. But for example, kysely also needs types and somebody wrote a prisma-kysely generator, which generates types for kysely based on the prisma schema. Prisma since then also have Typed SQL (type-safe raw sql). (Although, I haven’t tried that yet.) So prisma can cover that missing 9% of cases, and there maybe 1% left for untyped raw sql.
Do you think Lutra can replace that 9+1% of cases? Or would it be also useful to write migrations in Lutra?

