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

Add support for PGroonga.EntityFrameworkCore EF.Functions #1053

Merged
merged 1 commit into from
Sep 30, 2019
Merged

Add support for PGroonga.EntityFrameworkCore EF.Functions #1053

merged 1 commit into from
Sep 30, 2019

Conversation

kinosang
Copy link
Contributor

@kinosang kinosang commented Sep 27, 2019

Unfortunately, it seems a filter is still required to run DbFunctions on ef core 3.0.

@roji
Copy link
Member

roji commented Sep 30, 2019

@kinosang you're right that evaluatable filter is still needed in 3.0 - I've reopened dotnet/efcore#13454 to discuss.

However, just to be sure, this should only be needed if we have function calls which don't reference any columns, and which should still be evaluated at the server. Good examples are DateTime.Now, random number/guid generation and the like. Can you confirm you have cases like this with PGroonga (and out of curiosity, which one(s))?

@kinosang
Copy link
Contributor Author

kinosang commented Sep 30, 2019

@roji PGroonga has two types of functions, they are:

1.functions without parameter such as PgroongaIsWritable, PgroongaScore, PgroongaWalApply, and PgroongaWalTruncate,
2. others accept constant or variable (maybe a column, but majorly not).

All the functions should be translated and evaluated at the server.

@roji roji merged commit da4dd8a into npgsql:dev Sep 30, 2019
@roji
Copy link
Member

roji commented Sep 30, 2019

1.functions without parameter such as PgroongaIsWritable, PgroongaScore, PgroongaWalApply, and PgroongaWalTruncate,

These are global checks on the database, right? i.e. whether the database is writable, or to make pgroonga do something at the global level?

@roji roji added this to the 3.0.1 milestone Sep 30, 2019
@roji
Copy link
Member

roji commented Sep 30, 2019

Merged and backported for 3.0.1.

@kinosang
Copy link
Contributor Author

kinosang commented Sep 30, 2019

1.functions without parameter such as PgroongaIsWritable, PgroongaScore, PgroongaWalApply, and PgroongaWalTruncate,

These are global checks on the database, right? i.e. whether the database is writable, or to make pgroonga do something at the global level?

Yes, the PgroongaIsWritable, PgroongaWalApply, and PgroongaWalTruncate are.

But no, the PgroongaScore isn't.

The pgroonga_score accepts two arguments, they are tableoid and ctid (in raw SQL, fragment, not a constant, without any quotation), it only works in a SELECT query with pgroonga matching or searching.

https://github.com/JoyMoe/PGroonga.EntityFrameworkCore/blob/b9d3702a1a01cac8b1fe0e54598112c92a84fc6c/src/PGroonga.EntityFrameworkCore/Query/ExpressionTranslators/Internal/PGroongaMethodCallTranslatorPlugin.cs#L78-L83

@roji
Copy link
Member

roji commented Sep 30, 2019

Thanks for the added details @kinosang!

I need to put together a page with links to interesting/relevant external plugins, where yours could be listed (npgsql/doc#13).

@roji
Copy link
Member

roji commented Sep 30, 2019

I'll also try to publish 2.2.6 soon so that the PGroonga support there is unblocked as well.

@kinosang kinosang deleted the add-pgroonga branch September 30, 2019 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants