[Tutor] Need bsddb/recno examples

SA sarmstrong13@mac.com
Tue, 13 Aug 2002 12:27:09 -0500


On 8/13/02 11:37 AM, "runsun" <runsun@bilbo.bio.purdue.edu> wrote:

> 
> Hi all,
> 
> I've been trying hard to search for the information of using
> the recno-type database in the bsddb module without any luck.
> Could someone help on this ???
> 
> First of all I have never used any sort of database before. I
> want to use this as an eazy way to learn and practice ("eazy"
> means I don't need to install any package).
> 
> I learned how to use the "b+tree" and "hash" types in the
> bsddb but couldn't find any instruction or example on the
> "recno" type.
> 


I'm no expert either, but it would seem to me that recno stands for "record
number"?

But the only classes I saw in bsddb were (btopen, hashopen, and rnopen, oh
yeah and error) So I'm assuming, going out on a long limb here, btopen opens
b+tree files, hashopen opens hash files, and rnopen opens DB record file?

Ah yes, that is it:
http://www.python.org/doc/current/lib/module-bsddb.html

So I'm assuming you wish to open DB files? bsddb.rnopen(filename[, flag[,
mode[, rnflags[, cachesize[, psize[, lorder[, reclen[, bval[,
bfname]]]]]]]]]) should do the trick.

Another option you may want to check out is Gadfly. It is totally in Python
and makes DB's basesd upon the SQL language. Does not take as much space as
MySQL and seems less cryptic.

Just my $0.02 worth.

Good Luck.
SA


-- 
"I can do everything on my Mac I used to on my PC. Plus a lot more ..."
-Me