Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shelve: choice of database

shelve documentation says:

The choice of which database package will be used (such as dbm, gdbm or bsddb) depends on which interface is available.

What is that mean? How to determine which package choosen? How to strictly define which one must be choosed? What database implementation best to use?

like image 730
Gill Bates Avatar asked Dec 30 '12 16:12

Gill Bates


1 Answers

Found it here:
http://www.gossamer-threads.com/lists/python/python/13891

import shelve 
import gdbm 

def gdbm_shelve(filename, flag="c"): 
    return shelve.Shelf(gdbm.open(filename, flag)) 

db = gdbm_shelve("dbfile") 

ps
In linked page someone also found this somewhere, but his link is dead.

like image 96
Gill Bates Avatar answered Sep 23 '22 08:09

Gill Bates