Giter VIP home page Giter VIP logo

Comments (17)

JordanMarr avatar JordanMarr commented on May 18, 2024 2

Yeah, it's an edge case for sure. It makes me feel indifferent to adding it.
Maybe a manual query is the way in this case (pardon the pun).

from dapper.fsharp.

kunjee17 avatar kunjee17 commented on May 18, 2024 1

@Dzoukr you can give a skip if you want. It's all good. I totally understand to keep things simple.

from dapper.fsharp.

kunjee17 avatar kunjee17 commented on May 18, 2024 1

I guess I agree with gentlemen here. @Dzoukr please do honor to close this issue.

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

Hi my friend! I am for any improvement, but just thinking about how it would work with existing code - ilike is unknown for other DBs, isn't it?

from dapper.fsharp.

kunjee17 avatar kunjee17 commented on May 18, 2024

@Dzoukr you might be right. It is supported by Postgresql and MSSQL but not by others. So, it is all up to you if you like to put it there or not. Else I ll just fall back to good old dapper.

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

I am just thinking about how to do it. It's always tricky to put something "only-somewhere-supported" into generic library. 🤔

from dapper.fsharp.

kunjee17 avatar kunjee17 commented on May 18, 2024

@Dzoukr just let me know. It is just once case where client wants that ilike should be there for comparison. Basically comparison should be case insensitive. If it can't be added with non-generic fashion then I ll close the issue.

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 18, 2024

I think the way to do it would be to create Provider specific modules.
For ex, MSSQL.ilike and Postgres.ilike.
They could go next to the other filter functions:

let like<'P> (prop: 'P) (pattern: string) = true

That way they wouldn’t be accidentally used for a Provider that doesn’t support them. Also, each provider’s name could vary if necessary. (For example, ms sql doesn’t refer to it as ilike.)

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

I think the way to do it would be to create Provider specific modules.

Hmmm... That seems to be the way. But we would have to add another case here anyway, wouldn't we?

from dapper.fsharp.

kunjee17 avatar kunjee17 commented on May 18, 2024

@Dzoukr yes we need to . That's why I told I can give quick PR. but as you said problem is. Postgresql and MSSQL are the only supporting that. So, how you bypass that here for eg. MySQL

| Like _ -> withField "LIKE"
.

We can surely ignore ilike for like if that is Ok. Then we can surely add iLike support.

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 18, 2024

ay. But we would have to add another case here anyway, wouldn't we?

Even easier would be to change it to this:

    | Like of caseInsensitive: bool * pattern: string

from dapper.fsharp.

JordanMarr avatar JordanMarr commented on May 18, 2024

One thing that it is a little confusing to me:
I thought that SQL Server LIKE defaulted to be case insensitive, but apparently it is based on the column:
https://stackoverflow.com/questions/14962419/is-the-like-operator-case-sensitive-with-sql-server

So I guess in terms of defaults, it would actually be inaccurate to say that SQL Server defaults to one or the other since it's not really controlled at that level.

This makes me think that your original idea of creating a separate DU case might be the better approach:

    | Like of string
    | ILike of string
module PostgresqlExtensions
 let ilike<'P> (prop: 'P) (pattern: string) = true 

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

I thought that SQL Server LIKE defaulted to be case insensitive, but apparently it is based on the column:

In such a case it's out of library control, so I wouldn't bother... 😄

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

Maybe a manual query is the way in this case (pardon the pun).

Yeah, I have the same feeling right now. It would be the first provider-specific thing on syntax level and I still find it somehow "dirty" (cannot explain why, just gut feeling)...

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

🤣 Honor to close the issue... God I love this community 😄 ❤️

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

Adding this for v4 now

from dapper.fsharp.

Dzoukr avatar Dzoukr commented on May 18, 2024

Now available in version 4

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.