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