how_it_works,v 1.3 1994/05/02 08:11:19 lindner Exp

Internals Commands of The SQL gateway
Paul Lindner

(See the README first...)

The following commands are understood by the Gateway, put these in the
Path= line of your .links file.

o   tables [<search>]

    This command uses the data dictionary to make a gopher directory
    list of the different tables in the database.  This is most useful
    for allowing raw database access.  This command generates
    "columns" commands that the client will execute.

    An optional search item will restrict the tables to match the
    search term.


o   columns <tablename> [<search>]
    
    This command uses the data dictionary to make a gopher directory
    list of the columns in <tablename>.  This command generates "list"
    commands for the client to execute.

    An optional search item will restrict the tables to match the
    search term.


o   list <tablename.columnname> [<fromtables> [<query>]] [<search>]
o   list1 [<tablename.columnname>-><tablename.columnname>
	   [<fromtables> [<query>]] [<search>]

    These commands generate a listing of the unique items in the given
    table and column.  list generates text items, list1 generates
    directory items.  list1 uses a chain of items that can be browsed.

    This command can be part of a multiple series of queries by
    specifying an optional list of tables to choose from and an query.
    This gets translated into SQL that looks like this:

      select .....
      from  <fromtables>
      where <query>

    An optional search can search for specific titles in the specified
    table and column.


o   get <tablename.columnname> <fromtables> <query>

    This command actually retrieves a record from the database as a
    textual item.  The default is to print out each column name, a
    colon and the data contained in it.  Multiple records are
    separated with a line of "dashes".

    Optionally one may define a module for a specific table.  This
    module is a file containing perl code that can do sub-queries and
    fancy reformatting of the data into any format you desire.















