Initial revision
[freeside.git] / htdocs / docs / man / dbdef_table.txt
diff --git a/htdocs/docs/man/dbdef_table.txt b/htdocs/docs/man/dbdef_table.txt
new file mode 100644 (file)
index 0000000..25e010d
--- /dev/null
@@ -0,0 +1,94 @@
+NAME
+    FS::dbdef_table - Table objects
+
+SYNOPSIS
+      use FS::dbdef_table;
+
+      $dbdef_table = new FS::dbdef_table (
+        "table_name",
+        "primary_key",
+        $FS_dbdef_unique_object,
+        $FS_dbdef_index_object,
+        @FS_dbdef_column_objects,
+      );
+
+      $dbdef_table->addcolumn ( $FS_dbdef_column_object );
+
+      $table_name = $dbdef_table->name;
+      $dbdef_table->name ("table_name");
+
+      $table_name = $dbdef_table->primary_keye;
+      $dbdef_table->primary_key ("primary_key");
+
+      $FS_dbdef_unique_object = $dbdef_table->unique;
+      $dbdef_table->unique ( $FS_dbdef_unique_object );
+
+      $FS_dbdef_index_object = $dbdef_table->index;
+      $dbdef_table->index ( $FS_dbdef_index_object );
+
+      @column_names = $dbdef->columns;
+
+      $FS_dbdef_column_object = $dbdef->column;
+
+      @sql_statements = $dbdef->sql_create_table;
+      @sql_statements = $dbdef->sql_create_table $datasrc;
+
+DESCRIPTION
+    FS::dbdef_table objects represent a single database table.
+
+METHODS
+    new Creates a new FS::dbdef_table object.
+
+    addcolumn
+        Adds this FS::dbdef_column object.
+
+    name
+        Returns or sets the table name.
+
+    primary_key
+        Returns or sets the primary key.
+
+    unique
+        Returns or sets the FS::dbdef_unique object.
+
+    index
+        Returns or sets the FS::dbdef_index object.
+
+    columns
+        Returns a list consisting of the names of all columns.
+
+    column "column"
+        Returns the column object (see the FS::dbdef_column manpage)
+        for "column".
+
+    sql_create_table [ $datasrc ]
+        Returns an array of SQL statments to create this table.
+
+        If passed a DBI $datasrc specifying the DBD::mysql manpage,
+        will use MySQL-specific syntax. Non-standard syntax for
+        other engines (if applicable) may also be supported in the
+        future.
+
+BUGS
+SEE ALSO
+    the FS::dbdef manpage, the FS::dbdef_unique manpage, the
+    FS::dbdef_index manpage, the FS::dbdef_unique manpage, the DBI
+    manpage
+
+HISTORY
+    class for dealing with table definitions
+
+    ivan@sisd.com 98-apr-18
+
+    gained extra functions (should %columns be an IxHash?)
+    ivan@sisd.com 98-may-11
+
+    sql_create_table returns a list of statments, not just one, and
+    now it does indices (plus mysql hack) ivan@sisd.com 98-jun-2
+
+    untaint primary_key... hmm. is this a hack around a bigger
+    problem? looks like, did the same thing singles in colgroup!
+    ivan@sisd.com 98-jun-4
+
+    pod ivan@sisd.com 98-sep-24
+