DBDirect

Langue: en

Version: 314609 (ubuntu - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

DBDirect - Database interface generator for use with HaskellDB

SYNOPSIS

DtdToHaskell [ -b ] driver options name

DESCRIPTION

DBDirect is a tool which connect to a SQL database and generates a set of Haskell modules which describe the SQL database. The generated Haskell modules can be used by the HaskellDB library to manipulate the database.

DBDirect expects a full set of arguments when called, which should consist out of specific driver, a set of driver specific options and a module name used as base for the Haskell modules. The arguments should be given in the order specified below to make sure DBDirect uses the arguments correctly and does not, for example, uses a password as an username.

-b
enable BoundedString
driver
a database type which should be one of HSQL.ODBC, HSQL.MySQL, HSQL.PostgreSQL or HSQL.SQLite3.
options
a set of options for the specific driver.
for HSQL.OBDC the options are dsn, uid and pwd
for HSQL.MySQL the options are server, db, uid and pwd
for HSQL.PostgresSQL the options are server, db, uid and pwd
for HSQL.SQLite3 the options are filepath and mode
module
base name of the database description modules. If this is Test and there are tables test_tb1 and test_tb2 in the database that you run DBDirect against, the following files will be created in the current directory:
• Test.hs (just imports and re-exports all the other modules)
• Test/Test_tb1.hs
• Test/Test_tb2.hs

EXAMPLES

As an example we generate a database description from a test table test_tb1 in the test_db PostgreSQL database on the local machine. The username is bob and the password is secret. To generate the Haskell modules with base module name Dp037 we can run:
DBDirect PostgreSQL localhost test_db bob secret Dp037

AUTHOR

This manual page was party copied and partly written by Arjan Oosting <arjanoosting@home.nl> for the Debian system (but may be used by others).