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