Giter Site home page Giter Site logo

Comments (2)

Thorium avatar Thorium commented on June 19, 2024 1

The error you pasted is FS3125, which is F# error, not SQLProvider error. As far as I know, the main limitation and issue is dotnet/fsharp QueryBuilder, not SQLProvider. I've been trying to get them extend the QueryBuilder in the past, but it seems not to be their target.

If the QueryBuilder would support it, the addition to SQLProvider side could be quite easy:
The type LinkData would need to carry some kind of "what" operations (and or or, and equal, not-equal, greater-than, etc.) as currently it does AND equals only, like this:

  ~~  (String.Join(" AND ", (List.zip data.ForeignKey data.PrimaryKey) |> List.map(fun (foreignKey,primaryKey) ->
      sprintf "%s = %s"
          (fieldNotation (if data.RelDirection = RelationshipDirection.Parents then fromAlias else destAlias) foreignKey)
          (fieldNotation (if data.RelDirection = RelationshipDirection.Parents then destAlias else fromAlias) primaryKey)
      ))))

There are 2 workarounds here:

  • Depending on your case, maybe you can do just something like this:
for d in ds do
join e in (!!) es on (d.id = e.id)
join s in (!!) ss on (d.id = s.id)
for g in gs do 
where (e.group = g.group || s.group = g.group)
  • Or if your F# goes too complex, it's probably better to do a view and then just query that from SQLProvider like any other table.

from sqlprovider.

64J0 avatar 64J0 commented on June 19, 2024

Got it, thanks for the fast reply.

I'll move on with some of the workarounds then.

from sqlprovider.

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.