-
Notifications
You must be signed in to change notification settings - Fork 874
Accept operator @@ to be used in the FullTextSearch. Find FieldIndex where columna name use _ #116
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
Conversation
Example:
where search_vector @@ to_tsquery('english', @p0)
CreatedAt (field) == created_at (column name)
|
Hi, @jjchiw ! I'm reviewing your patch here. Would it be possible for you to include some unit tests? This would help us very much! Thank you in advance. |
|
Hi! Yes sure, I can create the UnitTest I just have one doubt, this changes are for EntityFramework (right now using 6.0) Do I create a new project, or include the dependencies in the TestProject..... |
|
Feel free to add a dependency from the NpgsqlTests project to the Npgsql.EntityFramework project - this will allow you to reference the EF6 classes. Please put the EF-related tests in a new source file, just to keep things organized... |
|
I did the tests... But I'm not sure about adding NpgslTests project to Npgsql.EntityFramework.....anyway I just did that, and I had to sign the NpgsqlTests project in order to be used in Npgsql.EntityFramework project, maybe I didn't understad the comment of @roji I just did the tests with postgresql 9.3.2 / .net 4.5 |
|
@jjchiw, sorry, I think I wasn't very clear (and you sensed that)... All tests in the solution should be in the NpgsqlTests project. What I meant was that there's no problem for that issue to depend on the Npgsql.EntityFramework project (and not vice versa), and to contain tests for EF. Within NpgsqlTests, it's a good idea to put tests in EntityFrameworkTests.cs (like you have done) to cleanly separate them from the other tests... |
|
Ok, I think I got it this time. |
|
Looks much better @jjchiw, thanks. However, I can see you added a reference in NpgsqlTests.csproj to a private path for Npgsql.EntityFramework.dll, this should be a project reference instead (just like a reference from NpgsqlTests to Npgsql). Also, is the EntityFramework.SqlServer reference intended? Do we really need functionality from an SqlServer assembly? @franciscojunior, apart from my external remarks I didn't really review this, so after the above is fixed it's up to you to merge :) |
Removing EntityFramework.SqlServer from NpgsTests
|
Fixed the references... EntityFramework.SqlServer is added automatically by nuget when you install EntityFramework.... I just removed it, clean the config file and it worked... Thanks @roji for the assistance. |
|
Thanks @jjchiw, looks great. @franciscojunior, up to you now... |
|
Hi @jjchiw . I noticed that there is a file App.config in the Npgsql.EntityFramework folder. Maybe it was left there configuring the tests/App.config file. I think there is no need for the App.config file inside the Npgsql.EntityFramework. |
Removing App.config from Npgsql.EntityFramework
|
Sorry, from now on I'll try to be more careful. I just deleted it..... |
Don't worry. There is no need to be sorry. That's why we are reviewing your pull request. :) |
|
Another question, after you changed the way to reference the Npgsql.EntityFramework project, do you still need to sign the tests? I think it would be better if we could get it to work without needing to sign it. What do you think? |
|
Yes I'm agree with you. I already removed the signature key from the signing tab in the Npgsql.Test On Fri, Dec 13, 2013 at 7:13 PM, Francisco Figueiredo Jr. <
|
Great! Would you mind to remove the key file from the tests folder? I think you will need to commit your changes to the NpgsqlTests.csproj file so the reference to the snk file is removed. I hope I'm not being too much annoying. :) |
|
No problemo.... Ok, it's done the key file has been removed.... |
Great! I'm doing some tests here. |
|
Just a little catch I got here when running the tests: If you have Npgsql registered in the machine.config, you will get an error when running the tests because the registration of the DbProviderFactory is unique. Thanks to David Karlas sample: #91 (comment) this has an easy fix. Just add the remove tag before the dbproviderfactory registration: |
|
Oki......remove tag added... On Fri, Dec 13, 2013 at 9:33 PM, Francisco Figueiredo Jr. <
|
|
Hi, @jjchiw . I think your pull request is in good shape for merging. I just didn't quite understand the part about the underscore of the parameter names. Does EF use some special formatting for parameter names? Can you give us more information about this process? I'm kind of new to EF internals and your comments would give us a lot of useful information about EF and our interaction with it. Thanks in advance. |
|
@jjchiw, the best way to clean this up is to use git rebase --interactive. This will allow you to:
When you're doing with the rebasing on your local machine, do a push -f to force-push it to the github PR. This will effectively replace all the commits in this PR with the new rewritten ones. This process will spare us from deleting the PR and creating a new one, keeping the same PR. Let me know if you need help with this process. |
|
Ok, I think I did the rebase correctly, but now all the Tests fails first for this commit 6e32569 (I already fix this adding Npgsql.* to all the resources in NpgsqlProviderManifest class The @@ operator has not been pulled in the master branch (Do I merge the changes from @glenebob branch, and commit it) And the test of the underscore I'll just deleted it..... |
|
Ah, your PR depends on another branch/PR... In that case you should probably rebase your PR on top of Glen's - since you depend on his commit. Then, after Glen's branch is merged your PR can be merged as well. |
Example:
where search_vector @@ to_tsquery('english', @p0)
CreatedAt (field) == created_at (column name)
Removing EntityFramework.SqlServer from NpgsTests
Removing App.config from Npgsql.EntityFramework
This reverts commit af0548a.
Conflicts: Npgsql/Npgsql/NpgsqlRowDescription.cs tests/EntityFrameworkTests.cs
|
Another trick that's very useful is to create a branch in your own repo for each distinct piece of functionality you want to work on, and then offer a PR from your branches against master. That way you can have one or more PR open at a time, and also be able to do experimental work without having it effect any of the PR's you have open. -Glen |
|
Hi @jjchiw, Would it be possible for you to submit some tests for the three operators, @@, @>, and <@, isolated to not depend on EF in any way? We would want them to be as simple as possible. I just realized we still don't have these tests, so I'm not able to thoroughly test my fix for #193. Thanks for any help you can offer here! -Glen |
Test Operators @> <@ @@
|
Added tests for operators @@ @> <@ in CommandTests and in EntityFrameworkBasicTests. |
0b35ef0 to
c43b6af
Compare
|
Bumped into this after a long time while cleaning old issues... Seems still relevant. Does anyone want to pick this up and integrate into develop? |
|
This was fixed by my new lexer. |
|
Ah, great - thanks. Agree about the camelcase transformation... |
The @@ operator was interpreted as parameter....
Look for columns name in the format with underscore like created_at, first_name, etc...