#23 String IDs

closed-accepted
Oleg Broytman
None
5
2005-10-25
2005-10-20
Jeff Bauer
No

It's possible to use a string id in SQLObject tables,
but you have to write your own createTable() method.
These patches modify the createIDColumn() methods in
the various *connection.py modules to test for
sqlmeta.idType == str and create the table accordingly.

I've only tested postgres, mysql, sqlite so far.

I didn't notice the test_stringid.py test until after I
wrote test_string_id.py. If accepted, my test should
probably replace the older one, since test_stringid.py
would be redundant and doesn't require overriding
createTable().

A further refinement later may be to see if StringCol
defines a length parameter and use it as a CHAR(n) or
VARCHAR(n) type rather than TEXT.

Discussion

  • Jeff Bauer
    Jeff Bauer
    2005-10-20

    patches + test for string ids

     
    Attachments
  • Oleg Broytman
    Oleg Broytman
    2005-10-23

    Logged In: YES
    user_id=4799

    Can you make it a single file unified or context diff patch?
    It is hard to appy a half dozen of patches when
    /usr/bin/patch does not accept -p...

     
  • Oleg Broytman
    Oleg Broytman
    2005-10-23

    • assigned_to: nobody --> phd
    • summary: string IDs --> String IDs
    • status: open --> open-invalid
     
  • Jeff Bauer
    Jeff Bauer
    2005-10-23

    Logged In: YES
    user_id=458828

    I'll be happy to create a combined patch file, but will
    this not work?

    $ cat patch[1-7].diff > upatch.diff
    $ patch < upatch.diff

    An additonal patch was posted to the mailing list to
    solve a different, but related problem:

    http://tinyurl.com/ahftq

     
  • Jeff Bauer
    Jeff Bauer
    2005-10-24

    Logged In: YES
    user_id=458828

    Unified patch made against latest commit (rev 155?)

     
  • Jeff Bauer
    Jeff Bauer
    2005-10-24

    unified patch file as requested by Oleg

     
    Attachments
  • Oleg Broytman
    Oleg Broytman
    2005-10-25

    • status: open-invalid --> closed-accepted
     
  • Oleg Broytman
    Oleg Broytman
    2005-10-25

    Logged In: YES
    user_id=4799

    Applied, refactored, tested and committed to the trunk at
    the revision 1136. Thank you!