-
Notifications
You must be signed in to change notification settings - Fork 38
[DRAFT] feat: support functions #30
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
I like the idea how you added support for all the optional modifiers but don't like the mixing of int-indexed and assoc-indexed array when combining the language and more options: [
'language' => 'sql',
'parallel safe'
] How about making it more phpstan friendly by using only assoc indexed modifiers? Is there one which would not work? Like: [
'language' => 'sql',
'parallel' => 'safe',
'leakproof' => false,
'mutability' => 'stable',
] |
Give me some time with both pull requests. They are on my agenda for a long time and I didn't find a good way yet to express all the PG functionality and make it good to use. I will have to play with them and try to remember the problem I had foreseen for my implementation. |
Sure and thanks for considering both of them. I already use this one using my own extension so I thought it might be a good fit for this library as well. |
https://jkatz05.com/post/postgres/postgres-begin-atomic/ Using the atomic by default for PG 14 sounds like a good idea. What do you think @jaulz? |
Oh, that looks super cool, @tpetry. How would you implement the version check? Calling |
Yes, i did the same: laravel-postgresql-enhanced/src/Query/BuilderExplain.php Lines 14 to 20 in d557d33
|
I just noticed that the atomic keyword is part of the body (i.e. after |
I will take some time on the weekend to play with the PR, I didn't forget it ;) I just have very much to do currently. |
No worries and thanks for spending your time at all on it! By the way, I think once we have this we could also think about creating utilities for triggers and maybe even provide Laravel specific triggers (e.g. create trigger to cascade deletions of morphable relations). |
e7784f6
to
4ae8d3a
Compare
I've improved your PR to fit more with the rest of the library and changed the implementation to correctly use the But I don't like the current option for the null handling. It's missing manual testing for all options currently and I need to create about 50 more unit tests for the final implemenation. What's your opinion? |
That looks great! I am just wondering whether Would you create tests for all the possible combinations? If yes, I think it could be handy to use phpunit's |
The I won't create a test for every combination, that is just too much. Just for every single one, but thats still a lot of tests. |
I was just about to ask if you need a hand to implement the tests but saw that are you already implemented a couple of them. Are any tests missing from your side where I can help directly? |
I am almost finished, will need to review it again and write the documentation. Will finish everything this week ;) |
834d6af
to
207190a
Compare
207190a
to
fbf7cd0
Compare
It's been released with It was a lot of work getting this fully done but without your draft, I wouldn't have had the time. Sorry for being so slow. |
Very cool, thanks a lot for your hard work and no worries! 😊 |
This PR adds support to create functions. We can of course change the signature but this is just a first proposal because I think it would be a great addition.