Coder Social home page Coder Social logo

Query expressions about dapper.fsharp HOT 3 CLOSED

JordanMarr avatar JordanMarr commented on May 18, 2024
Query expressions

from dapper.fsharp.

Comments (3)

Dzoukr avatar Dzoukr commented on May 18, 2024 1

I like it.

I was imagining that the expression based select CE could require opening a separate namespace.

Yup, that's the way IMO. I think a separate module would be great.

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

Hmmmm. 🤔 Sounds interesting. Please, could you provide a short sample of how it would look like before I take a decision on this? I tend to have this library as simple as possible (for known reasons), but don't want to kill a good idea which could be a great "addon-to-an-addon" 😄

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 18, 2024

Sure!

Given this example:

select {
    table "Persons"
    where (gt "Position" 5 + lt "Position" 10)
} |> conn.SelectAsync<Person>

I was imagining something like this:

select {
    for p in tbl<Persons>()
    where (p.Position > 5 && p.Position < 10)
    orderBy p.LName
} |> conn.SelectAsync<Persons>

SqlHydra names records after the table and properties after the columns, so they should already match.
(The tbl<Persons>() is off the top of my head. There may be a cleaner way to do that. In fact it could maybe even just be tbl since the entity type can be inferred via conn.SelectAsync<Persons>.)

I was imagining that the expression based select CE could require opening a separate namespace.

That's the idea at least.. Of course all of this would need to pass a proof of concept phase on a very simple query before tackling the full query expression tree.

from dapper.fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.