plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

sdb.7 (1933B)


      1 .TH SDB 7
      2 .SH NAME
      3 sdb \- simple database format
      4 .SH DESCRIPTION
      5 The simple database (sdb) format is Plan 9's network database
      6 .MR ndb (7)
      7 format with arbitrary-length strings for general-purpose use.
      8 .PP
      9 Database files consist of multi-line records made up of tuples of the
     10 form attr=value.
     11 Attributes are any sequence of non-whitespace characters exluding = and #.
     12 Tuples with no value can omit the =.
     13 Within a record, tuples are separated by whitespace, and lines starting
     14 with whitespace continue the current record.
     15 .PP
     16 Values can be quoted with double quotes to include spaces.
     17 When values are quoted, the following escape sequences are recognized:
     18 \e0 (null), \et (tab), \en (newline), \er (carriage return),
     19 \e" (quote), and \e\e (backslash).
     20 All other bytes, including those with values above 127, can be stored directly.
     21 This allows sdb to fully support binary data.
     22 .PP
     23 Comments begin with # and extend to the end of the line, except when #
     24 appears inside a quoted value.
     25 .SH PATTERN MATCHING
     26 Several sdb tools support pattern matching for attributes and values.
     27 The pattern language includes:
     28 .TP
     29 .B *
     30 Wildcard that matches zero or more characters.
     31 A trailing * in a pattern matches one or more characters.
     32 .TP
     33 .B >, >=, < and <=
     34 Comparison operators for lexicographic string comparison.
     35 .TP
     36 .B \e*
     37 Literal asterisk (escaped with backslash).
     38 .SH EXAMPLES
     39 A simple database of network services:
     40 .IP
     41 .EX
     42 service=http port=80 protocol=tcp
     43 	description="Web server"
     44 
     45 service=https port=443 protocol=tcp
     46 	description="Secure web server"
     47 
     48 service=ssh port=22 protocol=tcp
     49 	description="Secure shell" security=high
     50 .EE
     51 .PP
     52 Using special characters in values:
     53 .IP
     54 .EX
     55 data=raw value="one\ettwo\etthree"
     56 
     57 message="First line\enSecond line\enThird line"
     58 
     59 file="/home/user/My Documents/report.txt"
     60 
     61 signature="GIF89a\e0\e0ÿÿ"
     62 	checksum=Á¢£¤¥¦§¨©
     63 .EE
     64 .SH SEE ALSO
     65 .MR sdb (1) ,
     66 .MR sdb (3) ,
     67 .MR sdbr (3) ,
     68 .MR ndb (7) ,
     69