NAME

create.table.pl - Create a db table called - by default - trees

SYNOPSIS

create.table.pl [options]

Options:
-dsn DSN
-extra_columns columnDefinitions
-help
-password aPassword
-table_name aTableName
-username aUsername

All switches can be reduced to a single letter.

Exit value: 0 for success.

OPTIONS

-dsn DSN

Defaults to $DBI_DSN.

Sample: dbi:Pg:dbname=menus or dbi:SQLite:dbname=/tmp/menus.sqlite.

-extra_columns columnDefinitions

The names and details of one or more extra columns to add to the table at create time.

Separate the names with commas.

Examples:

Add 1 extra column
scripts/create.table.pl -e page_id:integer:default:0
Add 2 extra columns
scripts/create.table.pl -d dbi:Pg:dbname=menus -e page_id:integer:default:0,node_id:integer:default:1
scripts/create.table.pl -d dbi:Pg:dbname=menus -e "page_id:integer:default:0,node_id:varchar(255)"

With or without double quotes is ok sometimes, but are always strongly recommended.

When using characters - such as '(' - which can be interpreted by the shell, the quotes are mandatory.

When you use quotes you can then put spaces around the comma(s) and the colons.

The default is to create the table with no extra columns, just those defined in the FAQ of Tree::DAG_Node::Persist.

Note: t/test.t uses this feature, if you wish to see sample code.

-help

Print help and exit.

-password aPassword

Defaults to $DBI_PASS.

-table_name aTableName

Use this to override the default table name 'trees'.

-username aUsername

Defaults to $DBI_USER.