sqlds(1)SqLay Suitesqlds(1)

NAME

sqlds - a tiny suite of tools for relational database table data visualization or edition on console, X or WWW.

SYNOPSIS

sqldsa [options] datasource

sqldsh [options] datasource

sqlds.cgi [options] datasource

sqldsc [options] datasource

sqldsq [options] datasource

DESCRIPTION

sqlds is made of 3 tools allowing to display or edit (if compiled with debug) data stored in a database table or view: sqldsa (or sqldsh or sqlds.cgi), non-interactive, generating plain text output on raw consoles either in Ascii art or in HTML or a Web page if running in a Web server, sqldsc a ncurses based data viewer / entry sheet for console and sqldsq a Qt based data viewer / entry sheet for windowing environnment.

They perform by connecting to a data source passed by in the form of an URL which loads a driver.

They currently come with several drivers: a MySQL driver, a PostgreSQL driver, a FreeTDS driver, an SQLite driver, an MDBTools driver, a basic CSV file driver, a basic SQL file driver, a dummy (random) driver and ODBC drivers.

They are part of the SqLay suite and share most of the options and connection facilities with other sqlay tools.

sqlds could be a symlink to one of those programs.

OPTIONS

Datasource:

an URL in the form: proto://[[user[:password]@]host]/[database]/[<table>][??<filter clause>] where:

Options:

COMMANDS

Here is a (to be completed) list of key bindings available in sqldsc and sqldsq. Most should be available in both programs, so the right column indicates where they differ in sqldsq.

In read-only mode (i.e. on views), some character keys may function this way:

FILES

The following files are checked in this order for user preferences:

A preference found in the last file will override the value found in the first one.

The files format is the following:

HTML templates can be used to customize the beginning and the end of generated HTML. They can be created in user's home directory with the following file names:

If not found, those two files will also be searched in system wide directory defined at compile time as SQLAY_SHAREDIR/templates/html.

<template_name> can then be used as parameter for the -ot option.

The default template name is 'default-ds'.

The special template name 'null' means 'don't use any template'.

sqldsq (only but plan is to support it on sqldsc as well) also allows specification of a User menu, appearing between the Edit and the View menus. Its configuration has to be done by data source in files folowing this naming convention:

$HOME/.sqlay/<proto>/<host>/<database>/<table or view name>.sqlay

Of course, you can symlink subdirectories to . in order to have menu files shared between hosts, protocols or databases for the same table or view name.

But PLEASE TAKE CARE that those files and directories are writable by the user only, otherwise command could be executed under his account (in future releases, check may be done on this otherwise the file would be ignored).

Those files are line oriented and tab separated with one and only one tab between tokens. The format is the following:

The menu name is currently not really used but must be ASCII without space. The menu display name is the one which will appear in the User menu. The action will be executed using a system() call. Variable subsitution in the action line is made on tokens having the following format:

in which case the value in the currently selected row for the specified field name will be substitued. Note that here above, the < and > characters are part of the format. There are currently no other substitutable tokens (I am thinking about connection parameters and table or view name).

Example entry:

menu..printcard         Customer card: Preview (one)...\ 
         echo "\\pset t \\\\ \\pset format unaligned \\\\ \\pset fieldsep '\\t' \\\\ \
 select c.custname, c.custzip, cc.type_id as contact_type, p.title, p.fname, p.lname, p.num, p.street, p.zip, p.city, p.tel, p.fax, p.mobile, p.rem \
 from people p, customers c, custcontacts cc WHERE ((cc.cust_code = c.code) AND (cc.people_nbr = p.code)) and c.code = '#-<cust_code>-#'" \ 
| psql -q bizdb \ 
| ~/.sqlay/reports/bizdb.vcustcontacts.cards-tex.awk \ 
> /tmp/sqlay-print.tex\ 
;( cd /tmp\ 
; texi2dvi sqlay-print.tex\ 
; dvips -q sqlay-print.dvi \ 
&& gv sqlay-print.ps& )

NOTES

The editing features appear to me unsufficiently tested to be presented in normal compilation. Use it if you like at your own risks.

sqlds.cgi is currently read-only and non-interactive, even if compiled with debug.

Spaces in two letters options having an argument, like -th and -tw are interpreted differently in sqldsa and sqldsc/sqldsq: both accept all characters glued together, but sqldsc/sqldsq will (silently) reject the form -tw 20 and sqldsa will reject the form -t w20.

The debug level uses bitwise operators (16, 32, 64) and'ed but is unfortunately not very accurate.

BUGS

Very probably a lot (see the files BUGS and TODO included in the source).

Also, pls understand that this is an alpha release and none of the executables is securized against buffer overflows, and so on.

The drivers also are not thread safe. Not even the connections are safe.

The API has really been designed until now for use on trusted developpement machines, accessed only by trusted users, so:

YOU ARE STRONGLY ENCOURAGED NOT TO RUN THE CGI VERSION ON A PUBLICLY ACCESSIBLE WEB SERVER.

AUTHOR

E. Lurquin <sqlay@hitud.net>

SEE ALSO

sqlay(1), sqlsc(1), sqlayin(1), sqlayindummy(1), sqlayinfiles(1), sqlayinfilet(1), sqlayinslite(1), sqlayinmdbtl(1), sqlayinpgsql(1), sqlayinmysql(1), sqlayinfrtds(1), sqlayinodbc3(1)




sqlds 0.8Dec 2008sqlds(1)