bsddb3-6.2.7/0000775000175000017500000000000013617133046012523 5ustar jceajcea00000000000000bsddb3-6.2.7/LICENSE.txt0000664000175000017500000000333413316226204014344 0ustar jceajcea00000000000000Except when noted in individual files, this project is distributed under BSD 3-Clause License. More details in . License Text: """ Copyright (c) 2008-2018, Jesus Cea Avion All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Jesus Cea Avion nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ NOTE: If this file is changed, "docs/license.rst" must be updated too. bsddb3-6.2.7/setup.cfg0000644000175000017500000000010313617133046014334 0ustar jceajcea00000000000000[sdist] formats = gztar,zip [egg_info] tag_build = tag_date = 0 bsddb3-6.2.7/setup.py0000664000175000017500000000313713617051124014235 0ustar jceajcea00000000000000#!/usr/bin/env python """ Copyright (c) 2008-2020, Jesus Cea Avion All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Jesus Cea Avion nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import sys if sys.version_info[0] == 2 : import setup2 else : # >= Python 3.0 import setup3 bsddb3-6.2.7/PKG-INFO0000664000175000017500000000544013617133046013623 0ustar jceajcea00000000000000Metadata-Version: 2.1 Name: bsddb3 Version: 6.2.7 Summary: Python bindings for Oracle Berkeley DB Home-page: https://www.jcea.es/programacion/pybsddb.htm Author: Jesus Cea, Robin Dunn, Gregory P. Smith, Andrew Kuchling, Barry Warsaw Author-email: pybsddb@jcea.es License: 3-clause BSD License Description: This module provides a nearly complete wrapping of the Oracle/Sleepycat C API for the Database Environment, Database, Cursor, Log Cursor, Sequence and Transaction objects, and each of these is exposed as a Python type in the bsddb3.db module. The database objects can use various access methods: btree, hash, recno, and queue. Complete support of Berkeley DB distributed transactions. Complete support for Berkeley DB Replication Manager. Complete support for Berkeley DB Base Replication. Support for RPC. Please see the documents in the docs directory of the source distribution or at the website for more details on the types and methods provided. The goal is to mirror most of the real Berkeley DB API so fall back to the Oracle Berkeley DB documentation as appropriate. If you need to support ancient versiones of Python and/or Berkeley DB , you can use old releases of this bindings. `Homepage `__ -- `Releases (changelog) `__ -- `Documentation `__ -- `Mailing List `__ -- `Donation `__ Platform: UNKNOWN Classifier: License :: OSI Approved :: BSD License Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Information Technology Classifier: Natural Language :: English Classifier: Natural Language :: Spanish Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Database Classifier: Topic :: Software Development Classifier: Topic :: System :: Clustering Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Description-Content-Type: text/x-rst bsddb3-6.2.7/docs/0000775000175000017500000000000013617133045013452 5ustar jceajcea00000000000000bsddb3-6.2.7/docs/dbtxn.rst0000644000175000017500000000403413316226204015316 0ustar jceajcea00000000000000===== DBTxn ===== Read :Oracle:`Oracle documentation ` for better understanding. :OracleAPIC:`More info... ` DBTxn Methods ------------- .. function:: abort() Aborts the transaction :OracleAPIC:`More info... ` .. function:: commit(flags=0) Ends the transaction, committing any changes to the databases. :OracleAPIC:`More info... ` .. function:: id() The txn_id function returns the unique transaction id associated with the specified transaction. :OracleAPIC:`More info... ` .. function:: prepare(gid) Initiates the beginning of a two-phase commit. A global identifier parameter is required, which is a value unique across all processes involved in the commit. It must be a string of DB_GID_SIZE bytes. :OracleAPIC:`More info... ` .. function:: discard() This method frees up all the per-process resources associated with the specified transaction, neither committing nor aborting the transaction. The transaction will be keep in "unresolved" state. This call may be used only after calls to "dbenv.txn_recover()". A "unresolved" transaction will be returned again thru new calls to "dbenv.txn_recover()". For example, when there are multiple global transaction managers recovering transactions in a single Berkeley DB environment, any transactions returned by "dbenv.txn_recover()" that are not handled by the current global transaction manager should be discarded using "txn.discard()". :OracleAPIC:`More info... ` .. function:: set_timeout(timeout, flags) Sets timeout values for locks or transactions for the specified transaction. :OracleAPIC:`More info... ` .. function:: get_name(name) Returns the string associated with the transaction. :OracleAPIC:`More info... ` .. function:: set_name(name) Associates the specified string with the transaction. :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/README.txt0000644000175000017500000000073713316226203015150 0ustar jceajcea00000000000000Documentation in ReST format. You can read them "as is", or you can process it first with Python "docutils" package. The root document is "contents.rst". The "make" process is taken directly from the Python 2.6 documentation. If you do "make html", you can find the generated HTML in directory "build/html/". You don't need to to this if you only want to read the documentation. Files "Makefile", "conf.py" and directory "tools" are taken from Python 2.6 subversion, r61329. bsddb3-6.2.7/docs/contents.rst0000644000175000017500000000307613316226203016040 0ustar jceajcea00000000000000================================================================ Python Bindings for Berkeley DB 4.7, 4.8, 5.1, 5.3, 6.1 and 6.2 ================================================================ Introduction ------------ .. _Berkeley DB: http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html This handcrafted package contains Python wrappers for `Berkeley DB`_, the Open Source embedded database system. Berkeley DB is a programmatic toolkit that provides high-performance built-in database support for desktop and server applications. The Berkeley DB access methods include B+tree, Extended Linear Hashing, Fixed and Variable-length records, and Queues. Berkeley DB provides full transactional support, database recovery, online backups, multi-threaded and multi-process access, etc. The Python wrappers allow you to store Python string objects of any length, keyed either by strings or integers depending on the database access method. With the use of another module in the package standard shelve-like functionality is provided allowing you to store any picklable Python object! Berkeley DB is very powerful and versatile, but it is complex to use correctly. :Oracle:`Oracle documentation ` is very complete. Please, review it. Since June 2013 (release 6.0.0), this project accepts donations. Please, contribute if you can. Details. Documentation Index ------------------- .. toctree:: introduction.rst dbenv.rst db.rst dbcursor.rst dblogcursor.rst dbtxn.rst dblock.rst dbsequence.rst dbsite.rst history.rst license.rst donate.rst bsddb3-6.2.7/docs/history.rst0000644000175000017500000000151413617050277015711 0ustar jceajcea00000000000000History ------- .. _Digital Creations: http://www.digicool.com/ .. _wxPython: http://www.wxpython.org/ This module was started by Andrew Kuchling (amk) to remove the dependency on SWIG in a package by Gregory P. Smith who based his work on a similar package by Robin Dunn which wrapped Berkeley DB 2.7.x. Development then returned full circle back to Robin Dunn working in behalf of `Digital Creations`_ to complete the SWIG-less wrapping of the DB 3.x API and to build a solid unit test suite. Having completed that, Robin was now busy with another project (wxPython_) and Greg returned as maintainer. .. I can't use tildes because my ZOPE configuration. .. Something to fix in the future. `Jesus Cea Avion `__ is the maintainer of this code since February 2008, and ported it to Python 3.x. bsddb3-6.2.7/docs/license.rst0000664000175000017500000000657413617050636015646 0ustar jceajcea00000000000000======= LICENSE ======= Except when noted in individual files, this project is distributed under `BSD 3-Clause License `__. .. note:: If this file is changed, "LICENSE.txt" and "licenses.txt" must be updated too. License Text (BSD 3-Clause License) ----------------------------------- Copyright (c) 2008-2020, Jesus Cea Avion All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Jesus Cea Avion nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. License of individual files --------------------------- The history of this project is long and complicated, and so are their copyrights and licenses. I (Jesus Cea) wrote this document in orden to clarify the situation. This code was integrated once in Python 2.x, so I guess somebody did the paperwork related to contributor agreement. This code is derived from that version, so that could be a license checkpoint/blank sheet. I must verify that. New files will be covered by the 3-clause BSD license. License of Python files +++++++++++++++++++++++ * Except the following files, license is 3-clause BSD license. Jesus Cea Avion. * test2.py, test3.py: Zope Public License, version 2.0. Zope Corporation and contributors. * Lib*/bsddb/dbrecio.py: Itamar Shtull-Trauring . * Lib*/bsddb/__init__.py: 3-clause BSD license. Digital Creations and Andrew Kuchling. * Lib*/bsddb/db.py: 3-clause BSD license. Digital Creations and Andrew Kuchling. * Lib*/bsddb/dbobj.py, dbutils.py: Free software. Autonomous Zone Industries, Gregory P. Smith. * Lib*/bsddb/dbtables.py: Free software. Autonomous Zone Industries, Gregory P. Smith. * Lib*/bsddb/test/test_dbtables.py: Free software. Autonomous Zone Industries, Gregory P. Smith. * Lib*/bsddb/dbshelve.py: Free software. Total Control Software. License of C files ++++++++++++++++++ * Modules/bsddb.h, _bsddb.c: 3-clause BSD license. Digital Creations, Andrew Kuchling, Robin Dunn, Gregory P. Smith, Duncan Grisby, Jesus Cea Avion. bsddb3-6.2.7/docs/bitcoin.png0000644000175000017500000000207713316226203015606 0ustar jceajcea00000000000000PNG  IHDRL\sRGBbKGD pHYs+tIME X4%IDATxn0 EÀ'tܧaul Hq `0ݧ/<jM{>/xyWW#>Q s~o>2Q5F *R 69:T~IENDB`bsddb3-6.2.7/docs/dblock.rst0000644000175000017500000000037613316226203015441 0ustar jceajcea00000000000000DBLock ------ Read :Oracle:`Oracle documentation ` for better understanding. The DBLock objects have no methods or attributes. They are just opaque handles to the lock in question. They are managed via DBEnv methods. bsddb3-6.2.7/docs/dblogcursor.rst0000644000175000017500000000373313316226204016531 0ustar jceajcea00000000000000=========== DBLogCursor =========== Read :Oracle:`Oracle documentation ` for better understanding. :OracleAPIC:`More info... ` DBLogCursor Methods ------------------- .. function:: close() Discards the log cursor. :OracleAPIC:`More info... ` DBLogCursor Get Methods ----------------------- These DBLogCursor methods are all wrappers around the get() function in the C API. These functions returns a tuple. The first element is a LSN tuple, and the second element is a string/bytes with the log data. If the following methods don't have log data to return, they return None. .. function:: current() Return the log record to which the log currently refers. :OracleAPIC:`More info... ` .. function:: first() The first record from any of the log files found in the log directory is returned. This method will return None if the log is empty. :OracleAPIC:`More info... ` .. function:: last() The last record in the log is returned. This method will return None if the log is empty. :OracleAPIC:`More info... ` .. function:: next() The current log position is advanced to the next record in the log, and that record is returned. If the cursor position was not set previously, it will return the first record in the log. This method will return None if the log is empty. :OracleAPIC:`More info... ` .. function:: prev() The current log position is advanced to the previous record in the log, and that record is returned. If the cursor position was not set previously, it will return the last record in the log. This method will return None if the log is empty. :OracleAPIC:`More info... ` .. function:: set(lsn) Retrieve the record specified by the lsn parameter. :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/introduction.rst0000644000175000017500000002707513316226204016732 0ustar jceajcea00000000000000==================================================================== Berkeley DB 4.7, 4.8, 5.1, 5.3, 6.1 and 6.2 Python Extension Package ==================================================================== Introduction ------------ This is a simple bit of documentation for the bsddb3.db Python extension module which wraps the Berkeley DB C library. The extension module is located in a Python package along with a few pure python modules. It is expected that this module will be used in the following general ways by different programmers in different situations. The goals of this module are to allow all of these methods without making things too complex for the simple cases, and without leaving out funtionality needed by the complex cases. 1. **Backwards compatibility:** It is desirable for this package to be a near drop-in replacement for the bsddb module shipped with Python which is designed to wrap either DB 1.85, or the 1.85 compatibility interface. This means that there will need to be equivalent object creation functions available, (btopen(), hashopen(), and rnopen()) and the objects returned will need to have the same or at least similar methods available, (specifically, first(), last(), next(), and prev() will need to be available without the user needing to explicitly use a cursor.) All of these have been implemented in Python code in the bsddb3.__init__.py module. 2. **Simple persistent dictionary:** One small step beyond the above. The programmer may be aware of and use the new DB object type directly, but only needs it from a single process and thread. The programmer should not have to be bothered with using a DBEnv, and the DB object should behave as much like a dictionary as possible. 3. **Concurrent access dictionaries:** This refers to the ability to simultaneously have one writer and multiple readers of a DB (either in multiple threads or processes) and is implemented simply by creating a DBEnv with certain flags. No extra work is required to allow this access mode in bsddb3. 4. **Advanced transactional data store:** This mode of use is where the full capabilities of the Berkeley DB library are called into action. The programmer will probably not use the dictionary access methods as much as the regular methods of the DB object, so he can pass transaction objects to the methods. Again, most of this advanced functionality is activated simply by opening a DBEnv with the proper flags, and also by using transactions and being aware of and reacting to deadlock exceptions, etc. Types Provided -------------- The bsddb3.db extension module provides the following object types: - **DB:** The basic database object, capable of Hash, BTree, Recno, and Queue access methods. - **DBEnv:** Provides a Database Environment for more advanced database use. Apps using transactions, logging, concurrent access, etc. will need to have an environment object. - **DBCursor:** A pointer-like object used to traverse a database. - **DBTxn:** A database transaction. Allows for multi-file commit, abort and checkpoint of database modifications. - **DBLock:** An opaque handle for a lock. See DBEnv.lock_get() and DBEnv.lock_put(). Locks are not necessarily associated with anything in the database, but can be used for any syncronization task across all threads and processes that have the DBEnv open. - **DBSequence:** Sequences provide an arbitrary number of persistent objects that return an increasing or decreasing sequence of integers. Opening a sequence handle associates it with a record in a database. - **DBSite:** Site object for Replication Manager. Top level functions ------------------- .. function:: version() Returns a tuple with major, minor and patch level. :OracleAPIC:`More info... ` .. function:: full_version() Returns a tuple with the full version string, family, release, major, minor and patch level. :OracleAPIC:`More info... ` Exceptions Provided ------------------- The Berkeley DB C API uses function return codes to signal various errors. The bsddb3.db module checks for these error codes and turns them into Python exceptions, allowing you to use familiar try:... except:... constructs and not have to bother with checking every method's return value. Each of the error codes is turned into an exception specific to that error code, as outlined in the table below. If you are using the C API documentation then it is very easy to map the error return codes specified there to the name of the Python exception that will be raised. Simply refer to the table below. Each exception derives from the DBError exception class so if you just want to catch generic errors you can use DBError to do it. Since DBNotFoundError is raised when a given key is not found in the database, DBNotFoundError also derives from the standard KeyError exception to help make a DB look and act like a dictionary. We do the same trick with DBKeyEmptyError. When any of these exceptions is raised, the associated value is a tuple containing an integer representing the error code and a string for the error message itself. +----------------------------+-------------------------------------------+ | **DBError** | Base class, all others derive from this | +----------------------------+-------------------------------------------+ | **DBCursorClosedError** | When trying to use a closed cursor | +----------------------------+-------------------------------------------+ | **DBForeignConflictError** | DB_FOREIGN_CONFLICT | +----------------------------+-------------------------------------------+ | **DBKeyEmptyError** | DB_KEYEMPTY (also derives from KeyError) | +----------------------------+-------------------------------------------+ | **DBKeyExistError** | DB_KEYEXIST | +----------------------------+-------------------------------------------+ | **DBLockDeadlockError** | DB_LOCK_DEADLOCK | +----------------------------+-------------------------------------------+ | **DBLockNotGrantedError** | DB_LOCK_NOTGRANTED | +----------------------------+-------------------------------------------+ | **DBNotFoundError** | DB_NOTFOUND (also derives from KeyError) | +----------------------------+-------------------------------------------+ | **DBOldVersionError** | DB_OLD_VERSION | +----------------------------+-------------------------------------------+ | **DBPageNotFoundError** | DB_PAGE_NOTFOUND | +----------------------------+-------------------------------------------+ | **DBRepHandleDeadError** | DB_REP_HANDLE_DEAD | +----------------------------+-------------------------------------------+ | **DBRepLeaseExpiredError** | DB_REP_LEASE_EXPIRED | +----------------------------+-------------------------------------------+ | **DBRepLockoutError** | DB_REP_LOCKOUT | +----------------------------+-------------------------------------------+ | **DBRepUnavailError** | DB_REP_UNAVAIL | +----------------------------+-------------------------------------------+ | **DBRunRecoveryError** | DB_RUNRECOVERY | +----------------------------+-------------------------------------------+ | **DBSecondaryBadError** | DB_SECONDARY_BAD | +----------------------------+-------------------------------------------+ | **DBVerifyBadError** | DB_VERIFY_BAD | +----------------------------+-------------------------------------------+ | **DBNoServerError** | DB_NOSERVER | +----------------------------+-------------------------------------------+ | **DBNoServerHomeError** | DB_NOSERVER_HOME | +----------------------------+-------------------------------------------+ | **DBNoServerIDError** | DB_NOSERVER_ID | +----------------------------+-------------------------------------------+ | **DBInvalidArgError** | EINVAL | +----------------------------+-------------------------------------------+ | **DBAccessError** | EACCES | +----------------------------+-------------------------------------------+ | **DBNoSpaceError** | ENOSPC | +----------------------------+-------------------------------------------+ | **DBNoMemoryError** | DB_BUFFER_SMALL | +----------------------------+-------------------------------------------+ | **DBAgainError** | EAGAIN | +----------------------------+-------------------------------------------+ | **DBBusyError** | EBUSY | +----------------------------+-------------------------------------------+ | **DBFileExistsError** | EEXIST | +----------------------------+-------------------------------------------+ | **DBNoSuchFileError** | ENOENT | +----------------------------+-------------------------------------------+ | **DBPermissionsError** | EPERM | +----------------------------+-------------------------------------------+ Other Package Modules --------------------- - **dbshelve.py:** This is an implementation of the standard Python shelve concept for storing objects that uses bsddb3 specifically, and also exposes some of the more advanced methods and capabilities of the underlying DB. - **dbtables.py:** This is a module by Gregory Smith that implements a simplistic table structure on top of a DB. - **dbutils.py:** A catch-all for python code that is generally useful when working with DB's - **dbobj.py:** Contains subclassable versions of DB and DBEnv. - **dbrecio.py:** Contains the DBRecIO class that can be used to do partial reads and writes from a DB record using a file-like interface. Contributed by Itamar Shtull-Trauring. Testing ------- A full unit test suite is being developed to exercise the various object types, their methods and the various usage modes described in the introduction. `PyUnit `__ is used and the tests are structured such that they can be run unattended and automated. There are currently 482 test cases! (March 2010) Reference --------- See the C language API :OracleAPIC:`online documentation ` on Oracle's website for more details of the functionality of each of these methods. The names of all the Python methods should be the same or similar to the names in the C API. Berkeley DB is very powerful and versatile, but it is complex to use correctly. :Oracle:`Oracle documentation ` is very complete. Please, review it. **NOTE:** All the methods shown below having more than one keyword argument are actually implemented using keyword argument parsing, so you can use keywords to provide optional parameters as desired. Those that have only a single optional argument are implemented without keyword parsing to help keep the implementation simple. If this is too confusing let me know and I'll think about using keywords for everything. bsddb3-6.2.7/docs/dbcursor.rst0000644000175000017500000001546313316226204016032 0ustar jceajcea00000000000000======== DBCursor ======== Read :Oracle:`Oracle documentation ` for better understanding. :OracleAPIC:`More info... ` DBCursor Methods ---------------- .. function:: close() Discards the cursor. If the cursor is created within a transaction then you *must* be sure to close the cursor before commiting the transaction. :OracleAPIC:`More info... ` .. function:: count(flags=0) Returns a count of the number of duplicate data items for the key referenced by the cursor. :OracleAPIC:`More info... ` .. function:: delete(flags=0) Deletes the key/data pair currently referenced by the cursor. :OracleAPIC:`More info... ` .. function:: dup(flags=0) Create a new cursor. :OracleAPIC:`More info... ` .. function:: set_priority(priority) Set the cache priority for pages referenced by the DBC handle. :OracleAPIC:`More info... ` .. function:: get_priority() Returns the cache priority for pages referenced by the DBC handle. :OracleAPIC:`More info... ` .. function:: put(key, data, flags=0, dlen=-1, doff=-1) Stores the key/data pair into the database. Partial data records can be written using dlen and doff. :OracleAPIC:`More info... ` .. function:: get(flags, dlen=-1, doff=-1) See get(key, data, flags, dlen=-1, doff=-1) below. .. function:: get(key, flags, dlen=-1, doff=-1) See get(key, data, flags, dlen=-1, doff=-1) below. .. function:: get(key, data, flags, dlen=-1, doff=-1) Retrieves key/data pairs from the database using the cursor. All the specific functionalities of the get method are actually provided by the various methods below, which are the preferred way to fetch data using the cursor. These generic interfaces are only provided as an inconvenience. Partial data records are returned if dlen and doff are used in this method and in many of the specific methods below. :OracleAPIC:`More info... ` .. function:: pget(flags, dlen=-1, doff=-1) See pget(key, data, flags, dlen=-1, doff=-1) below. .. function:: pget(key, flags, dlen=-1, doff=-1) See pget(key, data, flags, dlen=-1, doff=-1) below. .. function:: pget(key, data, flags, dlen=-1, doff=-1) Similar to the already described get(). This method is available only on secondary databases. It will return the primary key, given the secondary one, and associated data :OracleAPIC:`More info... ` DBCursor Get Methods -------------------- These DBCursor methods are all wrappers around the get() function in the C API. .. function:: current(flags=0, dlen=-1, doff=-1) Returns the key/data pair currently referenced by the cursor. :OracleAPIC:`More info... ` .. function:: get_current_size() Returns length of the data for the current entry referenced by the cursor. .. function:: first(flags=0, dlen=-1, doff=-1) Position the cursor to the first key/data pair and return it. :OracleAPIC:`More info... ` .. function:: last(flags=0, dlen=-1, doff=-1) Position the cursor to the last key/data pair and return it. :OracleAPIC:`More info... ` .. function:: next(flags=0, dlen=-1, doff=-1) Position the cursor to the next key/data pair and return it. :OracleAPIC:`More info... ` .. function:: prev(flags=0, dlen=-1, doff=-1) Position the cursor to the previous key/data pair and return it. :OracleAPIC:`More info... ` .. function:: consume(flags=0, dlen=-1, doff=-1) For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue. *NOTE:* This method is deprecated in Berkeley DB version 3.2 in favor of the new consume method in the DB class. .. function:: get_both(key, data, flags=0) Like set() but positions the cursor to the record matching both key and data. (An alias for this is set_both, which makes more sense to me...) :OracleAPIC:`More info... ` .. function:: get_recno() Return the record number associated with the cursor. The database must use the BTree access method and have been created with the DB_RECNUM flag. :OracleAPIC:`More info... ` .. function:: join_item(flags=0) For cursors returned from the DB.join method, returns the combined key value from the joined cursors. :OracleAPIC:`More info... ` .. function:: next_dup(flags=0, dlen=-1, doff=-1) If the next key/data pair of the database is a duplicate record for the current key/data pair, the cursor is moved to the next key/data pair of the database, and that pair is returned. :OracleAPIC:`More info... ` .. function:: next_nodup(flags=0, dlen=-1, doff=-1) The cursor is moved to the next non-duplicate key/data pair of the database, and that pair is returned. :OracleAPIC:`More info... ` .. function:: prev_dup(flags=0, dlen=-1, doff=-1) If the previous key/data pair of the database is a duplicate data record for the current key/data pair, the cursor is moved to the previous key/data pair of the database, and that pair is returned. :OracleAPIC:`More info... ` .. function:: prev_nodup(flags=0, dlen=-1, doff=-1) The cursor is moved to the previous non-duplicate key/data pair of the database, and that pair is returned. :OracleAPIC:`More info... ` .. function:: set(key, flags=0, dlen=-1, doff=-1) Move the cursor to the specified key in the database and return the key/data pair found there. :OracleAPIC:`More info... ` .. function:: set_range(key, flags=0, dlen=-1, doff=-1) Identical to set() except that in the case of the BTree access method, the returned key/data pair is the smallest key greater than or equal to the specified key (as determined by the comparison function), permitting partial key matches and range searches. :OracleAPIC:`More info... ` .. function:: set_recno(recno, flags=0, dlen=-1, doff=-1) Move the cursor to the specific numbered record of the database, and return the associated key/data pair. The underlying database must be of type Btree and it must have been created with the DB_RECNUM flag. :OracleAPIC:`More info... ` .. function:: set_both(key, data, flags=0) See get_both(). The only difference in behaviour can be disabled using set_get_returns_none(2). :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/donate.rst0000644000175000017500000000457513617050335015467 0ustar jceajcea00000000000000======= DONATE! ======= .. _BitCoins: https://en.wikipedia.org/wiki/Bitcoin .. _4A86FE43: http://pgp.rediris.es:11371/pks/lookup?search=0x4A86FE43&op=vindex&fingerprint=on&exact=on Work on this project is currently driven by my own interests, needs and spare time. If you appreciate this software or if you want to sponsor a currently not translated API feature, please consider donation to the project. PyBSDDB/BSDDB3 needs your help. You can donate using BitCoins_. The destination address is 16avqyUK4vDqBdpUy365PPW44zNqVHLZSC. .. image:: bitcoin.png :align: center :alt: 16avqyUK4vDqBdpUy365PPW44zNqVHLZSC. Since donations thru BitCoin are not revocable, please be sure your are transfering to the right account (this document could have been modified for a third party). You can verify it in two diffent ways: 1. Reading this document in the project original website: `https://www.jcea.es/programacion/pybsddb_doc/donate.html `__. Make sure you are seeing the right webpage. 2. Verifying the PGP digital signature of the following document: .. code-block:: none -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 The BitCoin address for donating to PyBSDDB/BSDDB3 project is "16avqyUK4vDqBdpUy365PPW44zNqVHLZSC". -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCAAGBQJT0AKrAAoJEGjgN61Khv5DK1kH/3JctpZUr+h8iFCfpRCaHsX8 +6dmncm3ebAWt9kCRqZZ74Eq8h9918C4UwxLLPrskAIqQw3g2IyTdaPOHomM23XH Ru1ok5fhCjNMCw4+dnnO/AXxEY6cIf2PjsQlkUznCe0zz1ndZQ33XbdI/1ItUEhy nZVWblnCCAQnO69Nhf6vPxfRDol1oDTh0bginhflmS01P2r8m9Mzx9h7Rrx7oKwG meNIVIzwdA+Tbex0GvQGorPSwEuid/mVYuDp9jSLp8XgeXBQfeqPWv+PO2tkijYE Zs1A1YuFA3S8uDnZhe9P7u4w7PGlCNIrDvTyippXiYB9fnSHu6mPmCw3wv+SWkM= =9xWm -----END PGP SIGNATURE----- Doing something like :kbd:`gpg --verify` and pasting this block, your should get something like: .. code-block:: none gpg: Signature made Wed 23 Jul 2014 08:44:59 PM CEST using RSA key ID 4A86FE43 gpg: Good signature from "Jesús Cea Avión " My PGP key ID is "4A86FE43_". My key fingerprint is:: pub 4096R/1567BC0F 2014-01-13 Key fingerprint = 8627 62C4 6EC3 567C B58C 7FB1 A510 404E 1567 BC0F uid Jesús Cea Avión sub 2048R/4A86FE43 2014-01-13 sub 2048R/05488493 2014-01-13 bsddb3-6.2.7/docs/db.rst0000644000175000017500000006214213316226203014567 0ustar jceajcea00000000000000== DB == Read :Oracle:`Oracle documentation ` for better understanding. :OracleAPIC:`More info... ` DB Methods ---------- .. function:: DB(dbEnv=None, flags=0) Constructor. :OracleAPIC:`More info... ` .. function:: append(data, txn=None) A convenient version of put() that can be used for Recno or Queue databases. The DB_APPEND flag is automatically used, and the record number is returned. :OracleAPIC:`More info... ` .. function:: associate(secondaryDB, callback, flags=0, txn=None) Used to associate secondaryDB to act as a secondary index for this (primary) database. The callback parameter should be a reference to a Python callable object that will construct and return the secondary key or DB_DONOTINDEX if the item should not be indexed. The parameters the callback will receive are the primaryKey and primaryData values. :OracleAPIC:`More info... ` .. function:: close(flags=0) Flushes cached data and closes the database. :OracleAPIC:`More info... ` .. function:: compact(start=None, stop=None, flags=0, compact_fillpercent=0, compact_pages=0, compact_timeout=0) Compacts Btree and Recno access method databases, and optionally returns unused Btree, Hash or Recno database pages to the underlying filesystem. The method returns the number of pages returned to the filesystem. :OracleAPIC:`More info... ` .. function:: consume(txn=None, flags=0) For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue. :OracleAPIC:`More info... ` .. function:: consume_wait(txn=None, flags=0) For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue. If the Queue database is empty, the thread of control will wait until there is data in the queue before returning. :OracleAPIC:`More info... ` .. function:: cursor(txn=None, flags=0) Create a cursor on the DB and returns a DBCursor object. If a transaction is passed then the cursor can only be used within that transaction and you *must* be sure to close the cursor before commiting the transaction. :OracleAPIC:`More info... ` .. function:: delete(key, txn=None, flags=0) Removes a key/data pair from the database. :OracleAPIC:`More info... ` .. function:: exists(key, txn=None, flags=0) Test if a key exists in the database. Returns True or False. :OracleAPIC:`More info... ` .. function:: fd() Returns a file descriptor for the database. :OracleAPIC:`More info... ` .. function:: get(key, default=None, txn=None, flags=0, dlen=-1, doff=-1) Returns the data object associated with key. If key is an integer then the DB_SET_RECNO flag is automatically set for BTree databases and the actual key and the data value are returned as a tuple. If default is given then it is returned if the key is not found in the database. Partial records can be read using dlen and doff, however be sure to not read beyond the end of the actual data or you may get garbage. :OracleAPIC:`More info... ` .. function:: pget(key, default=None, txn=None, flags=0, dlen=-1, doff=-1) This method is available only on secondary databases. It will return the primary key, given the secondary one, and associated data. :OracleAPIC:`More info... ` .. function:: get_transactional() Returns True if the database is transactional. False if not. :OracleAPIC:`More info... ` .. function:: get_priority() Returns the cache priority for pages referenced by the DB handle. This priority value is set using the DB->set_priority() method. :OracleAPIC:`More info... ` .. function:: set_priority(priority) Set the cache priority for pages referenced by the DB handle. The priority of a page biases the replacement algorithm to be more or less likely to discard a page when space is needed in the buffer pool. The bias is temporary, and pages will eventually be discarded if they are not referenced again. The DB->set_priority() method is only advisory, and does not guarantee pages will be treated in a specific way. The value provided must be symbolic. Check the Oracle documentation. :OracleAPIC:`More info... ` .. function:: get_dbname() Returns a tuple with the filename and the database name. If there is no database name, the value returned will be None. :OracleAPIC:`More info... ` .. function:: get_open_flags() Returns the current open method flags. That is, this method returns the flags that were specified when DB->open() was called. :OracleAPIC:`More info... ` .. function:: set_private(object) Link an object to the DB object. This allows to pass around an arbitrary object. For instance, for callback context. .. function:: get_private() Give the object linked to the DB. .. function:: get_both(key, data, txn=None, flags=0) A convenient version of get() that automatically sets the DB_GET_BOTH flag, and which will be successful only if both the key and data value are found in the database. (Can be used to verify the presence of a record in the database when duplicate keys are allowed.) :OracleAPIC:`More info... ` .. function:: get_byteswapped() May be used to determine if the database was created on a machine with the same endianess as the current machine. :OracleAPIC:`More info... ` .. function:: get_size(key, txn=None) Return the size of the data object associated with key. .. function:: get_type() Return the database's access method type. :OracleAPIC:`More info... ` .. function:: join(cursorList, flags=0) Create and return a specialized cursor for use in performing joins on secondary indices. :OracleAPIC:`More info... ` .. function:: key_range(key, txn=None, flags=0) Returns an estimate of the proportion of keys that are less than, equal to and greater than the specified key. :OracleAPIC:`More info... ` .. function:: open(filename, dbname=None, dbtype=DB_UNKNOWN, flags=0, mode=0660, txn=None) Opens the database named dbname in the file named filename. The dbname argument is optional and allows applications to have multiple logical databases in a single physical file. It is an error to attempt to open a second database in a file that was not initially created using a database name. In-memory databases never intended to be shared or preserved on disk may be created by setting both the filename and dbname arguments to None. :OracleAPIC:`More info... ` .. function:: put(key, data, txn=None, flags=0, dlen=-1, doff=-1) Stores the key/data pair in the database. If the DB_APPEND flag is used and the database is using the Recno or Queue access method then the record number allocated to the data is returned. Partial data objects can be written using dlen and doff. :OracleAPIC:`More info... ` .. function:: remove(filename, dbname=None, flags=0) Remove a database. :OracleAPIC:`More info... ` .. function:: rename(filename, dbname, newname, flags=0) Rename a database. :OracleAPIC:`More info... ` .. function:: set_encrypt(passwd, flags=0) Set the password used by the Berkeley DB library to perform encryption and decryption. Because databases opened within Berkeley DB environments use the password specified to the environment, it is an error to attempt to set a password in a database created within an environment. :OracleAPIC:`More info... ` .. function:: get_encrypt_flags() Returns the encryption flags. :OracleAPIC:`More info... ` .. function:: set_bt_compare(compareFunc) Set the B-Tree database comparison function. This can only be called once before the database has been opened. compareFunc takes two arguments: (left key string, right key string) It must return a -1, 0, 1 integer similar to cmp. You can shoot your database in the foot, beware! Read the Berkeley DB docs for the full details of how the comparison function MUST behave. :OracleAPIC:`More info... ` .. function:: get_bt_minkey() Returns the minimum number of key/data pairs intended to be stored on any single Btree leaf page. This value can be set using the DB->set_bt_minkey() method. :OracleAPIC:`More info... ` .. function:: set_bt_minkey(minKeys) Set the minimum number of keys that will be stored on any single BTree page. :OracleAPIC:`More info... ` .. function:: set_cachesize(gbytes, bytes, ncache=0) Set the size of the database's shared memory buffer pool. :OracleAPIC:`More info... ` .. function:: get_cachesize() Returns a tuple with the current size and composition of the cache. :OracleAPIC:`More info... ` .. function:: set_dup_compare(compareFunc) Set the duplicate data item comparison function. This can only be called once before the database has been opened. compareFunc takes two arguments: (left key string, right key string) It must return a -1, 0, 1 integer similar to cmp. You can shoot your database in the foot, beware! Read the Berkeley DB docs for the full details of how the comparison function MUST behave. :OracleAPIC:`More info... ` .. function:: set_get_returns_none(flag) Controls what get and related methods do when a key is not found. See the DBEnv set_get_returns_none documentation. The previous setting is returned. .. function:: get_flags() Returns the current database flags as set by the DB->set_flags() method. :OracleAPIC:`More info... ` .. function:: set_flags(flags) Set additional flags on the database before opening. :OracleAPIC:`More info... ` .. function:: get_h_ffactor() Returns the hash table density as set by the DB->set_h_ffactor() method. :OracleAPIC:`More info... ` .. function:: set_h_ffactor(ffactor) Set the desired density within the hash table. :OracleAPIC:`More info... ` .. function:: get_h_nelem() Returns the estimate of the final size of the hash table as set by the DB->set_h_nelem() method. :OracleAPIC:`More info... ` .. function:: set_h_nelem(nelem) Set an estimate of the final size of the hash table. :OracleAPIC:`More info... ` .. function:: get_lorder() Returns the database byte order; a byte order of 4,321 indicates a big endian order, and a byte order of 1,234 indicates a little endian order. This value is set using the DB->set_lorder() method. :OracleAPIC:`More info... ` .. function:: set_lorder(lorder) Set the byte order for integers in the stored database metadata. :OracleAPIC:`More info... ` .. function:: get_pagesize() Returns the database's current page size, as set by the DB->set_pagesize() method. :OracleAPIC:`More info... ` .. function:: set_pagesize(pagesize) Set the size of the pages used to hold items in the database, in bytes. :OracleAPIC:`More info... ` .. function:: get_re_delim() Returns the delimiting byte, which is used to mark the end of a record in the backing source file for the Recno access method. The return value will be a numeric byte value. :OracleAPIC:`More info... ` .. function:: set_re_delim(delim) Set the delimiting byte used to mark the end of a record in the backing source file for the Recno access method. You can specify a char or a numeric byte value. :OracleAPIC:`More info... ` .. function:: get_re_len() Returns the length of the records held in a Queue access method database. This value can be set using the DB->set_re_len() method. :OracleAPIC:`More info... ` .. function:: set_re_len(length) For the Queue access method, specify that the records are of length length. For the Recno access method, specify that the records are fixed-length, not byte delimited, and are of length length. :OracleAPIC:`More info... ` .. function:: get_re_pad() Returns the pad character used for short, fixed-length records used by the Queue and Recno access methods. The method returns a byte value. :OracleAPIC:`More info... ` .. function:: set_re_pad(pad) Set the padding character for short, fixed-length records for the Queue and Recno access methods. You can specify a char or a numeric byte value. :OracleAPIC:`More info... ` .. function:: get_re_source() Returns the source file used by the Recno access method. This file is configured for the Recno access method using the DB->set_re_source() method. :OracleAPIC:`More info... ` .. function:: set_re_source(source) Set the underlying source file for the Recno access method. :OracleAPIC:`More info... ` .. function:: get_q_extentsize() Returns the number of pages in an extent. This value is used only for Queue databases and is set using the DB->set_q_extentsize() method. :OracleAPIC:`More info... ` .. function:: set_q_extentsize(extentsize) Set the size of the extents used to hold pages in a Queue database, specified as a number of pages. Each extent is created as a separate physical file. If no extent size is set, the default behavior is to create only a single underlying database file. :OracleAPIC:`More info... ` .. function:: stat(flags=0, txn=None) Return a dictionary containing database statistics with the following keys. For Hash databases: +-----------+-------------------------------------------------+ | magic | Magic number that identifies the file as a Hash | | | database. | +-----------+-------------------------------------------------+ | version | Version of the Hash database. | +-----------+-------------------------------------------------+ | nkeys | Number of unique keys in the database. | +-----------+-------------------------------------------------+ | ndata | Number of key/data pairs in the database. | +-----------+-------------------------------------------------+ | pagecnt | The number of pages in the database. | +-----------+-------------------------------------------------+ | pagesize | Underlying Hash database page (& bucket) size. | +-----------+-------------------------------------------------+ | nelem | Estimated size of the hash table specified at | | | database creation time. | +-----------+-------------------------------------------------+ | ffactor | Desired fill factor (number of items per bucket)| | | specified at database creation time. | +-----------+-------------------------------------------------+ | buckets | Number of hash buckets. | +-----------+-------------------------------------------------+ | free | Number of pages on the free list. | +-----------+-------------------------------------------------+ | bfree | Number of bytes free on bucket pages. | +-----------+-------------------------------------------------+ | bigpages | Number of big key/data pages. | +-----------+-------------------------------------------------+ | big_bfree | Number of bytes free on big item pages. | +-----------+-------------------------------------------------+ | overflows | Number of overflow pages (overflow pages are | | | pages that contain items that did not fit in | | | the main bucket page). | +-----------+-------------------------------------------------+ | ovfl_free | Number of bytes free on overflow pages. | +-----------+-------------------------------------------------+ | dup | Number of duplicate pages. | +-----------+-------------------------------------------------+ | dup_free | Number of bytes free on duplicate pages. | +-----------+-------------------------------------------------+ For BTree and Recno databases: +-------------+-----------------------------------------------+ | magic | Magic number that identifies the file as a | | | Btree database. | +-------------+-----------------------------------------------+ | version | Version of the Btree database. | +-------------+-----------------------------------------------+ | nkeys | For the Btree Access Method, the number of | | | unique keys in the database. | | | | | | For the Recno Access Method, the number of | | | records in the database. If the database has | | | been configured to not re-number records | | | during deletion, the number of records may | | | include records that have been deleted. | +-------------+-----------------------------------------------+ | ndata | For the Btree Access Method, the number of | | | key/data pairs in the database. | | | | | | For the Recno Access Method, the number of | | | records in the database. If the database has | | | been configured to not re-number records | | | during deletion, the number of records may | | | include records that have been deleted. | +-------------+-----------------------------------------------+ | pagecnt | The number of pages in the database. | +-------------+-----------------------------------------------+ | pagesize | Underlying database page size. | +-------------+-----------------------------------------------+ | minkey | Minimum keys per page. | +-------------+-----------------------------------------------+ | re_len | Length of fixed-length records. | +-------------+-----------------------------------------------+ | re_pad | Padding byte value for fixed-length records. | +-------------+-----------------------------------------------+ | levels | Number of levels in the database. | +-------------+-----------------------------------------------+ | int_pg | Number of database internal pages. | +-------------+-----------------------------------------------+ | leaf_pg | Number of database leaf pages. | +-------------+-----------------------------------------------+ | dup_pg | Number of database duplicate pages. | +-------------+-----------------------------------------------+ | over_pg | Number of database overflow pages. | +-------------+-----------------------------------------------+ | empty_pg | Number of empty database pages. | +-------------+-----------------------------------------------+ | free | Number of pages on the free list. | +-------------+-----------------------------------------------+ | int_pgfree | Num of bytes free in database internal pages. | +-------------+-----------------------------------------------+ | leaf_pgfree | Number of bytes free in database leaf pages. | +-------------+-----------------------------------------------+ | dup_pgfree | Num bytes free in database duplicate pages. | +-------------+-----------------------------------------------+ | over_pgfree | Num of bytes free in database overflow pages. | +-------------+-----------------------------------------------+ For Queue databases: +-------------+-----------------------------------------------+ | magic | Magic number that identifies the file as a | | | Queue database. | +-------------+-----------------------------------------------+ | version | Version of the Queue file type. | +-------------+-----------------------------------------------+ | nkeys | Number of records in the database. | +-------------+-----------------------------------------------+ | ndata | Number of records in the database. | +-------------+-----------------------------------------------+ | pagesize | Underlying database page size. | +-------------+-----------------------------------------------+ | extentsize | Underlying database extent size, in pages. | +-------------+-----------------------------------------------+ | pages | Number of pages in the database. | +-------------+-----------------------------------------------+ | re_len | Length of the records. | +-------------+-----------------------------------------------+ | re_pad | Padding byte value for the records. | +-------------+-----------------------------------------------+ | pgfree | Number of bytes free in database pages. | +-------------+-----------------------------------------------+ | first_recno | First undeleted record in the database. | +-------------+-----------------------------------------------+ | cur_recno | Last allocated record number in the database. | +-------------+-----------------------------------------------+ :OracleAPIC:`More info... ` .. function:: stat_print(flags=0) Displays the database statistical information. :OracleAPIC:`More info... ` .. function:: sync(flags=0) Flushes any cached information to disk. :OracleAPIC:`More info... ` .. function:: truncate(txn=None, flags=0) Empties the database, discarding all records it contains. The number of records discarded from the database is returned. :OracleAPIC:`More info... ` .. function:: upgrade(filename, flags=0) Upgrades all of the databases included in the file filename, if necessary. :OracleAPIC:`More info... ` .. function:: verify(filename, dbname=None, outfile=None, flags=0) Verifies the integrity of all databases in the file specified by the filename argument, and optionally outputs the databases' key/data pairs to a file. :OracleAPIC:`More info... ` DB Mapping and Compatibility Methods ------------------------------------ These methods of the DB type are for implementing the Mapping Interface, as well as others for making a DB behave as much like a dictionary as possible. The main downside to using a DB as a dictionary is you are not able to specify a transaction object. .. function:: DB_length() [ usage: len(db) ] Return the number of key/data pairs in the database. .. function:: DB_subscript(key) [ usage: db[key] ] Return the data associated with key. .. function:: DB_ass_sub(key, data) [ usage: db[key] = data ] Assign or update a key/data pair, or delete a key/data pair if data is NULL. .. function:: keys(txn=None) Return a list of all keys in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete. .. function:: items(txn=None) Return a list of tuples of all key/data pairs in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete. .. function:: values(txn=None) Return a list of all data values in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete. .. function:: has_key(key, txn=None) Returns true if key is present in the database. bsddb3-6.2.7/docs/dbsequence.rst0000644000175000017500000001051513316226203016315 0ustar jceajcea00000000000000========== DBSequence ========== Read :Oracle:`Oracle documentation ` for better understanding. Sequences provide an arbitrary number of persistent objects that return an increasing or decreasing sequence of integers. Opening a sequence handle associates it with a record in a database. The handle can maintain a cache of values from the database so that a database update is not needed as the application allocates a value. :OracleAPIC:`More info... ` DBSequence Methods ------------------ .. function:: DBSequence(db, flags=0) Constructor. :OracleAPIC:`More info... ` .. function:: open(key, txn=None, flags=0) Opens the sequence represented by the key. :OracleAPIC:`More info... ` .. function:: close(flags=0) Close a DBSequence handle. :OracleAPIC:`More info... ` .. function:: initial_value(value) Set the initial value for a sequence. This call is only effective when the sequence is being created. :OracleAPIC:`More info... ` .. function:: get(delta=1, txn=None, flags=0) Returns the next available element in the sequence and changes the sequence value by delta. :OracleAPIC:`More info... ` .. function:: get_dbp() Returns the DB object associated to the DBSequence. :OracleAPIC:`More info... ` .. function:: get_key() Returns the key for the sequence. :OracleAPIC:`More info... ` .. function:: remove(txn=None, flags=0) Removes the sequence from the database. This method should not be called if there are other open handles on this sequence. :OracleAPIC:`More info... ` .. function:: get_cachesize() Returns the current cache size. :OracleAPIC:`More info... ` .. function:: set_cachesize(size) Configure the number of elements cached by a sequence handle. :OracleAPIC:`More info... ` .. function:: get_flags() Returns the current flags. :OracleAPIC:`More info... ` .. function:: set_flags(flags) Configure a sequence. :OracleAPIC:`More info... ` .. function:: stat(flags=0) Returns a dictionary of sequence statistics with the following keys: +------------+----------------------------------------------+ | wait | The number of times a thread of control was | | | forced to wait on the handle mutex. | +------------+----------------------------------------------+ | nowait | The number of times that a thread | | | of control was able to obtain handle mutex | | | without waiting. | +------------+----------------------------------------------+ | current | The current value of the sequence | | | in the database. | +------------+----------------------------------------------+ | value | The current cached value of the sequence. | +------------+----------------------------------------------+ | last_value | The last cached value of the sequence. | +------------+----------------------------------------------+ | min | The minimum permitted value of the sequence. | +------------+----------------------------------------------+ | max | The maximum permitted value of the sequence. | +------------+----------------------------------------------+ | cache_size | The number of values that will be cached in | | | this handle. | +------------+----------------------------------------------+ | flags | The flags value for the sequence. | +------------+----------------------------------------------+ :OracleAPIC:`More info... ` .. function:: stat_print(flags=0) Prints diagnostic information. :OracleAPIC:`More info... ` .. function:: get_range() Returns a tuple representing the range of values in the sequence. :OracleAPIC:`More info... ` .. function:: set_range((min,max)) Configure a sequence range. :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/dbenv.rst0000644000175000017500000021171613316226203015303 0ustar jceajcea00000000000000===== DBEnv ===== Read :Oracle:`Oracle documentation ` for better understanding. :OracleAPIC:`More info... ` DBEnv Attributes ---------------- .. function:: DBEnv(flags=0) database home directory (read-only) DBEnv Methods ------------- .. function:: DBEnv(flags=0) Constructor. :OracleAPIC:`More info... ` .. function:: set_rpc_server(host, cl_timeout=0, sv_timeout=0) Establishes a connection for this dbenv to a RPC server. This function is not available if linked to Berkeley DB 4.8 or up. :OracleAPIC:`More info... ` .. function:: close(flags=0) Close the database environment, freeing resources. :OracleAPIC:`More info... ` .. function:: open(homedir, flags=0, mode=0660) Prepare the database environment for use. :OracleAPIC:`More info... ` .. function:: log_cursor() Returns a created log cursor. :OracleAPIC:`More info... ` .. function:: memp_stat(flags=0) Returns the memory pool (that is, the buffer cache) subsystem statistics. The returning value is a tuple. The first element is a dictionary with the general stats. The second element is another dictionary, keyed by filename, and the values are the stats for each file. The first dictionary contains these data: +-------------------+---------------------------------------------+ | gbytes | Gigabytes of cache (total cache size is | | | st_gbytes + st_bytes). | +-------------------+---------------------------------------------+ | bytes | Bytes of cache (total cache size is | | | st_gbytes + st_bytes). | +-------------------+---------------------------------------------+ | ncache | Number of caches. | +-------------------+---------------------------------------------+ | max_ncache | Maximum number of caches, as configured | | | with the DB_ENV->set_cache_max() method. | +-------------------+---------------------------------------------+ | regsize | Individual cache size, in bytes. | +-------------------+---------------------------------------------+ | mmapsize | Maximum memory-mapped file size. | +-------------------+---------------------------------------------+ | maxopenfd | Maximum open file descriptors. | +-------------------+---------------------------------------------+ | maxwrite | Maximum sequential buffer writes. | +-------------------+---------------------------------------------+ | maxwrite_sleep | Microseconds to pause after writing maximum | | | sequential buffers. | +-------------------+---------------------------------------------+ | map | Requested pages mapped into the process' | | | address space (there is no available | | | information about whether or not this | | | request caused disk I/O, although examining | | | the application page fault rate may be | | | helpful). | +-------------------+---------------------------------------------+ | cache_hit | Requested pages found in the cache. | +-------------------+---------------------------------------------+ | cache_miss | Requested pages not found in the cache. | +-------------------+---------------------------------------------+ | page_create | Pages created in the cache. | +-------------------+---------------------------------------------+ | page_in | Pages read into the cache. | +-------------------+---------------------------------------------+ | page_out | Pages written from the cache to the backing | | | file. | +-------------------+---------------------------------------------+ | ro_evict | Clean pages forced from the cache. | +-------------------+---------------------------------------------+ | rw_evict | Dirty pages forced from the cache. | +-------------------+---------------------------------------------+ | page_trickle | Dirty pages written using the | | | DB_ENV->memp_trickle() method. | +-------------------+---------------------------------------------+ | pages | Pages in the cache. | +-------------------+---------------------------------------------+ | page_clean | Clean pages currently in the cache. | +-------------------+---------------------------------------------+ | page_dirty | Dirty pages currently in the cache. | +-------------------+---------------------------------------------+ | hash_buckets | Number of hash buckets in buffer hash | | | table. | +-------------------+---------------------------------------------+ | hash_searches | Total number of buffer hash table lookups. | +-------------------+---------------------------------------------+ | hash_longest | Longest chain ever encountered in buffer | | | hash table lookups. | +-------------------+---------------------------------------------+ | hash_examined | Total number of hash elements traversed | | | during hash table lookups. | +-------------------+---------------------------------------------+ | hash_nowait | Number of times that a thread of control | | | was able to obtain a hash bucket lock | | | without waiting. | +-------------------+---------------------------------------------+ | hash_wait | Number of times that a thread of control | | | was forced to wait before obtaining a hash | | | bucket lock. | +-------------------+---------------------------------------------+ | hash_max_nowait | The number of times a thread of control was | | | able to obtain the hash bucket lock without | | | waiting on the bucket which had the maximum | | | number of times that a thread of control | | | needed to wait. | +-------------------+---------------------------------------------+ | hash_max_wait | Maximum number of times any hash bucket | | | lock was waited for by a thread of control. | +-------------------+---------------------------------------------+ | region_wait | Number of times that a thread of control | | | was forced to wait before obtaining a cache | | | region mutex. | +-------------------+---------------------------------------------+ | region_nowait | Number of times that a thread of control | | | was able to obtain a cache region mutex | | | without waiting. | +-------------------+---------------------------------------------+ | mvcc_frozen | Number of buffers frozen. | +-------------------+---------------------------------------------+ | mvcc_thawed | Number of buffers thawed. | +-------------------+---------------------------------------------+ | mvcc_freed | Number of frozen buffers freed. | +-------------------+---------------------------------------------+ | alloc | Number of page allocations. | +-------------------+---------------------------------------------+ | alloc_buckets | Number of hash buckets checked during | | | allocation. | +-------------------+---------------------------------------------+ | alloc_max_buckets | Maximum number of hash buckets checked | | | during an allocation. | +-------------------+---------------------------------------------+ | alloc_pages | Number of pages checked during allocation. | +-------------------+---------------------------------------------+ | alloc_max_pages | Maximum number of pages checked during an | | | allocation. | +-------------------+---------------------------------------------+ | io_wait | Number of operations blocked waiting for | | | I/O to complete. | +-------------------+---------------------------------------------+ | sync_interrupted | Number of mpool sync operations | | | interrupted. | +-------------------+---------------------------------------------+ The second dictionary contains these data: +-------------------+---------------------------------------------+ | pagesize | Page size in bytes. | +-------------------+---------------------------------------------+ | cache_hit | Requested pages found in the cache. | +-------------------+---------------------------------------------+ | cache_miss | Requested pages not found in the cache. | +-------------------+---------------------------------------------+ | map | Requested pages mapped into the process' | | | address space. | +-------------------+---------------------------------------------+ | page_create | Pages created in the cache. | +-------------------+---------------------------------------------+ | page_in | Pages read into the cache. | +-------------------+---------------------------------------------+ | page_out | Pages written from the cache to the backing | | | file. | +-------------------+---------------------------------------------+ :OracleAPIC:`More info... ` .. function:: memp_stat_print(flags=0) Displays cache subsystem statistical information. :OracleAPIC:`More info... ` .. function:: memp_sync(lsn=None) Flushes modified pages in the cache to their backing files. If provided, lsn is a tuple: (file, offset). :OracleAPIC:`More info... ` .. function:: memp_trickle(percent) Ensures that a specified percent of the pages in the cache are clean, by writing dirty pages to their backing files. :OracleAPIC:`More info... ` .. function:: remove(homedir, flags=0) Remove a database environment. :OracleAPIC:`More info... ` .. function:: dbremove(file, database=None, txn=None, flags=0) Removes the database specified by the file and database parameters. If no database is specified, the underlying file represented by file is removed, incidentally removing all of the databases it contained. :OracleAPIC:`More info... ` .. function:: dbrename(file, database=None, newname, txn=None, flags=0) Renames the database specified by the file and database parameters to newname. If no database is specified, the underlying file represented by file is renamed, incidentally renaming all of the databases it contained. :OracleAPIC:`More info... ` .. function:: fileid_reset(file, flags=0) All databases contain an ID string used to identify the database in the database environment cache. If a physical database file is copied, and used in the same environment as another file with the same ID strings, corruption can occur. The DB_ENV->fileid_reset method creates new ID strings for all of the databases in the physical file. :OracleAPIC:`More info... ` .. function:: get_thread_count() Returns the thread count as set by the DB_ENV->set_thread_count() method. :OracleAPIC:`More info... ` .. function:: set_thread_count(count) Declare an approximate number of threads in the database environment. The DB_ENV->set_thread_count() method must be called prior to opening the database environment if the DB_ENV->failchk() method will be used. The DB_ENV->set_thread_count() method does not set the maximum number of threads but is used to determine memory sizing and the thread control block reclamation policy. :OracleAPIC:`More info... ` .. function:: set_encrypt(passwd, flags=0) Set the password used by the Berkeley DB library to perform encryption and decryption. :OracleAPIC:`More info... ` .. function:: get_encrypt_flags() Returns the encryption flags. :OracleAPIC:`More info... ` .. function:: get_intermediate_dir_mode() Returns the intermediate directory permissions. Intermediate directories are directories needed for recovery. Normally, Berkeley DB does not create these directories and will do so only if the DB_ENV->set_intermediate_dir_mode() method is called. :OracleAPIC:`More info... ` .. function:: set_intermediate_dir_mode(mode) By default, Berkeley DB does not create intermediate directories needed for recovery, that is, if the file /a/b/c/mydatabase is being recovered, and the directory path b/c does not exist, recovery will fail. This default behavior is because Berkeley DB does not know what permissions are appropriate for intermediate directory creation, and creating the directory might result in a security problem. The DB_ENV->set_intermediate_dir_mode() method causes Berkeley DB to create any intermediate directories needed during recovery, using the specified permissions. :OracleAPIC:`More info... ` .. function:: get_timeout(flags) Returns a timeout value, in microseconds. :OracleAPIC:`More info... ` .. function:: set_timeout(timeout, flags) Sets timeout values for locks or transactions in the database environment. :OracleAPIC:`More info... ` .. function:: get_mp_max_openfd() Returns the maximum number of file descriptors the library will open concurrently when flushing dirty pages from the cache. :OracleAPIC:`More info... ` .. function:: set_mp_max_openfd(max_open_fd) Limits the number of file descriptors the library will open concurrently when flushing dirty pages from the cache. :OracleAPIC:`More info... ` .. function:: get_mp_max_write() Returns a tuple with the current maximum number of sequential write operations and microseconds to pause that the library can schedule when flushing dirty pages from the cache. :OracleAPIC:`More info... ` .. function:: set_mp_max_write(maxwrite, maxwrite_sleep) Limits the number of sequential write operations scheduled by the library when flushing dirty pages from the cache. :OracleAPIC:`More info... ` .. function:: set_shm_key(key) Specify a base segment ID for Berkeley DB environment shared memory regions created in system memory on VxWorks or systems supporting X/Open-style shared memory interfaces; for example, UNIX systems supporting shmget(2) and related System V IPC interfaces. :OracleAPIC:`More info... ` .. function:: get_shm_key() Returns the base segment ID. :OracleAPIC:`More info... ` .. function:: set_cache_max(gbytes, bytes) Sets the maximum cache size, in bytes. The specified size is rounded to the nearest multiple of the cache region size, which is the initial cache size divided by the number of regions specified to the DB_ENV->set_cachesize() method. If no value is specified, it defaults to the initial cache size. :OracleAPIC:`More info... ` .. function:: get_cache_max() Returns the maximum size of the cache as set using the DB_ENV->set_cache_max() method. :OracleAPIC:`More info... ` .. function:: set_cachesize(gbytes, bytes, ncache=0) Set the size of the shared memory buffer pool. :OracleAPIC:`More info... ` .. function:: get_cachesize() Returns a tuple with the current size and composition of the cache. :OracleAPIC:`More info... ` .. function:: set_data_dir(dir) Set the environment data directory. You can call this function multiple times, adding new directories. :OracleAPIC:`More info... ` .. function:: get_data_dirs() Return a tuple with the directories. :OracleAPIC:`More info... ` .. function:: get_flags() Returns the configuration flags set for a DB_ENV handle. :OracleAPIC:`More info... ` .. function:: set_flags(flags, onoff) Set additional flags for the DBEnv. The onoff parameter specifes if the flag is set or cleared. :OracleAPIC:`More info... ` .. function:: set_tmp_dir(dir) Set the directory to be used for temporary files. :OracleAPIC:`More info... ` .. function:: get_tmp_dir() Returns the database environment temporary file directory. :OracleAPIC:`More info... ` .. function:: set_get_returns_none(flag) By default when DB.get or DBCursor.get, get_both, first, last, next or prev encounter a DB_NOTFOUND error they return None instead of raising DBNotFoundError. This behaviour emulates Python dictionaries and is convenient for looping. You can use this method to toggle that behaviour for all of the aformentioned methods or extend it to also apply to the DBCursor.set, set_both, set_range, and set_recno methods. Supported values of flag: - **0** all DB and DBCursor get and set methods will raise a DBNotFoundError rather than returning None. - **1** *Default in module version <4.2.4* The DB.get and DBCursor.get, get_both, first, last, next and prev methods return None. - **2** *Default in module version >=4.2.4* Extends the behaviour of **1** to the DBCursor set, set_both, set_range and set_recno methods. The default of returning None makes it easy to do things like this without having to catch DBNotFoundError (KeyError):: data = mydb.get(key) if data: doSomething(data) or this:: rec = cursor.first() while rec: print rec rec = cursor.next() Making the cursor set methods return None is useful in order to do this:: rec = mydb.set() while rec: key, val = rec doSomething(key, val) rec = mydb.next() The downside to this it that it is inconsistent with the rest of the package and noticeably diverges from the Oracle Berkeley DB API. If you prefer to have the get and set methods raise an exception when a key is not found, use this method to tell them to do so. Calling this method on a DBEnv object will set the default for all DB's later created within that environment. Calling it on a DB object sets the behaviour for that DB only. The previous setting is returned. .. function:: set_private(object) Link an object to the DBEnv object. This allows to pass around an arbitrary object. For instance, for callback context. .. function:: get_private() Give the object linked to the DBEnv. .. function:: get_open_flags() Returns the current open method flags. That is, this method returns the flags that were specified when DB_ENV->open() was called. :OracleAPIC:`More info... ` .. function:: get_lg_filemode() Returns the log file mode. :OracleAPIC:`More info... ` .. function:: set_lg_filemode(filemode) Set the absolute file mode for created log files. :OracleAPIC:`More info... ` .. function:: get_lg_bsize() Returns the size of the log buffer, in bytes. :OracleAPIC:`More info... ` .. function:: set_lg_bsize(size) Set the size of the in-memory log buffer, in bytes. :OracleAPIC:`More info... ` .. function:: get_lg_dir() Returns the log directory, which is the location for logging files. :OracleAPIC:`More info... ` .. function:: set_lg_dir(dir) The path of a directory to be used as the location of logging files. Log files created by the Log Manager subsystem will be created in this directory. :OracleAPIC:`More info... ` .. function:: set_lg_max(size) Set the maximum size of a single file in the log, in bytes. :OracleAPIC:`More info... ` .. function:: get_lg_max(size) Returns the maximum log file size. :OracleAPIC:`More info... ` .. function:: get_lg_regionmax() Returns the size of the underlying logging subsystem region. :OracleAPIC:`More info... ` .. function:: set_lg_regionmax(size) Set the maximum size of a single region in the log, in bytes. :OracleAPIC:`More info... ` .. function:: get_lk_partitions() Returns the number of lock table partitions used in the Berkeley DB environment. :OracleAPIC:`More info... ` .. function:: set_lk_partitions(partitions) Set the number of lock table partitions in the Berkeley DB environment. :OracleAPIC:`More info... ` .. function:: get_lk_detect() Returns the deadlock detector configuration. :OracleAPIC:`More info... ` .. function:: set_lk_detect(mode) Set the automatic deadlock detection mode. :OracleAPIC:`More info... ` .. function:: set_lk_max(max) Set the maximum number of locks. (This method is deprecated.) :OracleAPIC:`More info... ` .. function:: get_lk_max_locks() Returns the maximum number of potential locks. :OracleAPIC:`More info... ` .. function:: set_lk_max_locks(max) Set the maximum number of locks supported by the Berkeley DB lock subsystem. :OracleAPIC:`More info... ` .. function:: get_lk_max_lockers() Returns the maximum number of potential lockers. :OracleAPIC:`More info... ` .. function:: set_lk_max_lockers(max) Set the maximum number of simultaneous locking entities supported by the Berkeley DB lock subsystem. :OracleAPIC:`More info... ` .. function:: get_lk_max_objects() Returns the maximum number of locked objects. :OracleAPIC:`More info... ` .. function:: set_lk_max_objects(max) Set the maximum number of simultaneously locked objects supported by the Berkeley DB lock subsystem. :OracleAPIC:`More info... ` .. function:: get_mp_mmapsize() Returns the the maximum file size, in bytes, for a file to be mapped into the process address space. :OracleAPIC:`More info... ` .. function:: set_mp_mmapsize(size) Files that are opened read-only in the memory pool (and that satisfy a few other criteria) are, by default, mapped into the process address space instead of being copied into the local cache. This can result in better-than-usual performance, as available virtual memory is normally much larger than the local cache, and page faults are faster than page copying on many systems. However, in the presence of limited virtual memory it can cause resource starvation, and in the presence of large databases, it can result in immense process sizes. This method sets the maximum file size, in bytes, for a file to be mapped into the process address space. If no value is specified, it defaults to 10MB. :OracleAPIC:`More info... ` .. function:: stat_print(flags=0) Displays the default subsystem statistical information. :OracleAPIC:`More info... ` .. function:: log_file(lsn) Maps lsn to filenames, returning the name of the file containing the named record. :OracleAPIC:`More info... ` .. function:: log_printf(string, txn=None) Appends an informational message to the Berkeley DB database environment log files. :OracleAPIC:`More info... ` .. function:: log_archive(flags=0) Returns a list of log or database file names. By default, log_archive returns the names of all of the log files that are no longer in use (e.g., no longer involved in active transactions), and that may safely be archived for catastrophic recovery and then removed from the system. :OracleAPIC:`More info... ` .. function:: log_flush() Force log records to disk. Useful if the environment, database or transactions are used as ACI, instead of ACID. For example, if the environment is opened as DB_TXN_NOSYNC. :OracleAPIC:`More info... ` .. function:: log_get_config(which) Returns whether the specified which parameter is currently set or not. You can manage this value using the DB_ENV->log_set_config() method. :OracleAPIC:`More info... ` .. function:: log_set_config(flags, onoff) Configures the Berkeley DB logging subsystem. :OracleAPIC:`More info... ` .. function:: lock_detect(atype, flags=0) Run one iteration of the deadlock detector, returns the number of transactions aborted. :OracleAPIC:`More info... ` .. function:: lock_get(locker, obj, lock_mode, flags=0) Acquires a lock and returns a handle to it as a DBLock object. The locker parameter is an integer representing the entity doing the locking, and obj is an object representing the item to be locked. :OracleAPIC:`More info... ` .. function:: lock_id() Acquires a locker id, guaranteed to be unique across all threads and processes that have the DBEnv open. :OracleAPIC:`More info... ` .. function:: lock_id_free(id) Frees a locker ID allocated by the "dbenv.lock_id()" method. :OracleAPIC:`More info... ` .. function:: lock_put(lock) Release the lock. :OracleAPIC:`More info... ` .. function:: lock_stat(flags=0) Returns a dictionary of locking subsystem statistics with the following keys: +----------------+---------------------------------------------+ | id | Last allocated lock ID. | +----------------+---------------------------------------------+ | cur_maxid | The current maximum unused locker ID. | +----------------+---------------------------------------------+ | nmodes | Number of lock modes. | +----------------+---------------------------------------------+ | maxlocks | Maximum number of locks possible. | +----------------+---------------------------------------------+ | maxlockers | Maximum number of lockers possible. | +----------------+---------------------------------------------+ | maxobjects | Maximum number of objects possible. | +----------------+---------------------------------------------+ | nlocks | Number of current locks. | +----------------+---------------------------------------------+ | maxnlocks | Maximum number of locks at once. | +----------------+---------------------------------------------+ | nlockers | Number of current lockers. | +----------------+---------------------------------------------+ | nobjects | Number of current lock objects. | +----------------+---------------------------------------------+ | maxnobjects | Maximum number of lock objects at once. | +----------------+---------------------------------------------+ | maxnlockers | Maximum number of lockers at once. | +----------------+---------------------------------------------+ | nrequests | Total number of locks requested. | +----------------+---------------------------------------------+ | nreleases | Total number of locks released. | +----------------+---------------------------------------------+ | nupgrade | Total number of locks upgraded. | +----------------+---------------------------------------------+ | ndowngrade | Total number of locks downgraded. | +----------------+---------------------------------------------+ | lock_wait | The number of lock requests not immediately | | | available due to conflicts, for which the | | | thread of control waited. | +----------------+---------------------------------------------+ | lock_nowait | The number of lock requests not immediately | | | available due to conflicts, for which the | | | thread of control did not wait. | +----------------+---------------------------------------------+ | ndeadlocks | Number of deadlocks. | +----------------+---------------------------------------------+ | locktimeout | Lock timeout value. | +----------------+---------------------------------------------+ | nlocktimeouts | The number of lock requests that have timed | | | out. | +----------------+---------------------------------------------+ | txntimeout | Transaction timeout value. | +----------------+---------------------------------------------+ | ntxntimeouts | The number of transactions that have timed | | | out. This value is also a component of | | | ndeadlocks, the total number of deadlocks | | | detected. | +----------------+---------------------------------------------+ | objs_wait | The number of requests to allocate or | | | deallocate an object for which the thread | | | of control waited. | +----------------+---------------------------------------------+ | objs_nowait | The number of requests to allocate or | | | deallocate an object for which the thread | | | of control did not wait. | +----------------+---------------------------------------------+ | lockers_wait | The number of requests to allocate or | | | deallocate a locker for which the thread of | | | control waited. | +----------------+---------------------------------------------+ | lockers_nowait | The number of requests to allocate or | | | deallocate a locker for which the thread of | | | control did not wait. | +----------------+---------------------------------------------+ | locks_wait | The number of requests to allocate or | | | deallocate a lock structure for which the | | | thread of control waited. | +----------------+---------------------------------------------+ | locks_nowait | The number of requests to allocate or | | | deallocate a lock structure for which the | | | thread of control did not wait. | +----------------+---------------------------------------------+ | hash_len | Maximum length of a lock hash bucket. | +----------------+---------------------------------------------+ | regsize | Size of the region. | +----------------+---------------------------------------------+ | region_wait | Number of times a thread of control was | | | forced to wait before obtaining the region | | | lock. | +----------------+---------------------------------------------+ | region_nowait | Number of times a thread of control was | | | able to obtain the region lock without | | | waiting. | +----------------+---------------------------------------------+ :OracleAPIC:`More info... ` .. function:: lock_stat_print(flags=0) Displays the locking subsystem statistical information. :OracleAPIC:`More info... ` .. function:: get_tx_max() Returns the number of active transactions. :OracleAPIC:`More info... ` .. function:: set_tx_max(max) Set the maximum number of active transactions. :OracleAPIC:`More info... ` .. function:: get_tx_timestamp() Returns the recovery timestamp. :OracleAPIC:`More info... ` .. function:: set_tx_timestamp(timestamp) Recover to the time specified by timestamp rather than to the most current possible date. :OracleAPIC:`More info... ` .. function:: txn_begin(parent=None, flags=0) Creates and begins a new transaction. A DBTxn object is returned. :OracleAPIC:`More info... ` .. function:: txn_checkpoint(kbyte=0, min=0, flag=0) Flushes the underlying memory pool, writes a checkpoint record to the log and then flushes the log. :OracleAPIC:`More info... ` .. function:: txn_stat(flags=0) Return a dictionary of transaction statistics with the following keys: +--------------+---------------------------------------------+ | last_ckp | The LSN of the last checkpoint. | +--------------+---------------------------------------------+ | time_ckp | Time the last completed checkpoint finished | | | (as the number of seconds since the Epoch, | | | returned by the IEEE/ANSI Std 1003.1 POSIX | | | time interface). | +--------------+---------------------------------------------+ | last_txnid | Last transaction ID allocated. | +--------------+---------------------------------------------+ | maxtxns | Max number of active transactions possible. | +--------------+---------------------------------------------+ | nactive | Number of transactions currently active. | +--------------+---------------------------------------------+ | maxnactive | Max number of active transactions at once. | +--------------+---------------------------------------------+ | nsnapshot | The number of transactions on the snapshot | | | list. These are transactions which modified | | | a database opened with DB_MULTIVERSION, and | | | which have committed or aborted, but the | | | copies of pages they created are still in | | | the cache. | +--------------+---------------------------------------------+ | maxnsnapshot | The maximum number of transactions on the | | | snapshot list at any one time. | +--------------+---------------------------------------------+ | nbegins | Number of transactions that have begun. | +--------------+---------------------------------------------+ | naborts | Number of transactions that have aborted. | +--------------+---------------------------------------------+ | ncommits | Number of transactions that have committed. | +--------------+---------------------------------------------+ | nrestores | Number of transactions that have been | | | restored. | +--------------+---------------------------------------------+ | regsize | Size of the region. | +--------------+---------------------------------------------+ | region_wait | Number of times that a thread of control | | | was forced to wait before obtaining the | | | region lock. | +--------------+---------------------------------------------+ | region_nowait| Number of times that a thread of control | | | was able to obtain the region lock without | | | waiting. | +--------------+---------------------------------------------+ :OracleAPIC:`More info... ` .. function:: txn_stat_print(flags=0) Displays the transaction subsystem statistical information. :OracleAPIC:`More info... ` .. function:: lsn_reset(file=None,flags=0) This method allows database files to be moved from one transactional database environment to another. :OracleAPIC:`More info... ` .. function:: log_stat(flags=0) Returns a dictionary of logging subsystem statistics with the following keys: +-------------------+---------------------------------------------+ | magic | The magic number that identifies a file as | | | a log file. | +-------------------+---------------------------------------------+ | version | The version of the log file type. | +-------------------+---------------------------------------------+ | mode | The mode of any created log files. | +-------------------+---------------------------------------------+ | lg_bsize | The in-memory log record cache size. | +-------------------+---------------------------------------------+ | lg_size | The log file size. | +-------------------+---------------------------------------------+ | record | The number of records written to this log. | +-------------------+---------------------------------------------+ | w_mbytes | The number of megabytes written to this | | | log. | +-------------------+---------------------------------------------+ | w_bytes | The number of bytes over and above w_mbytes | | | written to this log. | +-------------------+---------------------------------------------+ | wc_mbytes | The number of megabytes written to this log | | | since the last checkpoint. | +-------------------+---------------------------------------------+ | wc_bytes | The number of bytes over and above | | | wc_mbytes written to this log since the | | | last checkpoint. | +-------------------+---------------------------------------------+ | wcount | The number of times the log has been | | | written to disk. | +-------------------+---------------------------------------------+ | wcount_fill | The number of times the log has been | | | written to disk because the in-memory log | | | record cache filled up. | +-------------------+---------------------------------------------+ | rcount | The number of times the log has been read | | | from disk. | +-------------------+---------------------------------------------+ | scount | The number of times the log has been | | | flushed to disk. | +-------------------+---------------------------------------------+ | cur_file | The current log file number. | +-------------------+---------------------------------------------+ | cur_offset | The byte offset in the current log file. | +-------------------+---------------------------------------------+ | disk_file | The log file number of the last record | | | known to be on disk. | +-------------------+---------------------------------------------+ | disk_offset | The byte offset of the last record known to | | | be on disk. | +-------------------+---------------------------------------------+ | maxcommitperflush | The maximum number of commits contained in | | | a single log flush. | +-------------------+---------------------------------------------+ | mincommitperflush | The minimum number of commits contained in | | | a single log flush that contained a commit. | +-------------------+---------------------------------------------+ | regsize | The size of the log region, in bytes. | +-------------------+---------------------------------------------+ | region_wait | The number of times that a thread of | | | control was forced to wait before obtaining | | | the log region mutex. | +-------------------+---------------------------------------------+ | region_nowait | The number of times that a thread of | | | control was able to obtain the log region | | | mutex without waiting. | +-------------------+---------------------------------------------+ :OracleAPIC:`More info... ` .. function:: log_stat_print(flags=0) Displays the logging subsystem statistical information. :OracleAPIC:`More info... ` .. function:: txn_recover() Returns a list of tuples (GID, TXN) of transactions prepared but still unresolved. This is used while doing environment recovery in an application using distributed transactions. This method must be called only from a single thread at a time. It should be called after DBEnv recovery. :OracleAPIC:`More info... ` .. function:: set_verbose(which, onoff) Turns specific additional informational and debugging messages in the Berkeley DB message output on and off. To see the additional messages, verbose messages must also be configured for the application. :OracleAPIC:`More info... ` .. function:: get_verbose(which) Returns whether the specified *which* parameter is currently set or not. :OracleAPIC:`More info... ` .. function:: set_event_notify(eventFunc) Configures a callback function which is called to notify the process of specific Berkeley DB events. :OracleAPIC:`More info... ` .. function:: mutex_stat(flags=0) Returns a dictionary of mutex subsystem statistics with the following keys: +-----------------+--------------------------------------------+ | mutex_align | The mutex alignment, in bytes. | +-----------------+--------------------------------------------+ | mutex_tas_spins | The number of times test-and-set mutexes | | | will spin without blocking. | +-----------------+--------------------------------------------+ | mutex_cnt | The total number of mutexes configured. | +-----------------+--------------------------------------------+ | mutex_free | The number of mutexes currently available. | +-----------------+--------------------------------------------+ | mutex_inuse | The number of mutexes currently in use. | +-----------------+--------------------------------------------+ | mutex_inuse_max | The maximum number of mutexes ever in use. | +-----------------+--------------------------------------------+ | regsize | The size of the mutex region, in bytes. | +-----------------+--------------------------------------------+ | region_wait | The number of times that a thread of | | | control was forced to wait before | | | obtaining the mutex region mutex. | +-----------------+--------------------------------------------+ | region_nowait | The number of times that a thread of | | | control was able to obtain the mutex | | | region mutex without waiting. | +-----------------+--------------------------------------------+ :OracleAPIC:`More info... ` .. function:: mutex_stat_print(flags=0) Displays the mutex subsystem statistical information. :OracleAPIC:`More info... ` .. function:: mutex_set_max(value) Configure the total number of mutexes to allocate. :OracleAPIC:`More info... ` .. function:: mutex_get_max() Returns the total number of mutexes allocated. :OracleAPIC:`More info... ` .. function:: mutex_set_increment(value) Configure the number of additional mutexes to allocate. :OracleAPIC:`More info... ` .. function:: mutex_get_increment() Returns the number of additional mutexes to allocate. :OracleAPIC:`More info... ` .. function:: mutex_set_align(align) Set the mutex alignment, in bytes. :OracleAPIC:`More info... ` .. function:: mutex_get_align() Returns the mutex alignment, in bytes. :OracleAPIC:`More info... ` .. function:: mutex_set_tas_spins(tas_spins) Specify that test-and-set mutexes should spin tas_spins times without blocking. Check the default values in the Oracle webpage. :OracleAPIC:`More info... ` .. function:: mutex_get_tas_spins() Returns the test-and-set spin count. :OracleAPIC:`More info... ` DBEnv Replication Manager Methods --------------------------------- This module automates many of the tasks needed to provide replication abilities in a Berkeley DB system. The module is fairly limited, but enough in many cases. Users more demanding must use the **full** Base Replication API. This module requires pthread support (in Unix), so you must compile Berkeley DB with it if you want to be able to use the Replication Manager. .. function:: repmgr_start(nthreads, flags) Starts the replication manager. :OracleAPIC:`More info... ` .. function:: repmgr_site(host, port) Returns a DB_SITE handle that defines a site's host/port network address. You use the DB_SITE handle to configure and manage replication sites. :OracleAPIC:`More info... ` .. function:: repmgr_site_by_eid(eid) Returns a DB_SITE handle based on the site's Environment ID value. You use the DB_SITE handle to configure and manage replication sites. :OracleAPIC:`More info... ` .. function:: repmgr_set_ack_policy(ack_policy) Specifies how master and client sites will handle acknowledgment of replication messages which are necessary for "permanent" records. :OracleAPIC:`More info... ` .. function:: repmgr_get_ack_policy() Returns the replication manager's client acknowledgment policy. :OracleAPIC:`More info... ` .. function:: repmgr_site_list() Returns a dictionary with the status of the sites currently known by the replication manager. The keys are the Environment ID assigned by the replication manager. This is the same value that is passed to the application's event notification function for the DB_EVENT_REP_NEWMASTER event. The values are tuples containing the hostname, the TCP/IP port number and the link status. :OracleAPIC:`More info... ` .. function:: repmgr_stat(flags=0) Returns a dictionary with the replication manager statistics. Keys are: +-----------------+-------------------------------------------------+ | perm_failed | The number of times a message critical for | | | maintaining database integrity (for example, a | | | transaction commit), originating at this site, | | | did not receive sufficient acknowledgement from | | | clients, according to the configured | | | acknowledgement policy and acknowledgement | | | timeout. | +-----------------+-------------------------------------------------+ | msgs_queued | The number of outgoing messages which could not | | | be transmitted immediately, due to a full | | | network buffer, and had to be queued for later | | | delivery. | +-----------------+-------------------------------------------------+ | msgs_dropped | The number of outgoing messages that were | | | completely dropped, because the outgoing | | | message queue was full. (Berkeley DB | | | replication is tolerant of dropped messages, | | | and will automatically request retransmission | | | of any missing messages as needed.) | +-----------------+-------------------------------------------------+ | connection_drop | The number of times an existing TCP/IP | | | connection failed. | +-----------------+-------------------------------------------------+ | connect_fail | The number of times an attempt to open a new | | | TCP/IP connection failed. | +-----------------+-------------------------------------------------+ :OracleAPIC:`More info... ` .. function:: repmgr_stat_print(flags=0) Displays the replication manager statistical information. :OracleAPIC:`More info... ` DBEnv Replication Methods ------------------------- This section provides the raw methods for replication. If possible, it is recommended to use the Replication Manager. .. function:: rep_elect(nsites, nvotes) Holds an election for the master of a replication group. :OracleAPIC:`More info... ` .. function:: rep_set_transport(envid, transportFunc) Initializes the communication infrastructure for a database environment participating in a replicated application. :OracleAPIC:`More info... ` .. function:: rep_process_messsage(control, rec, envid) Processes an incoming replication message sent by a member of the replication group to the local database environment. Returns a two element tuple. :OracleAPIC:`More info... ` .. function:: rep_start(flags, cdata=None) Configures the database environment as a client or master in a group of replicated database environments. The DB_ENV->rep_start method is not called by most replication applications. It should only be called by applications implementing their own network transport layer, explicitly holding replication group elections and handling replication messages outside of the replication manager framework. :OracleAPIC:`More info... ` .. function:: rep_sync() Forces master synchronization to begin for this client. This method is the other half of setting the DB_REP_CONF_DELAYCLIENT flag via the DB_ENV->rep_set_config method. :OracleAPIC:`More info... ` .. function:: rep_set_config(which, onoff) Configures the Berkeley DB replication subsystem. :OracleAPIC:`More info... ` .. function:: rep_get_config(which) Returns whether the specified which parameter is currently set or not. :OracleAPIC:`More info... ` .. function:: rep_set_limit(bytes) Sets a byte-count limit on the amount of data that will be transmitted from a site in response to a single message processed by the DB_ENV->rep_process_message method. The limit is not a hard limit, and the record that exceeds the limit is the last record to be sent. :OracleAPIC:`More info... ` .. function:: rep_get_limit() Gets a byte-count limit on the amount of data that will be transmitted from a site in response to a single message processed by the DB_ENV->rep_process_message method. The limit is not a hard limit, and the record that exceeds the limit is the last record to be sent. :OracleAPIC:`More info... ` .. function:: rep_set_request(minimum, maximum) Sets a threshold for the minimum and maximum time that a client waits before requesting retransmission of a missing message. Specifically, if the client detects a gap in the sequence of incoming log records or database pages, Berkeley DB will wait for at least min microseconds before requesting retransmission of the missing record. Berkeley DB will double that amount before requesting the same missing record again, and so on, up to a maximum threshold of max microseconds. :OracleAPIC:`More info... ` .. function:: rep_get_request() Returns a tuple with the minimum and maximum number of microseconds a client waits before requesting retransmission. :OracleAPIC:`More info... ` .. function:: rep_set_nsites(nsites) Specifies the total number of sites in a replication group. :OracleAPIC:`More info... ` .. function:: rep_get_nsites() Returns the total number of sites in the replication group. :OracleAPIC:`More info... ` .. function:: rep_set_priority(priority) Specifies the database environment's priority in replication group elections. The priority must be a positive integer, or 0 if this environment cannot be a replication group master. :OracleAPIC:`More info... ` .. function:: rep_get_priority() Returns the database environment priority. :OracleAPIC:`More info... ` .. function:: rep_set_timeout(which, timeout) Specifies a variety of replication timeout values. :OracleAPIC:`More info... ` .. function:: rep_get_timeout(which) Returns the timeout value for the specified *which* parameter. :OracleAPIC:`More info... ` .. function:: rep_set_clockskew(fast, slow) Sets the clock skew ratio among replication group members based on the fastest and slowest measurements among the group for use with master leases. :OracleAPIC:`More info... ` .. function:: rep_get_clockskew() Returns a tuple with the current clock skew values. :OracleAPIC:`More info... ` .. function:: rep_stat(flags=0) Returns a dictionary with the replication subsystem statistics. Keys are: +---------------------+---------------------------------------------+ | st_bulk_fills | The number of times the bulk buffer filled | | | up, forcing the buffer content to be sent. | +---------------------+---------------------------------------------+ | bulk_overflows | The number of times a record was bigger | | | than the entire bulk buffer, and therefore | | | had to be sent as a singleton. | +---------------------+---------------------------------------------+ | bulk_records | The number of records added to a bulk | | | buffer. | +---------------------+---------------------------------------------+ | bulk_transfers | The number of bulk buffers transferred (via | | | a call to the application's send function). | +---------------------+---------------------------------------------+ | client_rerequests | The number of times this client site | | | received a "re-request" message, indicating | | | that a request it previously sent to | | | another client could not be serviced by | | | that client. (Compare to client_svc_miss.) | +---------------------+---------------------------------------------+ | client_svc_miss | The number of "request" type messages | | | received by this client that could not be | | | processed, forcing the originating | | | requester to try sending the request to the | | | master (or another client). | +---------------------+---------------------------------------------+ | client_svc_req | The number of "request" type messages | | | received by this client. ("Request" | | | messages are usually sent from a client to | | | the master, but a message marked with the | | | DB_REP_ANYWHERE flag in the invocation of | | | the application's send function may be sent | | | to another client instead.) | +---------------------+---------------------------------------------+ | dupmasters | The number of duplicate master conditions | | | originally detected at this site. | +---------------------+---------------------------------------------+ | egen | The current election generation number. | +---------------------+---------------------------------------------+ | election_cur_winner | The election winner. | +---------------------+---------------------------------------------+ | election_gen | The election generation number. | +---------------------+---------------------------------------------+ | election_lsn | The maximum LSN of election winner. | +---------------------+---------------------------------------------+ | election_nsites | The number sites responding to this site | | | during the last election. | +---------------------+---------------------------------------------+ | election_nvotes | The number of votes required in the last | | | election. | +---------------------+---------------------------------------------+ | election_priority | The election priority. | +---------------------+---------------------------------------------+ | election_sec | The number of seconds the last election | | | took (the total election time is | | | election_sec plus election_usec). | +---------------------+---------------------------------------------+ | election_status | The current election phase (0 if no | | | election is in progress). | +---------------------+---------------------------------------------+ | election_tiebreaker | The election tiebreaker value. | +---------------------+---------------------------------------------+ | election_usec | The number of microseconds the last | | | election took (the total election time is | | | election_sec plus election_usec). | +---------------------+---------------------------------------------+ | election_votes | The number of votes received in the last | | | election. | +---------------------+---------------------------------------------+ | elections | The number of elections held. | +---------------------+---------------------------------------------+ | elections_won | The number of elections won. | +---------------------+---------------------------------------------+ | env_id | The current environment ID. | +---------------------+---------------------------------------------+ | env_priority | The current environment priority. | +---------------------+---------------------------------------------+ | gen | The current generation number. | +---------------------+---------------------------------------------+ | log_duplicated | The number of duplicate log records | | | received. | +---------------------+---------------------------------------------+ | log_queued | The number of log records currently queued. | +---------------------+---------------------------------------------+ | log_queued_max | The maximum number of log records ever | | | queued at once. | +---------------------+---------------------------------------------+ | log_queued_total | The total number of log records queued. | +---------------------+---------------------------------------------+ | log_records | The number of log records received and | | | appended to the log. | +---------------------+---------------------------------------------+ | log_requested | The number of times log records were missed | | | and requested. | +---------------------+---------------------------------------------+ | master | The current master environment ID. | +---------------------+---------------------------------------------+ | master_changes | The number of times the master has changed. | +---------------------+---------------------------------------------+ | max_lease_sec | The number of seconds of the longest lease | | | (the total lease time is max_lease_sec plus | | | max_lease_usec). | +---------------------+---------------------------------------------+ | max_lease_usec | The number of microseconds of the longest | | | lease (the total lease time is | | | max_lease_sec plus max_lease_usec). | +---------------------+---------------------------------------------+ | max_perm_lsn | The LSN of the maximum permanent log | | | record, or 0 if there are no permanent log | | | records. | +---------------------+---------------------------------------------+ | msgs_badgen | The number of messages received with a bad | | | generation number. | +---------------------+---------------------------------------------+ | msgs_processed | The number of messages received and | | | processed. | +---------------------+---------------------------------------------+ | msgs_recover | The number of messages ignored due to | | | pending recovery. | +---------------------+---------------------------------------------+ | msgs_send_failures | The number of failed message sends. | +---------------------+---------------------------------------------+ | msgs_sent | The number of messages sent. | +---------------------+---------------------------------------------+ | newsites | The number of new site messages received. | +---------------------+---------------------------------------------+ | next_lsn | In replication environments configured as | | | masters, the next LSN expected. In | | | replication environments configured as | | | clients, the next LSN to be used. | +---------------------+---------------------------------------------+ | next_pg | The next page number we expect to receive. | +---------------------+---------------------------------------------+ | nsites | The number of sites used in the last | | | election. | +---------------------+---------------------------------------------+ | nthrottles | Transmission limited. This indicates the | | | number of times that data transmission was | | | stopped to limit the amount of data sent in | | | response to a single call to | | | DB_ENV->rep_process_message. | +---------------------+---------------------------------------------+ | outdated | The number of outdated conditions detected. | +---------------------+---------------------------------------------+ | pg_duplicated | The number of duplicate pages received. | +---------------------+---------------------------------------------+ | pg_records | The number of pages received and stored. | +---------------------+---------------------------------------------+ | pg_requested | The number of pages missed and requested | | | from the master. | +---------------------+---------------------------------------------+ | startsync_delayed | The number of times the client had to delay | | | the start of a cache flush operation | | | (initiated by the master for an impending | | | checkpoint) because it was missing some | | | previous log record(s). | +---------------------+---------------------------------------------+ | startup_complete | The client site has completed its startup | | | procedures and is now handling live records | | | from the master. | +---------------------+---------------------------------------------+ | status |The current replication mode. Set to | | | DB_REP_MASTER if the environment is a | | | replication master, DB_REP_CLIENT if the | | | environment is a replication client, or 0 | | | if replication is not configured. | +---------------------+---------------------------------------------+ | txns_applied | The number of transactions applied. | +---------------------+---------------------------------------------+ | waiting_lsn | The LSN of the first log record we have | | | after missing log records being waited for, | | | or 0 if no log records are currently | | | missing. | +---------------------+---------------------------------------------+ | waiting_pg | The page number of the first page we have | | | after missing pages being waited for, or 0 | | | if no pages are currently missing. | +---------------------+---------------------------------------------+ :OracleAPIC:`More info... ` .. function:: rep_stat_print(flags=0) Displays the replication subsystem statistical information. :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/dbsite.rst0000644000175000017500000000254113316226204015452 0ustar jceajcea00000000000000========== DBSite ========== Read :Oracle:`Oracle documentation ` for better understanding. You use the DB_SITE handle to configure and manage replication sites. :OracleAPIC:`More info... ` DBSite Methods ------------------ .. function:: close(flags=0) Close a DBSite handle. :OracleAPIC:`More info... ` .. function:: get_address() Returns a replication site's network address. That is, this method returns a tuple with the site's hostname and port. :OracleAPIC:`More info... ` .. function:: get_config() Returns whether the specified which parameter is currently set. :OracleAPIC:`More info... ` .. function:: get_eid() Returns a replication site's Environment ID (EID). :OracleAPIC:`More info... ` .. function:: remove() Removes the site from the replication group. If called at the master site, repmgr updates the membership database directly. If called from a client, this method causes a request to be sent to the master to perform the operation. The method then awaits confirmation. :OracleAPIC:`More info... ` .. function:: set_config(which, value) Configures a replication site. :OracleAPIC:`More info... ` bsddb3-6.2.7/docs/html/0000775000175000017500000000000013617133045014416 5ustar jceajcea00000000000000bsddb3-6.2.7/docs/html/contents.html0000664000175000017500000002337413617125467017163 0ustar jceajcea00000000000000 Python Bindings for Berkeley DB 4.7, 4.8, 5.1, 5.3, 6.1 and 6.2 — PyBSDDB 6.2.7 documentation

Python Bindings for Berkeley DB 4.7, 4.8, 5.1, 5.3, 6.1 and 6.2

Introduction

This handcrafted package contains Python wrappers for Berkeley DB, the Open Source embedded database system. Berkeley DB is a programmatic toolkit that provides high-performance built-in database support for desktop and server applications.

The Berkeley DB access methods include B+tree, Extended Linear Hashing, Fixed and Variable-length records, and Queues. Berkeley DB provides full transactional support, database recovery, online backups, multi-threaded and multi-process access, etc.

The Python wrappers allow you to store Python string objects of any length, keyed either by strings or integers depending on the database access method. With the use of another module in the package standard shelve-like functionality is provided allowing you to store any picklable Python object!

Berkeley DB is very powerful and versatile, but it is complex to use correctly. Oracle documentation is very complete. Please, review it.

Since June 2013 (release 6.0.0), this project accepts donations. Please, contribute if you can. Details.

bsddb3-6.2.7/docs/html/dbsequence.html0000664000175000017500000003304213617125467017435 0ustar jceajcea00000000000000 DBSequence — PyBSDDB 6.2.7 documentation

DBSequence

Read Oracle documentation for better understanding.

Sequences provide an arbitrary number of persistent objects that return an increasing or decreasing sequence of integers. Opening a sequence handle associates it with a record in a database. The handle can maintain a cache of values from the database so that a database update is not needed as the application allocates a value.

More info…

DBSequence Methods

DBSequence(db, flags=0)

Constructor. More info…

open(key, txn=None, flags=0)

Opens the sequence represented by the key. More info…

close(flags=0)

Close a DBSequence handle. More info…

initial_value(value)

Set the initial value for a sequence. This call is only effective when the sequence is being created. More info…

get(delta=1, txn=None, flags=0)

Returns the next available element in the sequence and changes the sequence value by delta. More info…

get_dbp()

Returns the DB object associated to the DBSequence. More info…

get_key()

Returns the key for the sequence. More info…

remove(txn=None, flags=0)

Removes the sequence from the database. This method should not be called if there are other open handles on this sequence. More info…

get_cachesize()

Returns the current cache size. More info…

set_cachesize(size)

Configure the number of elements cached by a sequence handle. More info…

get_flags()

Returns the current flags. More info…

set_flags(flags)

Configure a sequence. More info…

stat(flags=0)

Returns a dictionary of sequence statistics with the following keys:

wait

The number of times a thread of control was forced to wait on the handle mutex.

nowait

The number of times that a thread of control was able to obtain handle mutex without waiting.

current

The current value of the sequence in the database.

value

The current cached value of the sequence.

last_value

The last cached value of the sequence.

min

The minimum permitted value of the sequence.

max

The maximum permitted value of the sequence.

cache_size

The number of values that will be cached in this handle.

flags

The flags value for the sequence.

More info…

stat_print(flags=0)

Prints diagnostic information. More info…

get_range()

Returns a tuple representing the range of values in the sequence. More info…

set_range((min, max))

Configure a sequence range. More info…

bsddb3-6.2.7/docs/html/search.html0000664000175000017500000000773313617125467016574 0ustar jceajcea00000000000000 Search — PyBSDDB 6.2.7 documentation

Search

Please activate JavaScript to enable the search functionality.

From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list.

bsddb3-6.2.7/docs/html/dbcursor.html0000664000175000017500000005371213617125467017150 0ustar jceajcea00000000000000 DBCursor — PyBSDDB 6.2.7 documentation

DBCursor

Read Oracle documentation for better understanding.

More info…

DBCursor Methods

close()

Discards the cursor. If the cursor is created within a transaction then you must be sure to close the cursor before commiting the transaction. More info…

count(flags=0)

Returns a count of the number of duplicate data items for the key referenced by the cursor. More info…

delete(flags=0)

Deletes the key/data pair currently referenced by the cursor. More info…

dup(flags=0)

Create a new cursor. More info…

set_priority(priority)

Set the cache priority for pages referenced by the DBC handle. More info…

get_priority()

Returns the cache priority for pages referenced by the DBC handle. More info…

put(key, data, flags=0, dlen=-1, doff=-1)

Stores the key/data pair into the database. Partial data records can be written using dlen and doff. More info…

get(flags, dlen=-1, doff=-1)

See get(key, data, flags, dlen=-1, doff=-1) below.

get(key, flags, dlen=-1, doff=-1)

See get(key, data, flags, dlen=-1, doff=-1) below.

get(key, data, flags, dlen=-1, doff=-1)

Retrieves key/data pairs from the database using the cursor. All the specific functionalities of the get method are actually provided by the various methods below, which are the preferred way to fetch data using the cursor. These generic interfaces are only provided as an inconvenience. Partial data records are returned if dlen and doff are used in this method and in many of the specific methods below. More info…

pget(flags, dlen=-1, doff=-1)

See pget(key, data, flags, dlen=-1, doff=-1) below.

pget(key, flags, dlen=-1, doff=-1)

See pget(key, data, flags, dlen=-1, doff=-1) below.

pget(key, data, flags, dlen=-1, doff=-1)

Similar to the already described get(). This method is available only on secondary databases. It will return the primary key, given the secondary one, and associated data More info…

DBCursor Get Methods

These DBCursor methods are all wrappers around the get() function in the C API.

current(flags=0, dlen=-1, doff=-1)

Returns the key/data pair currently referenced by the cursor. More info…

get_current_size()

Returns length of the data for the current entry referenced by the cursor.

first(flags=0, dlen=-1, doff=-1)

Position the cursor to the first key/data pair and return it. More info…

last(flags=0, dlen=-1, doff=-1)

Position the cursor to the last key/data pair and return it. More info…

next(flags=0, dlen=-1, doff=-1)

Position the cursor to the next key/data pair and return it. More info…

prev(flags=0, dlen=-1, doff=-1)

Position the cursor to the previous key/data pair and return it. More info…

consume(flags=0, dlen=-1, doff=-1)

For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue.

NOTE: This method is deprecated in Berkeley DB version 3.2 in favor of the new consume method in the DB class.

get_both(key, data, flags=0)

Like set() but positions the cursor to the record matching both key and data. (An alias for this is set_both, which makes more sense to me…) More info…

get_recno()

Return the record number associated with the cursor. The database must use the BTree access method and have been created with the DB_RECNUM flag. More info…

join_item(flags=0)

For cursors returned from the DB.join method, returns the combined key value from the joined cursors. More info…

next_dup(flags=0, dlen=-1, doff=-1)

If the next key/data pair of the database is a duplicate record for the current key/data pair, the cursor is moved to the next key/data pair of the database, and that pair is returned. More info…

next_nodup(flags=0, dlen=-1, doff=-1)

The cursor is moved to the next non-duplicate key/data pair of the database, and that pair is returned. More info…

prev_dup(flags=0, dlen=-1, doff=-1)

If the previous key/data pair of the database is a duplicate data record for the current key/data pair, the cursor is moved to the previous key/data pair of the database, and that pair is returned. More info…

prev_nodup(flags=0, dlen=-1, doff=-1)

The cursor is moved to the previous non-duplicate key/data pair of the database, and that pair is returned. More info…

set(key, flags=0, dlen=-1, doff=-1)

Move the cursor to the specified key in the database and return the key/data pair found there. More info…

set_range(key, flags=0, dlen=-1, doff=-1)

Identical to set() except that in the case of the BTree access method, the returned key/data pair is the smallest key greater than or equal to the specified key (as determined by the comparison function), permitting partial key matches and range searches. More info…

set_recno(recno, flags=0, dlen=-1, doff=-1)

Move the cursor to the specific numbered record of the database, and return the associated key/data pair. The underlying database must be of type Btree and it must have been created with the DB_RECNUM flag. More info…

set_both(key, data, flags=0)

See get_both(). The only difference in behaviour can be disabled using set_get_returns_none(2). More info…

bsddb3-6.2.7/docs/html/genindex.html0000664000175000017500000007251013617125467017123 0ustar jceajcea00000000000000 Index — PyBSDDB 6.2.7 documentation

Index

A | C | D | E | F | G | H | I | J | K | L | M | N | O | P | R | S | T | U | V

A

C

D

E

F

G

H

I

J

K

L

M

N

O

P

R

S

T

U

V

bsddb3-6.2.7/docs/html/db.html0000664000175000017500000014465113617125467015715 0ustar jceajcea00000000000000 DB — PyBSDDB 6.2.7 documentation

DB

Read Oracle documentation for better understanding.

More info…

DB Methods

DB(dbEnv=None, flags=0)

Constructor. More info…

append(data, txn=None)

A convenient version of put() that can be used for Recno or Queue databases. The DB_APPEND flag is automatically used, and the record number is returned. More info…

associate(secondaryDB, callback, flags=0, txn=None)

Used to associate secondaryDB to act as a secondary index for this (primary) database. The callback parameter should be a reference to a Python callable object that will construct and return the secondary key or DB_DONOTINDEX if the item should not be indexed. The parameters the callback will receive are the primaryKey and primaryData values. More info…

close(flags=0)

Flushes cached data and closes the database. More info…

compact(start=None, stop=None, flags=0,
compact_fillpercent=0, compact_pages=0, compact_timeout=0)

Compacts Btree and Recno access method databases, and optionally returns unused Btree, Hash or Recno database pages to the underlying filesystem.

The method returns the number of pages returned to the filesystem. More info…

consume(txn=None, flags=0)

For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue. More info…

consume_wait(txn=None, flags=0)

For a database with the Queue access method, returns the record number and data from the first available record and deletes it from the queue. If the Queue database is empty, the thread of control will wait until there is data in the queue before returning. More info…

cursor(txn=None, flags=0)

Create a cursor on the DB and returns a DBCursor object. If a transaction is passed then the cursor can only be used within that transaction and you must be sure to close the cursor before commiting the transaction. More info…

delete(key, txn=None, flags=0)

Removes a key/data pair from the database. More info…

exists(key, txn=None, flags=0)

Test if a key exists in the database. Returns True or False. More info…

fd()

Returns a file descriptor for the database. More info…

get(key, default=None, txn=None, flags=0, dlen=-1, doff=-1)

Returns the data object associated with key. If key is an integer then the DB_SET_RECNO flag is automatically set for BTree databases and the actual key and the data value are returned as a tuple. If default is given then it is returned if the key is not found in the database. Partial records can be read using dlen and doff, however be sure to not read beyond the end of the actual data or you may get garbage. More info…

pget(key, default=None, txn=None, flags=0, dlen=-1, doff=-1)

This method is available only on secondary databases. It will return the primary key, given the secondary one, and associated data. More info…

get_transactional()

Returns True if the database is transactional. False if not. More info…

get_priority()

Returns the cache priority for pages referenced by the DB handle. This priority value is set using the DB->set_priority() method. More info…

set_priority(priority)

Set the cache priority for pages referenced by the DB handle.

The priority of a page biases the replacement algorithm to be more or less likely to discard a page when space is needed in the buffer pool. The bias is temporary, and pages will eventually be discarded if they are not referenced again. The DB->set_priority() method is only advisory, and does not guarantee pages will be treated in a specific way.

The value provided must be symbolic. Check the Oracle documentation.

More info…

get_dbname()

Returns a tuple with the filename and the database name. If there is no database name, the value returned will be None. More info…

get_open_flags()

Returns the current open method flags. That is, this method returns the flags that were specified when DB->open() was called. More info…

set_private(object)

Link an object to the DB object. This allows to pass around an arbitrary object. For instance, for callback context.

get_private()

Give the object linked to the DB.

get_both(key, data, txn=None, flags=0)

A convenient version of get() that automatically sets the DB_GET_BOTH flag, and which will be successful only if both the key and data value are found in the database. (Can be used to verify the presence of a record in the database when duplicate keys are allowed.) More info…

get_byteswapped()

May be used to determine if the database was created on a machine with the same endianess as the current machine. More info…

get_size(key, txn=None)

Return the size of the data object associated with key.

get_type()

Return the database’s access method type. More info…

join(cursorList, flags=0)

Create and return a specialized cursor for use in performing joins on secondary indices. More info…

key_range(key, txn=None, flags=0)

Returns an estimate of the proportion of keys that are less than, equal to and greater than the specified key. More info…

open(filename, dbname=None, dbtype=DB_UNKNOWN, flags=0, mode=0660, txn=None)

Opens the database named dbname in the file named filename. The dbname argument is optional and allows applications to have multiple logical databases in a single physical file. It is an error to attempt to open a second database in a file that was not initially created using a database name. In-memory databases never intended to be shared or preserved on disk may be created by setting both the filename and dbname arguments to None. More info…

put(key, data, txn=None, flags=0, dlen=-1, doff=-1)

Stores the key/data pair in the database. If the DB_APPEND flag is used and the database is using the Recno or Queue access method then the record number allocated to the data is returned. Partial data objects can be written using dlen and doff. More info…

remove(filename, dbname=None, flags=0)

Remove a database. More info…

rename(filename, dbname, newname, flags=0)

Rename a database. More info…

set_encrypt(passwd, flags=0)

Set the password used by the Berkeley DB library to perform encryption and decryption. Because databases opened within Berkeley DB environments use the password specified to the environment, it is an error to attempt to set a password in a database created within an environment. More info…

get_encrypt_flags()

Returns the encryption flags. More info…

set_bt_compare(compareFunc)

Set the B-Tree database comparison function. This can only be called once before the database has been opened. compareFunc takes two arguments: (left key string, right key string) It must return a -1, 0, 1 integer similar to cmp. You can shoot your database in the foot, beware! Read the Berkeley DB docs for the full details of how the comparison function MUST behave. More info…

get_bt_minkey()

Returns the minimum number of key/data pairs intended to be stored on any single Btree leaf page. This value can be set using the DB->set_bt_minkey() method. More info…

set_bt_minkey(minKeys)

Set the minimum number of keys that will be stored on any single BTree page. More info…

set_cachesize(gbytes, bytes, ncache=0)

Set the size of the database’s shared memory buffer pool. More info…

get_cachesize()

Returns a tuple with the current size and composition of the cache. More info…

set_dup_compare(compareFunc)

Set the duplicate data item comparison function. This can only be called once before the database has been opened. compareFunc takes two arguments: (left key string, right key string) It must return a -1, 0, 1 integer similar to cmp. You can shoot your database in the foot, beware! Read the Berkeley DB docs for the full details of how the comparison function MUST behave. More info…

set_get_returns_none(flag)

Controls what get and related methods do when a key is not found.

See the DBEnv set_get_returns_none documentation.

The previous setting is returned.

get_flags()

Returns the current database flags as set by the DB->set_flags() method. More info…

set_flags(flags)

Set additional flags on the database before opening. More info…

get_h_ffactor()

Returns the hash table density as set by the DB->set_h_ffactor() method. More info…

set_h_ffactor(ffactor)

Set the desired density within the hash table. More info…

get_h_nelem()

Returns the estimate of the final size of the hash table as set by the DB->set_h_nelem() method. More info…

set_h_nelem(nelem)

Set an estimate of the final size of the hash table. More info…

get_lorder()

Returns the database byte order; a byte order of 4,321 indicates a big endian order, and a byte order of 1,234 indicates a little endian order. This value is set using the DB->set_lorder() method. More info…

set_lorder(lorder)

Set the byte order for integers in the stored database metadata. More info…

get_pagesize()

Returns the database’s current page size, as set by the DB->set_pagesize() method. More info…

set_pagesize(pagesize)

Set the size of the pages used to hold items in the database, in bytes. More info…

get_re_delim()

Returns the delimiting byte, which is used to mark the end of a record in the backing source file for the Recno access method. The return value will be a numeric byte value. More info…

set_re_delim(delim)

Set the delimiting byte used to mark the end of a record in the backing source file for the Recno access method. You can specify a char or a numeric byte value. More info…

get_re_len()

Returns the length of the records held in a Queue access method database. This value can be set using the DB->set_re_len() method. More info…

set_re_len(length)

For the Queue access method, specify that the records are of length length. For the Recno access method, specify that the records are fixed-length, not byte delimited, and are of length length. More info…

get_re_pad()

Returns the pad character used for short, fixed-length records used by the Queue and Recno access methods. The method returns a byte value. More info…

set_re_pad(pad)

Set the padding character for short, fixed-length records for the Queue and Recno access methods. You can specify a char or a numeric byte value. More info…

get_re_source()

Returns the source file used by the Recno access method. This file is configured for the Recno access method using the DB->set_re_source() method. More info…

set_re_source(source)

Set the underlying source file for the Recno access method. More info…

get_q_extentsize()

Returns the number of pages in an extent. This value is used only for Queue databases and is set using the DB->set_q_extentsize() method. More info…

set_q_extentsize(extentsize)

Set the size of the extents used to hold pages in a Queue database, specified as a number of pages. Each extent is created as a separate physical file. If no extent size is set, the default behavior is to create only a single underlying database file. More info…

stat(flags=0, txn=None)

Return a dictionary containing database statistics with the following keys.

For Hash databases:

magic

Magic number that identifies the file as a Hash database.

version

Version of the Hash database.

nkeys

Number of unique keys in the database.

ndata

Number of key/data pairs in the database.

pagecnt

The number of pages in the database.

pagesize

Underlying Hash database page (& bucket) size.

nelem

Estimated size of the hash table specified at database creation time.

ffactor

Desired fill factor (number of items per bucket) specified at database creation time.

buckets

Number of hash buckets.

free

Number of pages on the free list.

bfree

Number of bytes free on bucket pages.

bigpages

Number of big key/data pages.

big_bfree

Number of bytes free on big item pages.

overflows

Number of overflow pages (overflow pages are pages that contain items that did not fit in the main bucket page).

ovfl_free

Number of bytes free on overflow pages.

dup

Number of duplicate pages.

dup_free

Number of bytes free on duplicate pages.

For BTree and Recno databases:

magic

Magic number that identifies the file as a Btree database.

version

Version of the Btree database.

nkeys

For the Btree Access Method, the number of unique keys in the database.

For the Recno Access Method, the number of records in the database. If the database has been configured to not re-number records during deletion, the number of records may include records that have been deleted.

ndata

For the Btree Access Method, the number of key/data pairs in the database.

For the Recno Access Method, the number of records in the database. If the database has been configured to not re-number records during deletion, the number of records may include records that have been deleted.

pagecnt

The number of pages in the database.

pagesize

Underlying database page size.

minkey

Minimum keys per page.

re_len

Length of fixed-length records.

re_pad

Padding byte value for fixed-length records.

levels

Number of levels in the database.

int_pg

Number of database internal pages.

leaf_pg

Number of database leaf pages.

dup_pg

Number of database duplicate pages.

over_pg

Number of database overflow pages.

empty_pg

Number of empty database pages.

free

Number of pages on the free list.

int_pgfree

Num of bytes free in database internal pages.

leaf_pgfree

Number of bytes free in database leaf pages.

dup_pgfree

Num bytes free in database duplicate pages.

over_pgfree

Num of bytes free in database overflow pages.

For Queue databases:

magic

Magic number that identifies the file as a Queue database.

version

Version of the Queue file type.

nkeys

Number of records in the database.

ndata

Number of records in the database.

pagesize

Underlying database page size.

extentsize

Underlying database extent size, in pages.

pages

Number of pages in the database.

re_len

Length of the records.

re_pad

Padding byte value for the records.

pgfree

Number of bytes free in database pages.

first_recno

First undeleted record in the database.

cur_recno

Last allocated record number in the database.

More info…

stat_print(flags=0)

Displays the database statistical information. More info…

sync(flags=0)

Flushes any cached information to disk. More info…

truncate(txn=None, flags=0)

Empties the database, discarding all records it contains. The number of records discarded from the database is returned. More info…

upgrade(filename, flags=0)

Upgrades all of the databases included in the file filename, if necessary. More info…

verify(filename, dbname=None, outfile=None, flags=0)

Verifies the integrity of all databases in the file specified by the filename argument, and optionally outputs the databases’ key/data pairs to a file. More info…

DB Mapping and Compatibility Methods

These methods of the DB type are for implementing the Mapping Interface, as well as others for making a DB behave as much like a dictionary as possible. The main downside to using a DB as a dictionary is you are not able to specify a transaction object.

DB_length() [ usage: len(db) ]

Return the number of key/data pairs in the database.

DB_subscript(key) [ usage: db[key] ]

Return the data associated with key.

DB_ass_sub(key, data) [ usage: db[key] = data ]

Assign or update a key/data pair, or delete a key/data pair if data is NULL.

keys(txn=None)

Return a list of all keys in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete.

items(txn=None)

Return a list of tuples of all key/data pairs in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete.

values(txn=None)

Return a list of all data values in the database. Warning: this method traverses the entire database so it can possibly take a long time to complete.

has_key(key, txn=None)

Returns true if key is present in the database.

bsddb3-6.2.7/docs/html/dbsite.html0000664000175000017500000001677113617125467016603 0ustar jceajcea00000000000000 DBSite — PyBSDDB 6.2.7 documentation

DBSite

Read Oracle documentation for better understanding.

You use the DB_SITE handle to configure and manage replication sites.

More info…

DBSite Methods

close(flags=0)

Close a DBSite handle. More info…

get_address()

Returns a replication site’s network address. That is, this method returns a tuple with the site’s hostname and port. More info…

get_config()

Returns whether the specified which parameter is currently set. More info…

get_eid()

Returns a replication site’s Environment ID (EID). More info…

remove()

Removes the site from the replication group. If called at the master site, repmgr updates the membership database directly. If called from a client, this method causes a request to be sent to the master to perform the operation. The method then awaits confirmation. More info…

set_config(which, value)

Configures a replication site. More info…

bsddb3-6.2.7/docs/html/images/0000775000175000017500000000000013617133045015663 5ustar jceajcea00000000000000bsddb3-6.2.7/docs/html/images/bitcoin.png0000664000175000017500000000207713316226203020021 0ustar jceajcea00000000000000PNG  IHDRL\sRGBbKGD pHYs+tIME X4%IDATxn0 EÀ'tܧaul Hq `0ݧ/<jM{>/xyWW#>Q s~o>2Q5F *R 69:T~IENDB`bsddb3-6.2.7/docs/html/dblogcursor.html0000664000175000017500000002117013617125467017643 0ustar jceajcea00000000000000 DBLogCursor — PyBSDDB 6.2.7 documentation

DBLogCursor

Read Oracle documentation for better understanding.

More info…

DBLogCursor Methods

close()

Discards the log cursor. More info…

DBLogCursor Get Methods

These DBLogCursor methods are all wrappers around the get() function in the C API.

These functions returns a tuple. The first element is a LSN tuple, and the second element is a string/bytes with the log data.

If the following methods don’t have log data to return, they return None.

current()

Return the log record to which the log currently refers. More info…

first()

The first record from any of the log files found in the log directory is returned.

This method will return None if the log is empty.

More info…

last()

The last record in the log is returned.

This method will return None if the log is empty.

More info…

next()

The current log position is advanced to the next record in the log, and that record is returned. If the cursor position was not set previously, it will return the first record in the log.

This method will return None if the log is empty.

More info…

prev()

The current log position is advanced to the previous record in the log, and that record is returned. If the cursor position was not set previously, it will return the last record in the log.

This method will return None if the log is empty.

More info…

set(lsn)

Retrieve the record specified by the lsn parameter.

More info…

bsddb3-6.2.7/docs/html/dbtxn.html0000664000175000017500000002154313617125467016441 0ustar jceajcea00000000000000 DBTxn — PyBSDDB 6.2.7 documentation

DBTxn

Read Oracle documentation for better understanding.

More info…

DBTxn Methods

abort()

Aborts the transaction More info…

commit(flags=0)

Ends the transaction, committing any changes to the databases. More info…

id()

The txn_id function returns the unique transaction id associated with the specified transaction. More info…

prepare(gid)

Initiates the beginning of a two-phase commit. A global identifier parameter is required, which is a value unique across all processes involved in the commit. It must be a string of DB_GID_SIZE bytes. More info…

discard()

This method frees up all the per-process resources associated with the specified transaction, neither committing nor aborting the transaction. The transaction will be keep in “unresolved” state. This call may be used only after calls to “dbenv.txn_recover()”. A “unresolved” transaction will be returned again thru new calls to “dbenv.txn_recover()”.

For example, when there are multiple global transaction managers recovering transactions in a single Berkeley DB environment, any transactions returned by “dbenv.txn_recover()” that are not handled by the current global transaction manager should be discarded using “txn.discard()”.

More info…

set_timeout(timeout, flags)

Sets timeout values for locks or transactions for the specified transaction. More info…

get_name(name)

Returns the string associated with the transaction. More info…

set_name(name)

Associates the specified string with the transaction. More info…

bsddb3-6.2.7/docs/html/static/0000775000175000017500000000000013617133045015705 5ustar jceajcea00000000000000bsddb3-6.2.7/docs/html/static/pygments.css0000664000175000017500000001127613617125465020303 0ustar jceajcea00000000000000.highlight .hll { background-color: #ffffcc } .highlight { background: #f8f8f8; } .highlight .c { color: #8f5902; font-style: italic } /* Comment */ .highlight .err { color: #a40000; border: 1px solid #ef2929 } /* Error */ .highlight .g { color: #000000 } /* Generic */ .highlight .k { color: #004461; font-weight: bold } /* Keyword */ .highlight .l { color: #000000 } /* Literal */ .highlight .n { color: #000000 } /* Name */ .highlight .o { color: #582800 } /* Operator */ .highlight .x { color: #000000 } /* Other */ .highlight .p { color: #000000; font-weight: bold } /* Punctuation */ .highlight .ch { color: #8f5902; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #8f5902; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #8f5902 } /* Comment.Preproc */ .highlight .cpf { color: #8f5902; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #8f5902; font-style: italic } /* Comment.Single */ .highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */ .highlight .gd { color: #a40000 } /* Generic.Deleted */ .highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */ .highlight .gr { color: #ef2929 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #745334 } /* Generic.Prompt */ .highlight .gs { color: #000000; font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight .gt { color: #a40000; font-weight: bold } /* Generic.Traceback */ .highlight .kc { color: #004461; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #004461; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #004461; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #004461; font-weight: bold } /* Keyword.Pseudo */ .highlight .kr { color: #004461; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #004461; font-weight: bold } /* Keyword.Type */ .highlight .ld { color: #000000 } /* Literal.Date */ .highlight .m { color: #990000 } /* Literal.Number */ .highlight .s { color: #4e9a06 } /* Literal.String */ .highlight .na { color: #c4a000 } /* Name.Attribute */ .highlight .nb { color: #004461 } /* Name.Builtin */ .highlight .nc { color: #000000 } /* Name.Class */ .highlight .no { color: #000000 } /* Name.Constant */ .highlight .nd { color: #888888 } /* Name.Decorator */ .highlight .ni { color: #ce5c00 } /* Name.Entity */ .highlight .ne { color: #cc0000; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #000000 } /* Name.Function */ .highlight .nl { color: #f57900 } /* Name.Label */ .highlight .nn { color: #000000 } /* Name.Namespace */ .highlight .nx { color: #000000 } /* Name.Other */ .highlight .py { color: #000000 } /* Name.Property */ .highlight .nt { color: #004461; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #000000 } /* Name.Variable */ .highlight .ow { color: #004461; font-weight: bold } /* Operator.Word */ .highlight .w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */ .highlight .mb { color: #990000 } /* Literal.Number.Bin */ .highlight .mf { color: #990000 } /* Literal.Number.Float */ .highlight .mh { color: #990000 } /* Literal.Number.Hex */ .highlight .mi { color: #990000 } /* Literal.Number.Integer */ .highlight .mo { color: #990000 } /* Literal.Number.Oct */ .highlight .sa { color: #4e9a06 } /* Literal.String.Affix */ .highlight .sb { color: #4e9a06 } /* Literal.String.Backtick */ .highlight .sc { color: #4e9a06 } /* Literal.String.Char */ .highlight .dl { color: #4e9a06 } /* Literal.String.Delimiter */ .highlight .sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */ .highlight .s2 { color: #4e9a06 } /* Literal.String.Double */ .highlight .se { color: #4e9a06 } /* Literal.String.Escape */ .highlight .sh { color: #4e9a06 } /* Literal.String.Heredoc */ .highlight .si { color: #4e9a06 } /* Literal.String.Interpol */ .highlight .sx { color: #4e9a06 } /* Literal.String.Other */ .highlight .sr { color: #4e9a06 } /* Literal.String.Regex */ .highlight .s1 { color: #4e9a06 } /* Literal.String.Single */ .highlight .ss { color: #4e9a06 } /* Literal.String.Symbol */ .highlight .bp { color: #3465a4 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #000000 } /* Name.Function.Magic */ .highlight .vc { color: #000000 } /* Name.Variable.Class */ .highlight .vg { color: #000000 } /* Name.Variable.Global */ .highlight .vi { color: #000000 } /* Name.Variable.Instance */ .highlight .vm { color: #000000 } /* Name.Variable.Magic */ .highlight .il { color: #990000 } /* Literal.Number.Integer.Long */bsddb3-6.2.7/docs/html/static/doctools.js0000664000175000017500000002206613600252535020075 0ustar jceajcea00000000000000/* * doctools.js * ~~~~~~~~~~~ * * Sphinx JavaScript utilities for all documentation. * * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * select a different prefix for underscore */ $u = _.noConflict(); /** * make the code below compatible with browsers without * an installed firebug like debugger if (!window.console || !console.firebug) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; } */ /** * small helper function to urldecode strings */ jQuery.urldecode = function(x) { return decodeURIComponent(x).replace(/\+/g, ' '); }; /** * small helper function to urlencode strings */ jQuery.urlencode = encodeURIComponent; /** * This function returns the parsed url parameters of the * current request. Multiple values per key are supported, * it will always return arrays of strings for the value parts. */ jQuery.getQueryParameters = function(s) { if (typeof s === 'undefined') s = document.location.search; var parts = s.substr(s.indexOf('?') + 1).split('&'); var result = {}; for (var i = 0; i < parts.length; i++) { var tmp = parts[i].split('=', 2); var key = jQuery.urldecode(tmp[0]); var value = jQuery.urldecode(tmp[1]); if (key in result) result[key].push(value); else result[key] = [value]; } return result; }; /** * highlight a given string on a jquery object by wrapping it in * span elements with the given class name. */ jQuery.fn.highlightText = function(text, className) { function highlight(node, addItems) { if (node.nodeType === 3) { var val = node.nodeValue; var pos = val.toLowerCase().indexOf(text); if (pos >= 0 && !jQuery(node.parentNode).hasClass(className) && !jQuery(node.parentNode).hasClass("nohighlight")) { var span; var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); if (isInSVG) { span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); } else { span = document.createElement("span"); span.className = className; } span.appendChild(document.createTextNode(val.substr(pos, text.length))); node.parentNode.insertBefore(span, node.parentNode.insertBefore( document.createTextNode(val.substr(pos + text.length)), node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); var bbox = node.parentElement.getBBox(); rect.x.baseVal.value = bbox.x; rect.y.baseVal.value = bbox.y; rect.width.baseVal.value = bbox.width; rect.height.baseVal.value = bbox.height; rect.setAttribute('class', className); addItems.push({ "parent": node.parentNode, "target": rect}); } } } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { highlight(this, addItems); }); } } var addItems = []; var result = this.each(function() { highlight(this, addItems); }); for (var i = 0; i < addItems.length; ++i) { jQuery(addItems[i].parent).before(addItems[i].target); } return result; }; /* * backward compatibility for jQuery.browser * This will be supported until firefox bug is fixed. */ if (!jQuery.browser) { jQuery.uaMatch = function(ua) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || []; return { browser: match[ 1 ] || "", version: match[ 2 ] || "0" }; }; jQuery.browser = {}; jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; } /** * Small JavaScript module for the documentation. */ var Documentation = { init : function() { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); this.initIndexTable(); if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { this.initOnKeyListeners(); } }, /** * i18n support */ TRANSLATIONS : {}, PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; if (typeof translated === 'undefined') return string; return (typeof translated === 'string') ? translated : translated[0]; }, ngettext : function(singular, plural, n) { var translated = Documentation.TRANSLATIONS[singular]; if (typeof translated === 'undefined') return (n == 1) ? singular : plural; return translated[Documentation.PLURALEXPR(n)]; }, addTranslations : function(catalog) { for (var key in catalog.messages) this.TRANSLATIONS[key] = catalog.messages[key]; this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); this.LOCALE = catalog.locale; }, /** * add context elements like header anchor links */ addContextElements : function() { $('div[id] > :header:first').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this headline')). appendTo(this); }); $('dt[id]').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this definition')). appendTo(this); }); }, /** * workaround a firefox stupidity * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 */ fixFirefoxAnchorBug : function() { if (document.location.hash && $.browser.mozilla) window.setTimeout(function() { document.location.href += ''; }, 10); }, /** * highlight the search words provided in the url in the text */ highlightSearchWords : function() { var params = $.getQueryParameters(); var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; if (terms.length) { var body = $('div.body'); if (!body.length) { body = $('body'); } window.setTimeout(function() { $.each(terms, function() { body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); $('') .appendTo($('#searchbox')); } }, /** * init the domain index toggle buttons */ initIndexTable : function() { var togglers = $('img.toggler').click(function() { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); if (src.substr(-9) === 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); }).css('display', ''); if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { togglers.click(); } }, /** * helper function to hide the search marks again */ hideSearchWords : function() { $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, /** * make the url absolute */ makeURL : function(relativeURL) { return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; }, /** * get the current relative url */ getCurrentURL : function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this === '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }, initOnKeyListeners: function() { $(document).keyup(function(event) { var activeElementType = document.activeElement.tagName; // don't navigate when in search box or textarea if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); if (prevHref) { window.location.href = prevHref; return false; } case 39: // right var nextHref = $('link[rel="next"]').prop('href'); if (nextHref) { window.location.href = nextHref; return false; } } } }); } }; // quick alias for translations _ = Documentation.gettext; $(document).ready(function() { Documentation.init(); }); bsddb3-6.2.7/docs/html/static/plus.png0000664000175000017500000000013213600252535017370 0ustar jceajcea00000000000000PNG  IHDR (!IDATxc8 g>@;([[U @l-!a@IENDB`bsddb3-6.2.7/docs/html/static/basic.css0000664000175000017500000002774513617125465017526 0ustar jceajcea00000000000000/* * basic.css * ~~~~~~~~~ * * Sphinx stylesheet -- basic theme. * * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /* -- main layout ----------------------------------------------------------- */ div.clearer { clear: both; } /* -- relbar ---------------------------------------------------------------- */ div.related { width: 100%; font-size: 90%; } div.related h3 { display: none; } div.related ul { margin: 0; padding: 0 0 0 10px; list-style: none; } div.related li { display: inline; } div.related li.right { float: right; margin-right: 5px; } /* -- sidebar --------------------------------------------------------------- */ div.sphinxsidebarwrapper { padding: 10px 5px 0 10px; } div.sphinxsidebar { float: left; width: 230px; margin-left: -100%; font-size: 90%; word-wrap: break-word; overflow-wrap : break-word; } div.sphinxsidebar ul { list-style: none; } div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points { margin-left: 20px; list-style: square; } div.sphinxsidebar ul ul { margin-top: 0; margin-bottom: 0; } div.sphinxsidebar form { margin-top: 10px; } div.sphinxsidebar input { border: 1px solid #98dbcc; font-family: sans-serif; font-size: 1em; } div.sphinxsidebar #searchbox form.search { overflow: hidden; } div.sphinxsidebar #searchbox input[type="text"] { float: left; width: 80%; padding: 0.25em; box-sizing: border-box; } div.sphinxsidebar #searchbox input[type="submit"] { float: left; width: 20%; border-left: none; padding: 0.25em; box-sizing: border-box; } img { border: 0; max-width: 100%; } /* -- search page ----------------------------------------------------------- */ ul.search { margin: 10px 0 0 20px; padding: 0; } ul.search li { padding: 5px 0 5px 20px; background-image: url(file.png); background-repeat: no-repeat; background-position: 0 7px; } ul.search li a { font-weight: bold; } ul.search li div.context { color: #888; margin: 2px 0 0 30px; text-align: left; } ul.keywordmatches li.goodmatch a { font-weight: bold; } /* -- index page ------------------------------------------------------------ */ table.contentstable { width: 90%; margin-left: auto; margin-right: auto; } table.contentstable p.biglink { line-height: 150%; } a.biglink { font-size: 1.3em; } span.linkdescr { font-style: italic; padding-top: 5px; font-size: 90%; } /* -- general index --------------------------------------------------------- */ table.indextable { width: 100%; } table.indextable td { text-align: left; vertical-align: top; } table.indextable ul { margin-top: 0; margin-bottom: 0; list-style-type: none; } table.indextable > tbody > tr > td > ul { padding-left: 0em; } table.indextable tr.pcap { height: 10px; } table.indextable tr.cap { margin-top: 10px; background-color: #f2f2f2; } img.toggler { margin-right: 3px; margin-top: 3px; cursor: pointer; } div.modindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } div.genindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } /* -- domain module index --------------------------------------------------- */ table.modindextable td { padding: 2px; border-collapse: collapse; } /* -- general body styles --------------------------------------------------- */ div.body { min-width: 450px; max-width: 800px; } div.body p, div.body dd, div.body li, div.body blockquote { -moz-hyphens: auto; -ms-hyphens: auto; -webkit-hyphens: auto; hyphens: auto; } a.headerlink { visibility: hidden; } a.brackets:before, span.brackets > a:before{ content: "["; } a.brackets:after, span.brackets > a:after { content: "]"; } h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, dt:hover > a.headerlink, caption:hover > a.headerlink, p.caption:hover > a.headerlink, div.code-block-caption:hover > a.headerlink { visibility: visible; } div.body p.caption { text-align: inherit; } div.body td { text-align: left; } .first { margin-top: 0 !important; } p.rubric { margin-top: 30px; font-weight: bold; } img.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } img.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } img.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } img.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; } .align-left { text-align: left; } .align-center { text-align: center; } .align-default { text-align: center; } .align-right { text-align: right; } /* -- sidebars -------------------------------------------------------------- */ div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px 7px 0 7px; background-color: #ffe; width: 40%; float: right; } p.sidebar-title { font-weight: bold; } /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } p.topic-title { font-size: 1.1em; font-weight: bold; margin-top: 10px; } /* -- admonitions ----------------------------------------------------------- */ div.admonition { margin-top: 10px; margin-bottom: 10px; padding: 7px; } div.admonition dt { font-weight: bold; } div.admonition dl { margin-bottom: 0; } p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; } div.body p.centered { text-align: center; margin-top: 25px; } /* -- tables ---------------------------------------------------------------- */ table.docutils { border: 0; border-collapse: collapse; } table.align-center { margin-left: auto; margin-right: auto; } table.align-default { margin-left: auto; margin-right: auto; } table caption span.caption-number { font-style: italic; } table caption span.caption-text { } table.docutils td, table.docutils th { padding: 1px 8px 1px 5px; border-top: 0; border-left: 0; border-right: 0; border-bottom: 1px solid #aaa; } table.footnote td, table.footnote th { border: 0 !important; } th { text-align: left; padding-right: 5px; } table.citation { border-left: solid 1px gray; margin-left: 1px; } table.citation td { border-bottom: none; } th > p:first-child, td > p:first-child { margin-top: 0px; } th > p:last-child, td > p:last-child { margin-bottom: 0px; } /* -- figures --------------------------------------------------------------- */ div.figure { margin: 0.5em; padding: 0.5em; } div.figure p.caption { padding: 0.3em; } div.figure p.caption span.caption-number { font-style: italic; } div.figure p.caption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ table.field-list td, table.field-list th { border: 0 !important; } .field-list ul { margin: 0; padding-left: 1em; } .field-list p { margin: 0; } .field-name { -moz-hyphens: manual; -ms-hyphens: manual; -webkit-hyphens: manual; hyphens: manual; } /* -- hlist styles ---------------------------------------------------------- */ table.hlist td { vertical-align: top; } /* -- other body styles ----------------------------------------------------- */ ol.arabic { list-style: decimal; } ol.loweralpha { list-style: lower-alpha; } ol.upperalpha { list-style: upper-alpha; } ol.lowerroman { list-style: lower-roman; } ol.upperroman { list-style: upper-roman; } li > p:first-child { margin-top: 0px; } li > p:last-child { margin-bottom: 0px; } dl.footnote > dt, dl.citation > dt { float: left; } dl.footnote > dd, dl.citation > dd { margin-bottom: 0em; } dl.footnote > dd:after, dl.citation > dd:after { content: ""; clear: both; } dl.field-list { display: grid; grid-template-columns: fit-content(30%) auto; } dl.field-list > dt { font-weight: bold; word-break: break-word; padding-left: 0.5em; padding-right: 5px; } dl.field-list > dt:after { content: ":"; } dl.field-list > dd { padding-left: 0.5em; margin-top: 0em; margin-left: 0em; margin-bottom: 0em; } dl { margin-bottom: 15px; } dd > p:first-child { margin-top: 0px; } dd ul, dd table { margin-bottom: 10px; } dd { margin-top: 3px; margin-bottom: 10px; margin-left: 30px; } dt:target, span.highlighted { background-color: #fbe54e; } rect.highlighted { fill: #fbe54e; } dl.glossary dt { font-weight: bold; font-size: 1.1em; } .optional { font-size: 1.3em; } .sig-paren { font-size: larger; } .versionmodified { font-style: italic; } .system-message { background-color: #fda; padding: 5px; border: 3px solid red; } .footnote:target { background-color: #ffa; } .line-block { display: block; margin-top: 1em; margin-bottom: 1em; } .line-block .line-block { margin-top: 0; margin-bottom: 0; margin-left: 1.5em; } .guilabel, .menuselection { font-family: sans-serif; } .accelerator { text-decoration: underline; } .classifier { font-style: oblique; } .classifier:before { font-style: normal; margin: 0.5em; content: ":"; } abbr, acronym { border-bottom: dotted 1px; cursor: help; } /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; overflow-y: hidden; /* fixes display issues on Chrome browsers */ } span.pre { -moz-hyphens: none; -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; } td.linenos pre { padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { margin-left: 0.5em; } table.highlighttable td { padding: 0 0.5em 0 0.5em; } div.code-block-caption { padding: 2px 5px; font-size: small; } div.code-block-caption code { background-color: transparent; } div.code-block-caption + div > div.highlight > pre { margin-top: 0; } div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ user-select: none; } div.code-block-caption span.caption-number { padding: 0.1em 0.3em; font-style: italic; } div.code-block-caption span.caption-text { } div.literal-block-wrapper { padding: 1em 1em 0; } div.literal-block-wrapper div.highlight { margin: 0; } code.descname { background-color: transparent; font-weight: bold; font-size: 1.2em; } code.descclassname { background-color: transparent; } code.xref, a code { background-color: transparent; font-weight: bold; } h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { background-color: transparent; } .viewcode-link { float: right; } .viewcode-back { float: right; font-family: sans-serif; } div.viewcode-block:target { margin: -1px -10px; padding: 0 10px; } /* -- math display ---------------------------------------------------------- */ img.math { vertical-align: middle; } div.body div.math p { text-align: center; } span.eqno { float: right; } span.eqno a.headerlink { position: relative; left: 0px; z-index: 1; } div.math:hover a.headerlink { visibility: visible; } /* -- printout stylesheet --------------------------------------------------- */ @media print { div.document, div.documentwrapper, div.bodywrapper { margin: 0 !important; width: 100%; } div.sphinxsidebar, div.related, div.footer, #top-link { display: none; } }bsddb3-6.2.7/docs/html/static/custom.css0000664000175000017500000000005213553344306017731 0ustar jceajcea00000000000000/* This file intentionally left blank. */ bsddb3-6.2.7/docs/html/static/minus.png0000664000175000017500000000013213600252535017540 0ustar jceajcea00000000000000PNG  IHDR (!IDATxc8 g>@;(!&]f2nNIENDB`bsddb3-6.2.7/docs/html/static/language_data.js0000664000175000017500000002513713617125465021036 0ustar jceajcea00000000000000/* * language_data.js * ~~~~~~~~~~~~~~~~ * * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; /* Non-minified version JS is _stemmer.js if file is provided */ /** * Porter Stemmer */ var Stemmer = function() { var step2list = { ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log' }; var step3list = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' }; var c = "[^aeiou]"; // consonant var v = "[aeiouy]"; // vowel var C = c + "[^aeiouy]*"; // consonant sequence var V = v + "[aeiou]*"; // vowel sequence var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; var suffix; var firstch; var origword = w; if (w.length < 3) return w; var re; var re2; var re3; var re4; firstch = w.substr(0,1); if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) w = w.replace(re,"$1$2"); else if (re2.test(w)) w = w.replace(re2,"$1$2"); // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) w = w + "e"; } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) w = stem + "i"; } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) w = stem; } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) w = stem; } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; } } var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; var i, j, start, end; for (i = 0; i < singles.length; i++) { result[singles[i]] = true; } var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; for (i = 0; i < ranges.length; i++) { start = ranges[i][0]; end = ranges[i][1]; for (j = start; j <= end; j++) { result[j] = true; } } return result; })(); function splitQuery(query) { var result = []; var start = -1; for (var i = 0; i < query.length; i++) { if (splitChars[query.charCodeAt(i)]) { if (start !== -1) { result.push(query.slice(start, i)); start = -1; } } else if (start === -1) { start = i; } } if (start !== -1) { result.push(query.slice(start)); } return result; } bsddb3-6.2.7/docs/html/static/searchtools.js0000664000175000017500000003723513600252535020601 0ustar jceajcea00000000000000/* * searchtools.js * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilities for the full-text search. * * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ if (!Scorer) { /** * Simple result scoring code. */ var Scorer = { // Implement the following function to further tweak the score for each result // The function takes a result array [filename, title, anchor, descr, score] // and returns the new score. /* score: function(result) { return result[4]; }, */ // query matches the full name of an object objNameMatch: 11, // or matches in the last dotted part of the object name objPartialMatch: 6, // Additive scores depending on the priority of the object objPrio: {0: 15, // used to be importantResults 1: 5, // used to be objectResults 2: -5}, // used to be unimportantResults // Used when the priority is not in the mapping. objPrioDefault: 0, // query found in title title: 15, partialTitle: 7, // query found in terms term: 5, partialTerm: 2 }; } if (!splitQuery) { function splitQuery(query) { return query.split(/\s+/); } } /** * Search Module */ var Search = { _index : null, _queued_query : null, _pulse_status : -1, htmlToText : function(htmlString) { var htmlElement = document.createElement('span'); htmlElement.innerHTML = htmlString; $(htmlElement).find('.headerlink').remove(); docContent = $(htmlElement).find('[role=main]')[0]; return docContent.textContent || docContent.innerText; }, init : function() { var params = $.getQueryParameters(); if (params.q) { var query = params.q[0]; $('input[name="q"]')[0].value = query; this.performSearch(query); } }, loadIndex : function(url) { $.ajax({type: "GET", url: url, data: null, dataType: "script", cache: true, complete: function(jqxhr, textstatus) { if (textstatus != "success") { document.getElementById("searchindexloader").src = url; } }}); }, setIndex : function(index) { var q; this._index = index; if ((q = this._queued_query) !== null) { this._queued_query = null; Search.query(q); } }, hasIndex : function() { return this._index !== null; }, deferQuery : function(query) { this._queued_query = query; }, stopPulse : function() { this._pulse_status = 0; }, startPulse : function() { if (this._pulse_status >= 0) return; function pulse() { var i; Search._pulse_status = (Search._pulse_status + 1) % 4; var dotString = ''; for (i = 0; i < Search._pulse_status; i++) dotString += '.'; Search.dots.text(dotString); if (Search._pulse_status > -1) window.setTimeout(pulse, 500); } pulse(); }, /** * perform a search for something (or wait until index is loaded) */ performSearch : function(query) { // create the required interface elements this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); this.status = $('

 

').appendTo(this.out); this.output = $('