When using SQLBuilder do build database-independent
queries, I would like to do DISTINCT queries.
This already exists in normal SQLObject
ClassName.select, but not in the builder.
This tiny patch adds it.
First, I would like to ask you to avoid copy/paste
programming. (-: Please refactor your code - there is
duplicate code in 'if' and 'else' branches. I think you can
just conditionally insert "DISTINCT" or '' (an empty string).
Second, I'd like to ask you to add a test. May be create
test_sqlbuilder.py, and test
assert str(Select(...)) = "SELECT..."
Something like this...
Third, it would be very kind of you if you add a few strings
about Select() to docs/SQLBuilder.txt - now when you
understand sqlbuilder and Select().
Thank you in advance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Patch to enable DISTINCT queries to sqlbuilder.py
Logged In: YES
user_id=4799
First, I would like to ask you to avoid copy/paste
programming. (-: Please refactor your code - there is
duplicate code in 'if' and 'else' branches. I think you can
just conditionally insert "DISTINCT" or '' (an empty string).
Second, I'd like to ask you to add a test. May be create
test_sqlbuilder.py, and test
assert str(Select(...)) = "SELECT..."
Something like this...
Third, it would be very kind of you if you add a few strings
about Select() to docs/SQLBuilder.txt - now when you
understand sqlbuilder and Select().
Thank you in advance!
Logged In: YES
user_id=4799
Originator: NO
Select() supports "distinct" since 0.10. The implementation is different, though...