Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 Initial support for partial get/put

closed-accepted
Robin Dunn
None
5
2001-01-16
2001-01-08
No

Adds dlen and doff keywrods arguments to DB.get and DB.put, allowing partial gets and puts:

1. Defines a new C function add_partial_dbt that adds DB_DBT_PARTIAL flags and sets dlen and doff in a DBT struct, based on PyObjects dlenobj and doffobj passed to it from the appropiate functions (DB_get, DB_put).

2. Added unit tests to test_basics.py.

Still missing is cursor support, and support for large values of dlen and doff. A higher level file-like interface would be useful as well.

Discussion

  • None

     
    Attachments
  • I found one bug - add an entry that's 30,000 chars long, and then get it with doff of 30,002. That is, request data that is out of range.

    According to the docs this should return an empty string, instead it returns garbage (the rest of the database?). Not sure if this is a bug in my code, the rest of the python code or in the database code.

    --itamar

     
  • Added support for getting the size of entries, via a DB.getsize() function.

     
  • Robin Dunn
    Robin Dunn
    2001-01-12

    • assigned_to: nobody --> robind
     
  • Robin Dunn
    Robin Dunn
    2001-01-16

    • status: open-accepted --> closed-accepted