xref: /freebsd/contrib/netbsd-tests/lib/libc/db/README (revision d3d381b2b194b4d24853e92eecef55f262688d1a)
1#	$NetBSD: README,v 1.1 2011/01/07 15:05:58 pgoyette Exp $
2#	@(#)README	8.8 (Berkeley) 7/31/94
3
4Fairly large files (the command files) are built in this directory during
5the test runs, and even larger files (the database files) are created in
6"/var/tmp".  If the latter directory doesn't exist, set the environmental
7variable TMPDIR to a directory where the files can be built.
8
9=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
10The script file consists of lines with an initial character which is
11the command for that line, or an initial character indicating a key
12or data entry for a previous command.
13
14Legal command characters are as follows:
15
16c: compare a record
17	+ must be followed by [kK][dD]; the data value in the database
18	  associated with the specified key is compared to the specified
19	  data value.
20e: echo a string
21	+ writes out the rest of the line into the output file; if the
22	  last character is not a carriage-return, a newline is appended.
23f: set the flags for the next command
24	+ no value zero's the flags
25g: do a get command
26	+ must be followed by [kK]
27	+ writes out the retrieved data DBT.
28o [r]: dump [reverse]
29	+ dump the database out, if 'r' is set, in reverse order.
30p: do a put command
31	+ must be followed by [kK][dD]
32r: do a del command
33	+ must be followed by [kK] unless R_CURSOR flag set.
34S: sync the database
35s: do a seq command
36	+ must be followed by [kK] if R_CURSOR flag set.
37	+ writes out the retrieved data DBT.
38
39Legal key/data characters are as follows:
40
41D [file]: data file
42	+ set the current data value to the contents of the file
43d [data]:
44	+ set the current key value to the contents of the line.
45K [file]: key file
46	+ set the current key value to the contents of the file
47k [data]:
48	+ set the current key value to the contents of the line.
49
50Blank lines, lines with leading white space, and lines with leading
51hash marks (#) are ignored.
52
53Options to dbtest are as follows:
54
55	-d: Set the DB_LOCK flag.
56	-f: Use the file argument as the database file.
57	-i: Use the rest of the argument to set elements in the info
58	    structure.  If the type is btree, then "-i cachesize=10240"
59	    will set BTREEINFO.cachesize to 10240.
60	-o: The rest of the argument is the output file instead of
61	    using stdout.
62	-s: Don't delete the database file before opening it, i.e.
63	    use the database file from a previous run.
64
65Dbtest requires two arguments, the type of access "hash", "recno"
66or "btree", and the script name or "-" to indicate stdin.
67