# *********************************************************************
# sqlitetotable.txt: help text
# Copyright (c) 2006 Carlo Strozzi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# *********************************************************************
# $Id: sqlitetotable.txt 39 2007-05-02 14:46:09Z carlo $

                      NoSQL operator: sqlitetotable

Builds a valid NoSQL table from a SQLite database table

Usage: sqlitetable [options] dbfilename [SQL_select_command]

Options:
    --input (-i) 'file'
      Read SQLite interactive commands from 'file' instead of command line.

    --output (-o) 'file'
      Write output to 'file' instead of STDOUT.

     -3
      Use SQLite version 3 as opposed to the default version 2.
      It is assumed the SQLite command-line interface is called
      'sqlite' for v2 and 'sqlite3' for v3.

    --help (-h)
      Display this help text.

    --show-copying
      Display program copying conditions.
                                                          
    --show-warranty
      There is absolutely no warranty for this program.
      Invoke the program with this option for details.

Notes:

If --input is specified then the SQL statment is ignored since the
input file contains all the selection statements that will be needed.
In that case, specify both '.separator "<tab>"' and '.header on'.

The command is designed to work with SQLite version 2 and/or 3. If
the executable is named "sqlite3" use the "-3" switch to invoke it.

An example to select certain records from an SQLite database table is

$ sqlitetotable db1.db -o new.tbl 'select * from table where type = '"'new'"

An example just as before but using an input command file is

$ cat input1
.header on
.separator "    " 
select * from table where type == 'new'
$ sqlitetotable -i input1 -o new.tbl db1.db

