head 1.2;
access;
symbols
RPM_4_2_1:1.1.1.4
RPM_4_2:1.1.1.4
RPM_4_1_1:1.1.1.4
RPM_4_1:1.1.1.3
RPM_4_0_5:1.1.1.2
RPM_4_0_4:1.1.1.1
RPM_4_0_3:1.1.1.1
RPM:1.1.1;
locks; strict;
comment @# @;
1.2
date 2008.01.02.09.58.54; author rse; state dead;
branches;
next 1.1;
commitid z4cpSiAhOCXk5PLs;
1.1
date 2001.05.13.19.58.32; author rse; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2001.05.13.19.58.32; author rse; state Exp;
branches;
next 1.1.1.2;
1.1.1.2
date 2003.01.18.13.49.10; author rse; state Exp;
branches;
next 1.1.1.3;
1.1.1.3
date 2001.05.13.19.58.32; author rse; state Exp;
branches;
next 1.1.1.4;
1.1.1.4
date 2003.01.18.14.05.14; author rse; state Exp;
branches;
next ;
desc
@@
1.2
log
@remove the ancient RPM 4.2.1 source tree copy
@
text
@
Database Commands
The database commands provide a conduit into the DB method functions.
They are all fairly straightforward and I describe them in terms of their
DB functions briefly here, with a link to the DB page where appropriate.
The first set of commands are those I believe will be the primary functions
used by most databases. Some are directly related to their DB counterparts,
and some are higher level functions that are useful to provide the user.
> berkdb open [-env env]
[-btree|-hash|-recno|-queue|-unknown]
[-create] [-excl] [-nommap] [-rdonly] [-truncate]
[-mode
mode] [-errfile filename]
[-dup] [-dupsort] [-recnum] [-renumber] [-revsplitoff]
[-snapshot]
[-btcompare proc] [-dupcompare proc]
[-hashproc proc]
[-extent size]
[-ffactor density]
[-nelem size]
[-lorder order]
[-delim delim]
[-len len]
[-pad pad]
[-source file]
[-minkey minkey]
[-cachesize {gbytes bytes ncaches}]
[-pagesize pagesize]
[--]
[filename [subdbname]]
This command will invoke the db_create
function. If the command is given the -env option, then we
will accordingly creating the database within the context of that environment.
After it successfully gets a handle to a database, we bind it to a new
Tcl command of the form dbX, where X is an integer starting
at 0 (e.g. db0, db1, etc). We use the Tcl_CreateObjCommand()
to create the top level database function. It is through this handle
that the user can access all of the commands described in the Database
Commands section. Internally, the database handle is sent as
the ClientData portion of the new command set so that all future
database calls access the appropriate handle.
After parsing all of the optional arguments affecting the setup of the
database and making the appropriate calls to DB to manipulate those values,
we open the database for the user. It translates to the
DB->open
method call after parsing all of the various optional arguments.
We automatically set the DB_THREAD flag. The arguments are:
-
-- - Terminate the list of options and use remaining arguments as
the file or subdb names (thus allowing the use of filenames beginning with
a dash '-')
-
-btree - DB_BTREE database
-
-hash - DB_HASH database
-
-recno - DB_RECNO database
-
-queue - DB_QUEUE database
-
-create selects the DB_CREATE flag to create underlying files
-
-excl selects the DB_EXCL flag to exclusively create underlying
files
-
-nommap selects the DB_NOMMAP flag to forbid mmaping of files
-
-rdonly selects the DB_RDONLY flag for opening in read-only mode
-
-truncate selects the DB_TRUNCATE flag to truncate the database
-
-mode mode specifies the mode for created files
-
-errfile specifies the error file to use for this environment to
filename
by calling DB->set_errfile.
If
the file already exists then we will append to the end of the file
-
-dup selects the DB_DUP flag to permit duplicates in the database
-
-dupsort selects the DB_DUPSORT flag to support sorted duplicates
-
-recnum selects the DB_RECNUM flag to support record numbers in
btrees
-
-renumber selects the DB_RENUMBER flag to support mutable record
numbers
-
-revsplitoff selects the DB_REVSPLITOFF flag to suppress reverse
splitting of pages on deletion
-
-snapshot selects the DB_SNAPSHOT flag to support database snapshots
-
-btcompare sets the Btree comparison function to the Tcl procedure
named proc using the DB->set_bt_compare
method.
-
-dupcompare sets the duplicate data comparison function to the Tcl
procedure named proc using the DB->set_dup_compare
method.
-
-hashproc sets a user-defined hash function to the Tcl procedure
named proc using the DB->set_h_hash
method.
-
-extent sets the size of a Queue database extent to the given size
using
the DB->set_q_extentsize
method
-
-ffactor sets the hash table key density to the given density
using
the DB->set_h_ffactor
method
-
-nelem sets the hash table size estimate to the given size
using
the DB->set_h_nelem
method
-
-lorder sets the byte order for integers stored in the database
meta-data to the given order using the DB->set_lorder
method
-
-delim sets the delimiting byte for variable length records to
delim
using the DB->set_re_delim
method
-
-len sets the length of fixed-length records to len
using the DB->set_re_len
method
-
-pad sets the pad character used for fixed length records to
pad
using the DB->set_re_pad method
-
-source sets the backing source file name to file
using the DB->set_re_source
method
-
-minkey sets the minimum number of keys per Btree page to minkey
using the DB->set_bt_minkey
method
-
-cachesize sets the size of the database cache to the size
specified by gbytes and bytes, broken up into
ncaches
number of caches using the DB->set_cachesize
method
-
-pagesize sets the size of the database page to pagesize using
the DB->set_pagesize
method
-
filename indicates the name of the database
-
subdbname indicate the name of the sub-database
berkdb upgrade [-dupsort] [-env env] [--] [filename]
This command will invoke the DB->upgrade
function. If the command is given the -env option, then we
will accordingly upgrade the database filename within the context of that
environment. The -dupsort option selects the DB_DUPSORT flag for
upgrading. The use of -- terminates the list of options, thus allowing
filenames beginning with a dash.
> berkdb verify [-env env] [--] [filename]
This command will invoke the DB->verify
function. If the command is given the -env option, then we
will accordingly verify the database filename within the context of that
environment. The use of -- terminates the list of options,
thus allowing filenames beginning with a dash.
> db join [-nosort] db0.c0 db1.c0 ...
This command will invoke the db_join
function. After it successfully joins a database, we bind it to a
new Tcl command of the form dbN.cX, where X is an integer
starting at 0 (e.g. db2.c0, db3.c0, etc). We use the Tcl_CreateObjCommand()
to create the top level database function. It is through this cursor
handle that the user can access the joined data items.
The options are:
-
-nosort - This flag causes DB not to sort the cursors based on the
number of data items they reference. It results in the DB_JOIN_NOSORT
flag being set.
> db get_join [-nosort] {db key} {db key} ...
This command performs a join operation on the keys specified and returns
a list of the joined {key data} pairs.
The options are:
-
-nosort This flag causes DB not to sort the cursors based on the
number of data items they reference. It results in the DB_JOIN_NOSORT
flag being set.
> db keyrange [-txn id] key
This command returns the range for the given key. It returns
a list of 3 double elements of the form {less equal greater}
where less is the percentage of keys less than the given
key, equal is the percentage equal to the given key and greater
is the percentage greater than the given key. If the -txn option
is specified it performs this operation under transaction protection.
> db put
The undocumented options are:
-
-nodupdata This flag causes DB not to insert the key/data pair if
it already exists, that is, both the key and data items are already in
the database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
> dbc put
The undocumented options are:
-
-nodupdata This flag causes DB not to insert the key/data pair if
it already exists, that is, both the key and data items are already in
the database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
@
1.1
log
@Initial revision
@
text
@@
1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@
1.1.1.2
log
@Import: RPM 4.0.5
@
text
@d1 1
a1 2
d11 102
a112 2
The database commands provide a fairly straightforward mapping to the
DB method functions.
d114 85
a198 3
> berkdb open
d200 3
a202 138
- [-btcompare proc]
-
Sets the Btree comparison function to the Tcl procedure named
proc using the
DB->set_bt_compare
method.
- [-btree|-hash|-recno|-queue|-unknown]
-
Select the database type:
DB_BTREE, DB_HASH, DB_RECNO, DB_QUEUE or DB_UNKNOWN.
- [-cachesize {gbytes bytes ncaches}]
-
Sets the size of the database cache to the size specified by
gbytes and bytes, broken up into ncaches number of
caches using the
DB->set_cachesize
method.
- [-create]
-
Selects the DB_CREATE flag to create underlying files.
- [-delim delim]
-
Sets the delimiting byte for variable length records to delim
using the
DB->set_re_delim
method.
- [-dup]
-
Selects the DB_DUP flag to permit duplicates in the database.
- [-dupcompare proc]
-
Sets the duplicate data comparison function to the Tcl procedure named
proc using the
DB->set_dup_compare
method.
- [-dupsort]
-
Selects the DB_DUPSORT flag to support sorted duplicates.
- [-env env]
-
The database environment.
- [-errfile filename]
-
Specifies the error file to use for this environment to filename
by calling
DB->set_errfile.
If the file already exists then we will append to the end of the file.
- [-excl]
-
Selects the DB_EXCL flag to exclusively create underlying files.
- [-extent size]
-
Sets the size of a Queue database extent to the given size using
the
DB->set_q_extentsize
method.
- [-ffactor density]
-
Sets the hash table key density to the given density using the
DB->set_h_ffactor
method.
- [-hashproc proc]
-
Sets a user-defined hash function to the Tcl procedure named proc
using the
DB->set_h_hash method.
- [-len len]
-
Sets the length of fixed-length records to len using the
DB->set_re_len
method.
- [-lorder order]
-
Sets the byte order for integers stored in the database meta-data to
the given order using the
DB->set_lorder
method.
- [-minkey minkey]
-
Sets the minimum number of keys per Btree page to minkey using
the
DB->set_bt_minkey
method.
- [-mode mode]
-
Specifies the mode for created files.
- [-nelem size]
-
Sets the hash table size estimate to the given size using the
DB->set_h_nelem
method.
- [-nommap]
-
Selects the DB_NOMMAP flag to forbid mmaping of files.
- [-pad pad]
-
Sets the pad character used for fixed length records to pad using
the
DB->set_re_pad method.
- [-pagesize pagesize]
-
Sets the size of the database page to pagesize using the
DB->set_pagesize
method.
- [-rdonly]
-
Selects the DB_RDONLY flag for opening in read-only mode.
- [-recnum]
-
Selects the DB_RECNUM flag to support record numbers in Btrees.
- [-renumber]
-
Selects the DB_RENUMBER flag to support mutable record numbers.
- [-revsplitoff]
-
Selects the DB_REVSPLITOFF flag to suppress reverse splitting of pages
on deletion.
- [-snapshot]
-
Selects the DB_SNAPSHOT flag to support database snapshots.
- [-source file]
-
Sets the backing source file name to file using the
DB->set_re_source
method.
- [-truncate]
-
Selects the DB_TRUNCATE flag to truncate the database.
- [--]
-
Terminate the list of options and use remaining arguments as the file
or subdb names (thus allowing the use of filenames beginning with a dash
'-').
- [filename [subdbname]]
-
The names of the database and sub-database.
d205 1
a205 1
> berkdb upgrade [-dupsort] [-env env] [--] [filename]
d213 1
a213 3
> berkdb verify [-env env] [--] [filename]
d220 1
a220 6
> db del
There are no undocumented options.
> db join [-nosort] db0.c0 db1.c0 ...
d235 1
a235 27
This command will invoke the
db_create function. If
the command is given the -env option, then we will accordingly
creating the database within the context of that environment. After it
successfully gets a handle to a database, we bind it to a new Tcl
command of the form dbX, where X is an integer starting
at 0 (e.g. db0, db1, etc).
We use the Tcl_CreateObjCommand() to create the top level
database function. It is through this handle that the user can access
all of the commands described in the
Database Commands section. Internally, the database handle
is sent as the ClientData portion of the new command set so that
all future database calls access the appropriate handle.
After parsing all of the optional arguments affecting the setup of the
database and making the appropriate calls to DB to manipulate those
values, we open the database for the user. It translates to the
DB->open method call after
parsing all of the various optional arguments. We automatically set the
DB_THREAD flag. The arguments are:
> db get_join [-nosort] {db key} {db key} ...
d246 1
a246 2
> db keyrange [-txn id] key
d253 1
a253 1
d256 7
a262 7
- -nodupdata
-
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
d266 7
a272 7
- -nodupdata
-
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
@
1.1.1.3
log
@Import: RPM 4.1
@
text
@d1 2
a2 1
d12 2
a13 50
The database commands provide a conduit into the DB method functions.
They are all fairly straightforward and I describe them in terms of their
DB functions briefly here, with a link to the DB page where appropriate.
The first set of commands are those I believe will be the primary functions
used by most databases. Some are directly related to their DB counterparts,
and some are higher level functions that are useful to provide the user.
> berkdb open [-env env]
[-btree|-hash|-recno|-queue|-unknown]
[-create] [-excl] [-nommap] [-rdonly] [-truncate]
[-mode
mode] [-errfile filename]
[-dup] [-dupsort] [-recnum] [-renumber] [-revsplitoff]
[-snapshot]
[-btcompare proc] [-dupcompare proc]
[-hashproc proc]
[-extent size]
[-ffactor density]
[-nelem size]
[-lorder order]
[-delim delim]
[-len len]
[-pad pad]
[-source file]
[-minkey minkey]
[-cachesize {gbytes bytes ncaches}]
[-pagesize pagesize]
[--]
[filename [subdbname]]
This command will invoke the db_create
function. If the command is given the -env option, then we
will accordingly creating the database within the context of that environment.
After it successfully gets a handle to a database, we bind it to a new
Tcl command of the form dbX, where X is an integer starting
at 0 (e.g. db0, db1, etc). We use the Tcl_CreateObjCommand()
to create the top level database function. It is through this handle
that the user can access all of the commands described in the Database
Commands section. Internally, the database handle is sent as
the ClientData portion of the new command set so that all future
database calls access the appropriate handle.
After parsing all of the optional arguments affecting the setup of the
database and making the appropriate calls to DB to manipulate those values,
we open the database for the user. It translates to the
DB->open
method call after parsing all of the various optional arguments.
We automatically set the DB_THREAD flag. The arguments are:
-
-- - Terminate the list of options and use remaining arguments as
the file or subdb names (thus allowing the use of filenames beginning with
a dash '-')
d15 3
a17 51
-
-btree - DB_BTREE database
-
-hash - DB_HASH database
-
-recno - DB_RECNO database
-
-queue - DB_QUEUE database
-
-create selects the DB_CREATE flag to create underlying files
-
-excl selects the DB_EXCL flag to exclusively create underlying
files
-
-nommap selects the DB_NOMMAP flag to forbid mmaping of files
-
-rdonly selects the DB_RDONLY flag for opening in read-only mode
-
-truncate selects the DB_TRUNCATE flag to truncate the database
-
-mode mode specifies the mode for created files
-
-errfile specifies the error file to use for this environment to
filename
by calling DB->set_errfile.
If
the file already exists then we will append to the end of the file
-
-dup selects the DB_DUP flag to permit duplicates in the database
-
-dupsort selects the DB_DUPSORT flag to support sorted duplicates
-
-recnum selects the DB_RECNUM flag to support record numbers in
btrees
-
-renumber selects the DB_RENUMBER flag to support mutable record
numbers
d19 138
a156 89
-
-revsplitoff selects the DB_REVSPLITOFF flag to suppress reverse
splitting of pages on deletion
-
-snapshot selects the DB_SNAPSHOT flag to support database snapshots
-
-btcompare sets the Btree comparison function to the Tcl procedure
named proc using the DB->set_bt_compare
method.
-
-dupcompare sets the duplicate data comparison function to the Tcl
procedure named proc using the DB->set_dup_compare
method.
-
-hashproc sets a user-defined hash function to the Tcl procedure
named proc using the DB->set_h_hash
method.
-
-extent sets the size of a Queue database extent to the given size
using
the DB->set_q_extentsize
method
-
-ffactor sets the hash table key density to the given density
using
the DB->set_h_ffactor
method
-
-nelem sets the hash table size estimate to the given size
using
the DB->set_h_nelem
method
-
-lorder sets the byte order for integers stored in the database
meta-data to the given order using the DB->set_lorder
method
-
-delim sets the delimiting byte for variable length records to
delim
using the DB->set_re_delim
method
-
-len sets the length of fixed-length records to len
using the DB->set_re_len
method
-
-pad sets the pad character used for fixed length records to
pad
using the DB->set_re_pad method
-
-source sets the backing source file name to file
using the DB->set_re_source
method
-
-minkey sets the minimum number of keys per Btree page to minkey
using the DB->set_bt_minkey
method
-
-cachesize sets the size of the database cache to the size
specified by gbytes and bytes, broken up into
ncaches
number of caches using the DB->set_cachesize
method
-
-pagesize sets the size of the database page to pagesize using
the DB->set_pagesize
method
-
filename indicates the name of the database
-
subdbname indicate the name of the sub-database
d159 1
a159 1
berkdb upgrade [-dupsort] [-env env] [--] [filename]
d167 3
a169 1
> berkdb verify [-env env] [--] [filename]
d176 6
a181 1
> db join [-nosort] db0.c0 db1.c0 ...
d196 27
a222 1
> db get_join [-nosort] {db key} {db key} ...
d233 2
a234 1
> db keyrange [-txn id] key
d241 1
a241 1
d244 7
a250 7
-
-nodupdata This flag causes DB not to insert the key/data pair if
it already exists, that is, both the key and data items are already in
the database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
d254 7
a260 7
-
-nodupdata This flag causes DB not to insert the key/data pair if
it already exists, that is, both the key and data items are already in
the database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
@
1.1.1.4
log
@Import: RPM 4.1.1
@
text
@d1 1
a1 2
d11 102
a112 2
The database commands provide a fairly straightforward mapping to the
DB method functions.
d114 85
a198 3
> berkdb open
d200 3
a202 138
- [-btcompare proc]
-
Sets the Btree comparison function to the Tcl procedure named
proc using the
DB->set_bt_compare
method.
- [-btree|-hash|-recno|-queue|-unknown]
-
|
Select the database type:
DB_BTREE, DB_HASH, DB_RECNO, DB_QUEUE or DB_UNKNOWN.
- [-cachesize {gbytes bytes ncaches}]
-
Sets the size of the database cache to the size specified by
gbytes and bytes, broken up into ncaches number of
caches using the
DB->set_cachesize
method.
- [-create]
-
Selects the DB_CREATE flag to create underlying files.
- [-delim delim]
-
Sets the delimiting byte for variable length records to delim
using the
DB->set_re_delim
method.
- [-dup]
-
Selects the DB_DUP flag to permit duplicates in the database.
- [-dupcompare proc]
-
Sets the duplicate data comparison function to the Tcl procedure named
proc using the
DB->set_dup_compare
method.
- [-dupsort]
-
Selects the DB_DUPSORT flag to support sorted duplicates.
- [-env env]
-
The database environment.
- [-errfile filename]
-
Specifies the error file to use for this environment to filename
by calling
DB->set_errfile.
If the file already exists then we will append to the end of the file.
- [-excl]
-
Selects the DB_EXCL flag to exclusively create underlying files.
- [-extent size]
-
Sets the size of a Queue database extent to the given size using
the
DB->set_q_extentsize
method.
- [-ffactor density]
-
Sets the hash table key density to the given density using the
DB->set_h_ffactor
method.
- [-hashproc proc]
-
Sets a user-defined hash function to the Tcl procedure named proc
using the
DB->set_h_hash method.
- [-len len]
-
Sets the length of fixed-length records to len using the
DB->set_re_len
method.
- [-lorder order]
-
Sets the byte order for integers stored in the database meta-data to
the given order using the
DB->set_lorder
method.
- [-minkey minkey]
-
Sets the minimum number of keys per Btree page to minkey using
the
DB->set_bt_minkey
method.
- [-mode mode]
-
Specifies the mode for created files.
- [-nelem size]
-
Sets the hash table size estimate to the given size using the
DB->set_h_nelem
method.
- [-nommap]
-
Selects the DB_NOMMAP flag to forbid mmaping of files.
- [-pad pad]
-
Sets the pad character used for fixed length records to pad using
the
DB->set_re_pad method.
- [-pagesize pagesize]
-
Sets the size of the database page to pagesize using the
DB->set_pagesize
method.
- [-rdonly]
-
Selects the DB_RDONLY flag for opening in read-only mode.
- [-recnum]
-
Selects the DB_RECNUM flag to support record numbers in Btrees.
- [-renumber]
-
Selects the DB_RENUMBER flag to support mutable record numbers.
- [-revsplitoff]
-
Selects the DB_REVSPLITOFF flag to suppress reverse splitting of pages
on deletion.
- [-snapshot]
-
Selects the DB_SNAPSHOT flag to support database snapshots.
- [-source file]
-
Sets the backing source file name to file using the
DB->set_re_source
method.
- [-truncate]
-
Selects the DB_TRUNCATE flag to truncate the database.
- [--]
-
Terminate the list of options and use remaining arguments as the file
or subdb names (thus allowing the use of filenames beginning with a dash
'-').
- [filename [subdbname]]
-
The names of the database and sub-database.
d205 1
a205 1
> berkdb upgrade [-dupsort] [-env env] [--] [filename]
d213 1
a213 3
> berkdb verify [-env env] [--] [filename]
d220 1
a220 6
> db del
There are no undocumented options.
> db join [-nosort] db0.c0 db1.c0 ...
d235 1
a235 27
This command will invoke the
db_create function. If
the command is given the -env option, then we will accordingly
creating the database within the context of that environment. After it
successfully gets a handle to a database, we bind it to a new Tcl
command of the form dbX, where X is an integer starting
at 0 (e.g. db0, db1, etc).
We use the Tcl_CreateObjCommand() to create the top level
database function. It is through this handle that the user can access
all of the commands described in the
Database Commands section. Internally, the database handle
is sent as the ClientData portion of the new command set so that
all future database calls access the appropriate handle.
After parsing all of the optional arguments affecting the setup of the
database and making the appropriate calls to DB to manipulate those
values, we open the database for the user. It translates to the
DB->open method call after
parsing all of the various optional arguments. We automatically set the
DB_THREAD flag. The arguments are:
> db get_join [-nosort] {db key} {db key} ...
d246 1
a246 2
> db keyrange [-txn id] key
d253 1
a253 1
d256 7
a262 7
- -nodupdata
-
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
d266 7
a272 7
- -nodupdata
-
This flag causes DB not to insert the key/data pair if it already
exists, that is, both the key and data items are already in the
database. The -nodupdata flag may only be specified if the underlying
database has been configured to support sorted duplicates.
@
|