[DB-SIG] How to *you* access your database objects?

Kevin Jacobs jacobs@penguin.theopalgroup.com
Thu, 17 Oct 2002 10:24:11 -0400 (EDT)


On Thu, 17 Oct 2002, Eivind Tagseth wrote:
> * Kevin Jacobs <jacobs@penguin.theopalgroup.com> [021016 16:32]:
> > Eivind, Gerhard, and anyone else who is interested..  I've just released a
> > totally re-written db_row implementation that I mentioned in my previous
> > DB-SIG mail.  It implements much cleaner dictionary, tuple, and object-like
> > semantics and includes an optional C extension module for speed.  I've not
> > written much documentation for it, though the source if fairly clean and has
> > a fair amount of inline documentation.
> 
> > Please let me know what you think.
> 
> Seems to be working just fine, and now I can pretend that my MetaRows are
> dictionaries as well.  The only feature that disappeared as far as I can
> see is that you can now do:
> 
> obj = db_row.MetaRow(('a','b','c'))((1,2,3))
> 
> obj['doesnotexist'] = 5
> obj.fields.doesnotexist = 6
> 
> Without errors.

Good catch!  This was a flaw in only the Python version, and it has been
corrected.  I've release db_row version 0.6alpha, which can be found at:

    http://opensource.theopalgroup.com

Here is the complete ChangeLog:

Changes from version 0.5 -> 0.6:

  o Added missing slots declaration from Python FieldsBase object.  This
    corrected a major flaw in the pure-Python implementation which caused
    the allocation of per-instance dictionaries, and allowing access to
    undeclared fields.  The C version of FieldsBase was not affected.

  o Fixed exception types so that various accessors raise the appropriate
    exceptions.  e.g., previously __getitem__ would incorrectly raise
    AttributeError exceptions.  These changes were made in both the Python
    and C versions.

  o Added many new test cases to the regression suite, including much more
    rigorous read/write testing.

  o Removed some unnecessary (and slow!) code from the C fields_subscript
    function.  I suspect it was a left-over from past debugging that was
    not completely removed.

Regards,
-Kevin

-- 
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com