#48 Add DISTINCT to sqlbuilder.py Select

closed-invalid
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

  • Etienne Posthumus

    Patch to enable DISTINCT queries to sqlbuilder.py

     
  • 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...

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks