Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

LINQ style queries in Squeal? #280

Copy link
Copy link
@echatav

Description

@echatav
Issue body actions

The question recently was asked at work:

Have you considered putting the select at the end instead of the beginning? C#’s LINQ ended up making that change in its approach to a SQL-like DSL. Not sure it would help but I was curious if you considered that approach or not.

I hadn't considered it at all but in fact, with more thorough use of the reverse function application operator (&), Squeal already supports this LINQ style:

-- LINQ style
from (table #scores)
  & where_ (#score .> 80)
  & groupBy #winner
  & select_
    ( #winner :*
      max_ #score `as` #best_score
    )

-- SQL style
select_
  ( #winner :*
    max_ #score `as` #best_score
  )
  ( from (table #scores)
    & where_ (#score .> 80)
    & groupBy #winner
  )
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.