pypika
pypika copied to clipboard
Add documentation about defining custom operators
Many extensions define new operators, for example to compute various distances between geometries, vectors, etc. A useful example is <->
being used by PostGIS.
Added the documentation explaining how to leverage ArithmeticExpression
to extend pypika with it, right under the explanation about how to define a custom function. Having that doc section would have saved me quite some time actually.
Thanks @wd60622 for explaining the approach!
Looks awesome. Thanks for making the adjustment
Only thing I would suggest is adding a brief section on this in the README like with the Custom Functions section
Any thoughts @AzisK ?
Thanks to both of you. I don't have any additional suggestions except writing a test to be sure that people actually can define their own custom operators
Thanks to both of you. I don't have any additional suggestions except writing a test to be sure that people actually can define their own custom operators
Think that's fair. If someones going into the code base, I think ideally someone might be able to use a string instead of a small class.