The e32dbm defines the following functions:
dbname[,flags, mode]) |
'r'
: opens an existing database in read-only mode. This is the default value.
'w'
: opens an existing database in read-write mode.
'c'
: opens a database in read-write mode. Creates a new database if the database does not exist.
'n'
: creates a new empty database and opens it in read-write mode.
If the character 'f'
is appended to flags, the database is opened in fast mode. In
fast mode, updates are written to the database only when one of these
methods is called: sync, close, reorganize, or
clear.
Since the connection object destructor calls close, it is not strictly necessary to close the database before exiting to ensure that data is saved, but it is still good practice to call the close method when you are done with using the database. Closing the database releases the lock on the file and allows the file to be reopened or deleted without exiting the interpreter.
If you plan to do several updates, it is highly recommended that you open the database in fast mode, since inserts and updates are more efficient when they are bundled together in a larger transaction. This is especially important when you plan to insert large amounts of data, since inserting records to e32db is very slow if done one record at a time.
See About this document... for information on suggesting changes.