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() -> ...