Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Introduce the LiteralQueryField #1097

Open
mikependon opened this issue Sep 27, 2022 · 4 comments
Open

Enhancement: Introduce the LiteralQueryField #1097

mikependon opened this issue Sep 27, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request for grabs A community can grab for contribution todo Things to be done in the future

Comments

@mikependon
Copy link
Owner

Describe the enhancement

As some users are eager to maximize the underlying data store internal functions, the only way to do this is to introduce a possibilty for the user to write their own literal query expression on top of the object/fluent-based implementations.

var where = new LiteralQueryField("[Id] BETWEEN 10 AND 100");
var people = connection.Query<Person>(where);

In which the above query would return all the people from the Person table where the ID is 10 to 100.

@mikependon mikependon added enhancement New feature or request todo Things to be done in the future for grabs A community can grab for contribution labels Sep 27, 2022
@mikependon mikependon self-assigned this Sep 27, 2022
@cajuncoding
Copy link
Collaborator

👏 Yes this is a much needed enhancement as it opens the possibility to use features currently not supported that would require fully managing the SQL command and inability to utilize RepoDBs other helpful features.

A great use case I encountered was trying to use SQL Server full text index features such as:

CONTAINS(product_description, "Snap Happy 100EZ" OR FORMSOF(THESAURUS,'Snap Happy') OR '100EZ')

@mikependon
Copy link
Owner Author

@cajuncoding - a bit hacky, but it could be a big help to most to access the DB's power. AFAIK, this works like NPoco.

@mikependon mikependon pinned this issue Sep 28, 2022
@ngardon
Copy link
Contributor

ngardon commented Dec 26, 2022

Very hacky suggestion done in #1125

@mikependon
Copy link
Owner Author

I was stalemate on this, TBH. Never I had explored your fixes to this one yet, but it sounds interesting how did you solved it without affecting the existing functionality of QueryField. Thanks for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request for grabs A community can grab for contribution todo Things to be done in the future
Projects
None yet
Development

No branches or pull requests

3 participants