Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#48 Add DISTINCT to sqlbuilder.py Select

closed-invalid
Oleg Broytman
None
5
2008-03-03
2006-02-15
No

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.

Discussion

  • Patch to enable DISTINCT queries to sqlbuilder.py

     
    Attachments
  • Oleg Broytman
    Oleg Broytman
    2006-02-20

    • assigned_to: nobody --> phd
     
  • Oleg Broytman
    Oleg Broytman
    2006-02-20

    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!

     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    • status: open --> closed-invalid
     
  • Oleg Broytman
    Oleg Broytman
    2008-03-03

    Logged In: YES
    user_id=4799
    Originator: NO

    Select() supports "distinct" since 0.10. The implementation is different, though...