Code Monkey home page Code Monkey logo

exprelsior's People

Contributors

alexmurari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

exprelsior's Issues

Brackets to group expressions doesn't seem to work

I am building a query with several AND and OR and I want to use brackets to group some expressions. My expression is the following :

eq('CodePropriete', 'MH')+AND+(gt('NbPiedsParcelle', '2')+OR+gt('NbRangsParcelle', '2'))+AND+eq('Cepage', 'Chardonnay')

I would expect this to be translated to (CodePropriete = MH) AND (NbPiedsParcelle > 2 OR NbRangsParcelle > 2) AND Cepage = Chardonnnay but my tests suggests it is translated to ((((CodePropriete = MH) AND NbPiedsParcelle > 2) OR NbRangsParcelle > 2) AND Cepage = Chardonnnay).

Am I doing something wrong ?

"The LINQ expression could not be translated": string[] {}.Contains error if use as LINQ predicate

Hey there!

I've been giving such a heavy use to this useful and fantastic piece of software that I've been able to spot another issue.

Let me explain the scenario:

WHERE x IN ("M", "W")

As you can see in the image below, the expression cov('PlanGroup', ['W', 'M']) has been created to achieve a WHERE IN-like predicate.

image

Once built, I save the returned Expression in the filterExpression variable, as shown at line 55 in the image below.

image

That breakpoint doesn't tell us much about what's happening in the expression. That is why in the next image, I am showing the Debug View property in the Text Visualizer. It all looks in order.

image

However, once is executed in the LINQ Where method, an exception is raised:

image

Is there something I am missing, like configurations or similar? or is it just something out of the scope of the library? Let me know if more information is needed.

I am using Entity Framework Core and Pomelo to query a MySQL database:

image

Just to mention that when an expression is built with the comparison operator cov but with an int[] type value, everything works fine.

Trying to debug by myself

As I faced this issue, I tried to debug it myself to contribute to such a useful tool. However, this error message was preventing me from building the solution.

image

"Invalid property name/path" with int? type when building an Expression with `The Query Syntax`

Hey there!
Thanks for making such a useful tool! I discovered it the last month, I have been using it since.

However, I am finding some issues while working with the int? type.

image

According to the documentation, there is no distinction between the properties of different types while creating a query (https://github.com/alexmurari/Exprelsior#elements-syntax), I guess the type is inferred by the generic type given to the CreateBinaryFromQuery method.

It is also important to mention that if I use the CreateBinary method to create the same expression, it gets created without problems:

image

It's not visible in the image, but the type of the Po prop which is member of the class VwNcrViewLog is int?.

Am I missing something by working with int and int? values?

Thanks in advance!

suggestion: set the optional "name" property when creating an Expression.Parameter

First, thank you so much for publishing this project, I was looking for a lightweight way of passing and building filters and this is a great solution.

The name property of the Parameter constructor is optional but I was using this to build filters for an app using MongoDB Driver for C# and it required the name property to be set for some reason.

https://docs.microsoft.com/en-us/dotnet/api/system.linq.expressions.expression.parameter

in ExpressionBuilder\ExpressionBuilder.cs line 170 change from:

var param = Expression.Parameter(typeof(T));

to

var param = Expression.Parameter(typeof(T), propertyNameOrPath);

cannot use enum as search field

if your object has an enum value it cannot be used as a search term, you get an error stating you cant compare string to int.

I am starting to look into where/how to add the type checking for enum values any ideas?

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.