			DBTOYFS version 0.8

What is dbtoyfs?
================

It's a linux filesystem, implemented using fuse.
Its purpose is to expose the contents of a relational database
through a set of directories and files.


Compiling dbtoyfs
=================

To succesfully compile and run dbtoy you need fuse (2.6 and above)
and the client libraries for the dbms you need to connect to.
This version supports connections to MySQL and PostgreSQL databases
(prior versions only supported MySQL).
There is a "driver" to talk to each dbms, you can enable or disable
every driver at compile time. You should enable at least one driver...

The quickest way build dbtoy is the script 'makeall.sh', included in
the source distribution. This script looks for the needed libraries
and enable the corrisponding drivers.
If you want to choose yourself the drivers to be built, you can pass
the appropriate parameters to make.
For instance, to build both drivers run:
	make MYSQL_DRV=1 POSTGRESQL_DRV=1

To get the correct flags, the Makefile uses the scripts provided by the
dbms developers ('mysql_config' and 'pg_config' respectively) so these
scripts should be in your $PATH.

Playing with dbtoyfs
====================

1) First of all, make sure that you can succesfully connect to the
database. 

2) Modprobe fuse kernel module.

3) Run dbtoy passing your credentials and the mount point.
To see a list of options run dbtoy without arguments.

Here's some example:
Connecting to MySQL running on a remote server:
	dbtoy -u username -p password -h remotehost -d mysql /mnt/dbtoy
Connecting to PostgreSQL running locally:
	dbtoy -u postgres -p '' -d postgresql -i postgres /mnt/dbtoy

 
4) Walk through your filesystem.
Each schema has its own directory, containing one subdirectory for
every table. Inside the dirs there is one file with the description of
the datatypes and another with the data. Ex.:

mountpoint
   |
   +------schema1
   |        ....
   +------schemaN
            |
            +-----table1
            |        |
            |        +-----data
            |        +-----types
            |       .....
            +-----tableM
                     |
                     +-----data
                     +-----types

You can "cat mountpoint/schemaN/tableM/types" to see a description of the table,
or look at the data.
The file format is XML, with the tag names matching those of the corresponding
columns of the database. A custom stylesheet can be added to all files using
the "-x" command line option, e.g:
dbtoy -u root -p root -x '<?xml-stylesheet type="text/xsl" href="my-style.xsl"?>' /mntpoint
If you feel lucky you can play with the EXPERIMENTAL query file feature:
"cat data?col=val" where 'col' is a valid column name and 'val' is a feasible
value for col (and strings must be quoted!)

Other infos
===========

This module, as its name suggests, is not intended for production environments,
is not stable and has several bugs/limitations, your linux box should not
explode but I give no warranty, OK?

Questions/comments at:
Domenico Rotiroti <pinguino@thesaguaros.com>
