Skip to content

Soundex #13428

Closed
Closed

Description

@mehrdadmms

Issue Creation Checklist

[X] I have read the contribution guidelines

Feature Description

Support for Soundex, fuzzy string match and difference function in PSQL

Is your feature request related to a problem? Please describe.

I'd like to search in my table and get closest match for example if I searched "studt" instead of "student" I get the nearest match

Describe the solution you'd like

If we have soundex and difference function in Sequelize.Op it'll be great

Why should this be in Sequelize

Because soundex is very useful in searching patterns and working with string.

Describe alternatives/workarounds you've considered

The work around is using raw SQL but in this situation you can't use ORM features alongside your soundex query.

Additional context

PSQL documentation on Soundex.
https://www.postgresql.org/docs/9.1/fuzzystrmatch.html

Feature Request Checklist

Is this feature dialect-specific?

  • No. This feature is relevant to Sequelize as a whole.
  • Yes. This feature only applies to the following dialect(s): XXX, YYY, ZZZ

Would you be willing to implement this feature by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Activity

  1. github-actions commented on Oct 27, 2021

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

  2. added
    dialect: postgres
    type: feature
    on Oct 31, 2021
  3. github-actions commented on Nov 8, 2021

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

  4. ephys commented on Apr 16, 2022

    @ephys
    Member

    Unfortunately, Op is for operators, not functions. You can already use functions using fn(), or literal().

    I agree that using literal means you have to opt out of some of the features of the ORM, but we're fixing that

    With the above RFC, you will soon be able to do this:

    const name = 'john';
    
    Users.findAll({
      where: sql`soundex(${attr('firstName')}) = soundex(${name})`
    })
  5. ephys commented on May 27, 2023

    @ephys
    Member

    The above proposal is now available in v7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dialect: postgrestype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions