xref: /freebsd/lib/libc/db/test/README (revision 58f0484fa251c266ede97b591b499fe3dd4f578e)
158f0484fSRodney W. Grimes#	@(#)README	8.2 (Berkeley) 2/21/94
258f0484fSRodney W. Grimes
358f0484fSRodney W. GrimesTo build this portably, try something like:
458f0484fSRodney W. Grimes
558f0484fSRodney W. Grimes    make INC="-I../PORT/MACH/ -I../PORT/MACH/include" LIB=../PORT/MACH/libdb.a
658f0484fSRodney W. Grimes
758f0484fSRodney W. Grimeswhere MACH is the machine, i.e. "sunos.4.1.1".
858f0484fSRodney W. Grimes
958f0484fSRodney W. GrimesTo run the tests, enter "sh run.test".  If your system dictionary isn't
1058f0484fSRodney W. Grimesin /usr/share/dict/words, edit run.test to reflect the correct place.
1158f0484fSRodney W. Grimes
1258f0484fSRodney W. Grimes=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1358f0484fSRodney W. GrimesThe script file consists of lines with a initial character which is
1458f0484fSRodney W. Grimesthe "command" for that line.  Legal characters are as follows:
1558f0484fSRodney W. Grimes
1658f0484fSRodney W. Grimesc: compare a record
1758f0484fSRodney W. Grimes	+ must be followed by [kK][dD]; the data value in the database
1858f0484fSRodney W. Grimes	  associated with the specified key is compared to the specified
1958f0484fSRodney W. Grimes	  data value.
2058f0484fSRodney W. Grimese: echo a string
2158f0484fSRodney W. Grimes	+ writes out the rest of the line into the output file; if the
2258f0484fSRodney W. Grimes	  last character is not a carriage-return, a newline is appended.
2358f0484fSRodney W. Grimesg: do a get command
2458f0484fSRodney W. Grimes	+ must be followed by [kK]
2558f0484fSRodney W. Grimes	+ writes out the retrieved data DBT.
2658f0484fSRodney W. Grimesp: do a put command
2758f0484fSRodney W. Grimes	+ must be followed by [kK][dD]
2858f0484fSRodney W. Grimesr: do a del command
2958f0484fSRodney W. Grimes	+ must be followed by [kK]
3058f0484fSRodney W. Grimess: do a seq command
3158f0484fSRodney W. Grimes	+ writes out the retrieved data DBT.
3258f0484fSRodney W. Grimesf: set the flags for the next command
3358f0484fSRodney W. Grimes	+ no value zero's the flags
3458f0484fSRodney W. GrimesD [file]: data file
3558f0484fSRodney W. Grimes	+ set the current data value to the contents of the file
3658f0484fSRodney W. Grimesd [data]:
3758f0484fSRodney W. Grimes	+ set the current key value to the contents of the line.
3858f0484fSRodney W. GrimesK [file]: key file
3958f0484fSRodney W. Grimes	+ set the current key value to the contents of the file
4058f0484fSRodney W. Grimesk [data]:
4158f0484fSRodney W. Grimes	+ set the current key value to the contents of the line.
4258f0484fSRodney W. Grimeso [r]: dump [reverse]
4358f0484fSRodney W. Grimes	+ dump the database out, if 'r' is set, in reverse order.
4458f0484fSRodney W. Grimes
4558f0484fSRodney W. GrimesOptions to dbtest are as follows:
4658f0484fSRodney W. Grimes
4758f0484fSRodney W. Grimes	-f: Use the file argument as the database file.
4858f0484fSRodney W. Grimes	-i: Use the rest of the argument to set elements in the info
4958f0484fSRodney W. Grimes	    structure.  If the type is btree, then "-i cachesize=10240"
5058f0484fSRodney W. Grimes	    will set BTREEINFO.cachesize to 10240.
5158f0484fSRodney W. Grimes	-o: The rest of the argument is the output file instead of
5258f0484fSRodney W. Grimes	    using stdout.
5358f0484fSRodney W. Grimes
5458f0484fSRodney W. GrimesDbtest requires two arguments, the type of access "hash", "recno" or
5558f0484fSRodney W. Grimes"btree", and the script name.
56