EDITOR
Used by the 'nsq-ed' utility (Default: 'vi').
Relational database management system
Part of nosql(1).
NoSQL is a fast, portable, Relational DataBase Management System without arbitary limits, (other than memory and processor speed).
NoSQL uses the 'operator/stream' DBMS paradigm described in "Unix Review", March, 1991, page 24, entitled "A 4GL Language". The operators are UNIX filters, i.e. they read STDIN and write STDOUT so they can be connected by pipes the ('|' char).
The operators work with relational data in ascii files. The fields in each row are separated by a 'TAB' char and the row is terminated with a 'NEWLINE' char. The first section of rows (the header) contains the names and data definitions for each column. The header also contains optional embedded documentation relating to the entire datafile and/or each data column. Subsequent rows (the body) contain the data values. A file in this form is said to be an 'rdbtable'. NoSQL is compliant with the 'Relational Model'.
These rdbtables are easily ported to and from spreadsheet programs on Macintoshes, MSDOS or MS-Windows computers.
All operators read an rdbtable via STDIN and most write a new rdbtable via STDOUT. Exceptions are operators that produce output listings instead of rdbtables (like 'nsq-pr' and 'nsq-report').
All operators take a '-help' option to print usage detail and other information online.
Operators can be grouped into data movers, report generators, and utilities.
The data movers are operators that extract or rearrange the data in some way. They each read an rdbtable via STDIN and write an rdbtable via STDOUT and so are frequently connected using the UNIX pipe function to form a larger task. Each operator in such a "pipeline" style of operation gets its input from the output of the previous operator in the "pipeline". The data movers include:
nsq-colSelects columns by name, outputs columns in listed order.
nsq-computeComputes an arbitrary expression using column names.
nsq-headchgGenerates and replaces (or removes) the header of an rdbtable.
nsq-joinNatural or "Master/Detail" join of two rdbtables.
nsq-l2tConverts a file in list format to an rdbtable..
nsq-mergeMerges two like rdbtables.
nsq-rowSelects rows based on arbitrary Perl expressions.
nsq-searchSelects rows based on a multi-column key of a sorted or indexed rdbtable.
nsq-sortSorts a datafile by one or more columns.
nsq-subtotLists subtotals of specified columns.
nsq-t2lConverts an rdbtable to list format.
nsq-teeSafely [over]writes an rdbtable.
nsq-uniqMakes an rdbtable unique on specified columns.
nsq-updseqUpdates/Creates a unique record ID on each row of an rdbtable. The field must be the first column in the table.
The report generators each read an rdbtable via STDIN and produce a report on STDOUT, so when they are in a "pipeline" of operators they will be the operator at the end. The report generators are:
nsq-prQuick and easy printing of output formatted from information in the header.
nsq-reportBest form of output, with definable format.
nsq-seePrints the contents of a text file, visualizing TABS and Line-Ends.
nsq-summSummary/Statistical information about data values in an rdbtable.
nsq-validVerifies the structure of an rdbtable.
nsq-wordsGenerates a list of unique words from a set of text files.
The utilities are used for manipulating the structure and content of rdbtables and are generally used as separate tasks, i.e. they do not read STDIN. The utilities are:
nsqNoSQL interactive terminal interface.
nsq-edUses an editor to allow modifications to an rdbtable.
nsq-indexGenerate rdbtable index files to be used by nsq-search.
nsq-lockTrivial table locking program, for serializing access to rdbtables.
nsq-mktblMakes a file of data in columns into an rdbtable.
nsq-repairAttempts to repair candidate NoSQL datafiles.
nsq-rollbackPrints an rdbtable the way it was at a point in time, using RCS.
All operators take a '-h[elp]' option to show details of operation online.
Data Types:
The type of data may be string, numeric, or month. The types are specified by an S, N, or M respectively in the header. The default is type string.
# Embedded documentation for this rdbtable.
# Any number of lines may exist.
# Also available for each column (not shown here).
NAME CNT TYP AMT
6 4N 3 5N
Hobbs 65 DD 1111
Bush 4 A 133
Perry 177 B 244
Jones 47 XY 77
Hansen 44 A 23
The above rdbtable after being processed by the command:
nsq-col < sample NAME TYP AMT CNT | nsq-sort TYP AMT | nsq-pr
NAME TYP AMT CNT
------ --- ----- ----
Hansen A 23 44
Bush A 133 4
Perry B 244 177
Hobbs DD 1111 65
Jones XY 77 47
Environment variables used by NoSQL:
EDITOR
Used by the 'nsq-ed' utility (Default: 'vi').
PAGER
Used by the 'nsq' utility (Default: 'less').
TMPDIR
Where to store work files (Default: '/tmp').
NSQLOCKER
Table locking program (Default: 'nsq-lock').