bsddb.dbtables
index
/astro-wise/AWEHOME/x86_64/local/lib/python2.5/bsddb/dbtables.py
Module Docs

#-----------------------------------------------------------------------
#
# Copyright (C) 2000, 2001 by Autonomous Zone Industries
# Copyright (C) 2002 Gregory P. Smith
#
# License:      This is free software.  You may use this software for any
#               purpose including modification/redistribution, so long as
#               this header remains intact and that you do not claim any
#               rights of ownership or authorship of this software.  This
#               software has been tested, but no warranty is expressed or
#               implied.
#
#   --  Gregory P. Smith <greg@electricrain.com>

 
Modules
       
copy
cPickle
random
re
sys
xdrlib

 
Classes
       
Cond
ExactCond
LikeCond
PostfixCond
PrefixCond
bsdTableDB
exceptions.Exception(exceptions.BaseException)
DBIncompleteError
exceptions.StandardError(exceptions.Exception)
TableDBError
TableAlreadyExists

 
class Cond
    This condition matches everything
 
  Methods defined here:
__call__(self, s)

 
class DBIncompleteError(exceptions.Exception)
    
Method resolution order:
DBIncompleteError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x71a8a0>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class ExactCond(Cond)
    Acts as an exact match condition function
 
  Methods defined here:
__call__(self, s)
__init__(self, strtomatch)

 
class LikeCond(Cond)
    Acts as a function that will match using an SQL 'LIKE' style
string.  Case insensitive and % signs are wild cards.
This isn't perfect but it should work for the simple common cases.
 
  Methods defined here:
__call__(self, s)
__init__(self, likestr, re_flags=2)

 
class PostfixCond(Cond)
    Acts as a condition function for matching a string postfix
 
  Methods defined here:
__call__(self, s)
__init__(self, postfix)

 
class PrefixCond(Cond)
    Acts as a condition function for matching a string prefix
 
  Methods defined here:
__call__(self, s)
__init__(self, prefix)

 
class TableAlreadyExists(TableDBError)
    
Method resolution order:
TableAlreadyExists
TableDBError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors inherited from TableDBError:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.StandardError:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.StandardError:
__new__ = <built-in method __new__ of type object at 0x71aa20>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class TableDBError(exceptions.StandardError)
    
Method resolution order:
TableDBError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.StandardError:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.StandardError:
__new__ = <built-in method __new__ of type object at 0x71aa20>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class bsdTableDB
     Methods defined here:
CreateOrExtendTable(self, table, columns)
CreateOrExtendTable(table, columns)
 
Create a new table in the database.
 
If a table of this name already exists, extend it to have any
additional columns present in the given list as well as
all of its current columns.
CreateTable(self, table, columns)
CreateTable(table, columns) - Create a new table in the database.
 
raises TableDBError if it already exists or for other DB errors.
Delete(self, table, conditions={})
Delete(table, conditions) - Delete items matching the given
conditions from the table.
 
* conditions - a dictionary keyed on column names containing
  condition functions expecting the data string as an
  argument and returning a boolean.
Drop(self, table)
Remove an entire table from the database
Insert(self, table, rowdict)
Insert(table, datadict) - Insert a new row into the table
using the keys+values from rowdict as the column values.
ListTableColumns(self, table)
Return a list of columns in the given table.
[] if the table doesn't exist.
ListTables(self)
Return a list of tables in this database.
Modify(self, table, conditions={}, mappings={})
Modify(table, conditions={}, mappings={}) - Modify items in rows matching 'conditions' using mapping functions in 'mappings'
 
* table - the table name
* conditions - a dictionary keyed on column names containing
  a condition callable expecting the data string as an
  argument and returning a boolean.
* mappings - a dictionary keyed on column names containing a
  condition callable expecting the data string as an argument and
  returning the new string for that column.
Select(self, table, columns, conditions={})
Select(table, columns, conditions) - retrieve specific row data
Returns a list of row column->value mapping dictionaries.
 
* columns - a list of which column data to return.  If
  columns is None, all columns will be returned.
* conditions - a dictionary keyed on column names
  containing callable conditions expecting the data string as an
  argument and returning a boolean.
__del__(self)
__init__(self, filename, dbhome, create=0, truncate=0, mode=384, recover=0, dbflags=0)
bsdTableDB(filename, dbhome, create=0, truncate=0, mode=0600)
 
Open database name in the dbhome BerkeleyDB directory.
Use keyword arguments when calling this constructor.
checkpoint(self, mins=0)
close(self)
sync(self)

 
Functions
       
DB(...)
DBEnv(...)
DBSequence(...)
contains_metastrings(s)
Verify that the given string does not contain any
metadata strings that might interfere with dbtables database operation.
version(...)
Returns a tuple of major, minor, and patch release numbers of the
underlying DB library.

 
Data
        DB_AFTER = 1
DB_AGGRESSIVE = 1
DB_APPEND = 2
DB_ARCH_ABS = 1
DB_ARCH_DATA = 2
DB_ARCH_LOG = 4
DB_ARCH_REMOVE = 8
DB_AUTO_COMMIT = 16777216
DB_BEFORE = 3
DB_BTREE = 1
DB_BUFFER_SMALL = -30999
DB_CACHED_COUNTS = 4
DB_CDB_ALLDB = 4096
DB_CHECKPOINT = 0
DB_CHKSUM = 1
DB_CONSUME = 5
DB_CONSUME_WAIT = 6
DB_CREATE = 1
DB_CURRENT = 7
DB_DIRECT_DB = 8192
DB_DIRECT_LOG = 16384
DB_DIRTY_READ = 67108864
DB_DONOTINDEX = -30998
DB_DUP = 2
DB_DUPSORT = 4
DB_ENCRYPT = 8
DB_ENCRYPT_AES = 1
DB_EXCL = 4096
DB_EXTENT = 16384
DB_FAST_STAT = 8
DB_FCNTL_LOCKING = 8192
DB_FIRST = 9
DB_FLUSH = 1
DB_FORCE = 4
DB_GET_BOTH = 10
DB_GET_RECNO = 13
DB_HASH = 2
DB_INCOMPLETE = 0
DB_INIT_CDB = 4096
DB_INIT_LOCK = 8192
DB_INIT_LOG = 16384
DB_INIT_MPOOL = 32768
DB_INIT_REP = 65536
DB_INIT_TXN = 131072
DB_JOINENV = 262144
DB_JOIN_ITEM = 14
DB_JOIN_NOSORT = 1
DB_KEYEMPTY = -30997
DB_KEYEXIST = -30996
DB_KEYFIRST = 15
DB_KEYLAST = 16
DB_LAST = 17
DB_LOCKDOWN = 524288
DB_LOCK_CONFLICT = 0
DB_LOCK_DEADLOCK = -30995
DB_LOCK_DEFAULT = 1
DB_LOCK_DIRTY = 7
DB_LOCK_DUMP = 0
DB_LOCK_GET = 1
DB_LOCK_INHERIT = 3
DB_LOCK_IREAD = 5
DB_LOCK_IWR = 6
DB_LOCK_IWRITE = 4
DB_LOCK_MAXLOCKS = 3
DB_LOCK_MINLOCKS = 5
DB_LOCK_MINWRITE = 6
DB_LOCK_NG = 0
DB_LOCK_NORUN = 0
DB_LOCK_NOTGRANTED = -30994
DB_LOCK_NOWAIT = 2
DB_LOCK_OLDEST = 7
DB_LOCK_PUT = 4
DB_LOCK_PUT_ALL = 5
DB_LOCK_PUT_OBJ = 6
DB_LOCK_RANDOM = 8
DB_LOCK_READ = 1
DB_LOCK_RECORD = 4
DB_LOCK_SWITCH = 32
DB_LOCK_UPGRADE = 64
DB_LOCK_UPGRADE_WRITE = 10
DB_LOCK_WAIT = 3
DB_LOCK_WRITE = 2
DB_LOCK_WWRITE = 8
DB_LOCK_YOUNGEST = 9
DB_LOG_AUTOREMOVE = 65536
DB_LOG_INMEMORY = 131072
DB_LSTAT_ABORTED = 1
DB_LSTAT_FREE = 3
DB_LSTAT_HELD = 4
DB_LSTAT_PENDING = 6
DB_LSTAT_WAITING = 7
DB_MAX_PAGES = -1
DB_MAX_RECORDS = -1
DB_MULTIPLE = 134217728
DB_MULTIPLE_KEY = 268435456
DB_NEXT = 18
DB_NEXT_DUP = 19
DB_NEXT_NODUP = 20
DB_NODUPDATA = 21
DB_NOLOCKING = 262144
DB_NOMMAP = 8
DB_NOORDERCHK = 2
DB_NOOVERWRITE = 22
DB_NOPANIC = 524288
DB_NOSERVER = -30992
DB_NOSERVER_HOME = -30991
DB_NOSERVER_ID = -30990
DB_NOSYNC = 23
DB_NOTFOUND = -30989
DB_ODDFILESIZE = 32768
DB_OLD_VERSION = -30988
DB_OPFLAGS_MASK = 255
DB_ORDERCHKONLY = 4
DB_PAGE_NOTFOUND = -30987
DB_PANIC_ENVIRONMENT = 2097152
DB_POSITION = 24
DB_PREV = 25
DB_PREV_NODUP = 26
DB_PRIVATE = 1048576
DB_PR_PAGE = 8
DB_PR_RECOVERYTEST = 16
DB_QUEUE = 4
DB_RDONLY = 16
DB_RDWRMASTER = 16384
DB_RECNO = 3
DB_RECNUM = 32
DB_RECORDCOUNT = 27
DB_RECOVER = 32
DB_RECOVER_FATAL = 2097152
DB_REGION_INIT = 4194304
DB_RENUMBER = 64
DB_REVSPLITOFF = 128
DB_RMW = 536870912
DB_RPCCLIENT = 1
DB_RUNRECOVERY = -30977
DB_SALVAGE = 64
DB_SECONDARY_BAD = -30976
DB_SEQ_DEC = 1
DB_SEQ_INC = 2
DB_SEQ_WRAP = 8
DB_SET = 28
DB_SET_LOCK_TIMEOUT = 29
DB_SET_RANGE = 30
DB_SET_RECNO = 31
DB_SET_TXN_TIMEOUT = 33
DB_SNAPSHOT = 256
DB_STAT_CLEAR = 2
DB_SYSTEM_MEM = 4194304
DB_THREAD = 64
DB_TIME_NOTGRANTED = 8388608
DB_TRUNCATE = 128
DB_TXN_NOSYNC = 256
DB_TXN_NOT_DURABLE = 512
DB_TXN_NOWAIT = 4096
DB_TXN_SYNC = 8192
DB_TXN_WRITE_NOSYNC = 268435456
DB_UNKNOWN = 5
DB_UPGRADE = 1
DB_USE_ENVIRON = 1024
DB_USE_ENVIRON_ROOT = 2048
DB_VERIFY = 2
DB_VERIFY_BAD = -30975
DB_VERSION_MAJOR = 4
DB_VERSION_MINOR = 3
DB_VERSION_PATCH = 29
DB_VERSION_STRING = 'Sleepycat Software: Berkeley DB 4.3.29: (September 12, 2006)'
DB_WRITECURSOR = 35
DB_XA_CREATE = 2
DB_YIELDCPU = 536870912
EACCES = 13
EAGAIN = 11
EBUSY = 16
EEXIST = 17
EINVAL = 22
ENOENT = 2
ENOMEM = 12
ENOSPC = 28
EPERM = 1
cvsid = '$Id: _bsddb.c 53254 2007-01-05 02:09:06Z gregory.p.smith $'