Initial revision
[freeside.git] / htdocs / docs / man / dbdef_column.txt
1 NAME
2     FS::dbdef_column - Column object
3
4 SYNOPSIS
5       use FS::dbdef_column;
6
7       $column_object = new FS::dbdef_column ( $name, $sql_type, '' );
8       $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL' );
9       $column_object = new FS::dbdef_column ( $name, $sql_type, '', $length );
10       $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL', $length );
11
12       $name = $column_object->name;
13       $column_object->name ( 'name' );
14
15       $name = $column_object->type;
16       $column_object->name ( 'sql_type' );
17
18       $name = $column_object->null;
19       $column_object->name ( 'NOT NULL' );
20
21       $name = $column_object->length;
22       $column_object->name ( $length );
23
24       $sql_line = $column->line;
25       $sql_line = $column->line $datasrc;
26
27 DESCRIPTION
28     FS::dbdef::column objects represend columns in tables (see the
29     FS::dbdef_table manpage).
30
31 METHODS
32     new Creates a new FS::dbdef_column object.
33
34     name
35         Returns or sets the column name.
36
37     type
38         Returns or sets the column type.
39
40     null
41         Returns or sets the column null flag.
42
43     type
44         Returns or sets the column length.
45
46     line [ $datasrc ]
47         Returns an SQL column definition.
48
49         If passed a DBI $datasrc specifying the DBD::mysql manpage,
50         will use MySQL-specific syntax. Non-standard syntax for
51         other engines (if applicable) may also be supported in the
52         future.
53
54 BUGS
55 SEE ALSO
56     the FS::dbdef_table manpage, the FS::dbdef manpage, the DBI
57     manpage
58
59 HISTORY
60     class for dealing with column definitions
61
62     ivan@sisd.com 98-apr-17
63
64     now methods can be used to get or set data ivan@sisd.com 98-may-
65     11
66
67     mySQL-specific hack for null (what should be default?)
68     ivan@sisd.com 98-jun-2
69