Next Previous Contents

3. Using NoSQL

3.1 Operators

The NoSQL system comprises a set of programs called Operators.

Each operator is a separate program module that performs a unique function on the data.

At one time NoSQL used to have extra operators, like body, dashline, etc. At some point I realized how useless they were, so I dropped them. After all they were just calls to ordinary UNIX utilities. There was really no point in providing special operators just for them, as their function could be done by applying those system commands directly. For instance:

body

Same as : tail +3 < table

dashline

Same as : sed -n 2p < table

headline

Same as : head -1 < table

fieldsof

Same as : head -1 < table

header

Same as : head -2 < table

see

Same as : cat -vte < table

Once again, this shows how powerful the UNIX operating system already is of its own, and how handy it can be for an add-on package like NoSQL to be able to tap into this power without having to re-invent the wheel.

Invoking NoSQL programs and operators is straightforward :

        command [options] [arguments]
    

where command is the name of the desired NoSQL operator or utility. Make sure the directory containing the NoSQL executables, usually /usr/local/nosql/bin/, is in your PATH.

Most operators take a --help switch, that will show the list of available command-line options and arguments, plus some usage notes.

Here follows a list of NoSQL operators, with a short description of the function of each:

addcolumn

Create new empty columns in the rightmost position of a table.

addrow

Append a new empty record to a table.

column

Pick columns by name, output columns in listed order.

compute

Compute an arbitrary expression using column names.

depend

Test for ``functional dependency'' betwen two columns.

edittable

Use an editor to allow modifications to a table.

envtolist

Convert environment variables into a one-record list.

envtotable

Convert environment variables into a one-record table.

filter

Run standard utilities against a table.

filetolist

Convert a (possibly binary) file into a one-record list.

gregorian

Translate selected date columns from Julian to calendar format.

index

Generate table index files to be used by 'search'.

islist

Check whether an input file has a valid 'list' format.

istable

Check whether an input file has a valid table format.

jointable

Natural or "Master/Detail" join of two tables on a common field.

julian

Translate selected date columns from calendar to Julian format.

justify

An alias for prtable.

listtoform

Take a file in 'list' format and use the values from the last record to replace special tags on a template file.

listtotable

Take a file in 'list' format and makes it into a table.

maketable

Build a valid table header from a template file.

number

Insert a unique record identifier into a table.

project

An alias for column.

prtable

Quick and easy table formatter for character displays.

random

pick one or more table records at random.

rename

Rename a column.

repair

Append empty data fields to rows to make them match the table header.

rmcolumn

Remove one or more columns.

row

Select rows based on arbitrary AWK expressions.

search

Select rows based on a multi-column key of a sorted or indexed table.

select

An alias for row.

sorttable

Sort a table by one or more columns.

soundex

Compute Knuth's soundex codes for selected columns.

subtotal

List subtotals of specified columns.

tabletoform

Replace special tags in a template file.

tabletolist

Convert a table into the corresponding 'list' format.

tabletorc

Convert a table into rc(1) variable assignments.

tabletosh

Convert a single-record table into sh(1) variable assignments.

template

Build a table template file for the input table.

union

Concatenate multiple union-compatible tables.

unique

Make a table unique on the primary key field.

update

Insert/update/delete table rows based on the contents of an edit table.

viewtable

Visualize a table in a nice list-like format.


Next Previous Contents