SQL/HTML v1.0
Jonathan A. Zdziarski
jonz@netrail.net


1. What is SQL/HTML?

  SQL/HTML is a small CGI I wrote to allow people to view/modify their SQL
database from the web.  I didn't design it to be an advanced query system,
rather a method of displaying basic, ordered information (such as circuit
ID's, peering ASN's, etc).  I've also written in access control permissions
to set who has access to what.

2. How do I set up SQL/HTML?

  Copy all the files into a directory that your web server is serving
pages out of.  Then, using the web server documentation, set that directory
up to be HTTP password protected.  When you do this, the server uses MD5
challenges to authenticate users rather than sending cleartext password
over the network.  As a result of this, SQL/HTML reads $ENV{'REMOTE_USER'}
from the post-authenticated user and uses that as authentication.

  Once you've got the files copied and a basic access userlist set up
(for your http password protection), you will want to edit html/index.html.
I have set it up to allow you to select a database from a dropdown list, 
rather than display all databases online (for obvious reasons).  You can
put in whatever databases you like.

  After you edit index.html, edit etc/users and etc/crossref.  The users file
is what allows people to access certain databases and read/write permissions.
The crossref file allows you to link the ID of one table to a unique ID of
another without actually joining the tables...for example if you have
a CUSTOMER_ID field, it will be displayed as a link, and then clicked on will
show you the CUSTOMER_ID customer's information from another database you've
got set up.

3. How may I use SQL/HTML - use it, don't distribute it...don't make any
money off of it, etc.  I will come up with a better license later on if this
thing actually gets used.

4. A few things you should know...

   - SQL/HTML currently looks at the first field of each table as the
     'unique id field'.  I did this because I primarily use this schema on
     my databases.  I will eventually change this if people start using this
     thing.

   - If you have a lot of fields, by default it will display them all which
     will look really messy.  For this reason i created the VIEW PREFERENCES
     button which lets you select which fields to view, then saves the
     info into a SDBM hash in etc/ for this reason make sure etc/view.* is
     writable by your web process

   - auth cookies are written to the auth/ directory.  Make sure the auth/
     directory is writable by the web process.

5. Future Improvements:

   - crossref to allow you to reference different fields in different
     databases, not just the unique field
   - add a 'join' file allowing you to join tables and perform simple
     logic pre-display
   - add a basic search engine
   - allow you to specify what field is the unique id field via textfiles, or
     SQL statements
   - a few other things



If you use this, drop me an email and let me know what company/organization
and for what you use it for..i'd like to know.


