====== DBTables Plugin ======
---- plugin ----
description: Render database schemas in DokuWiki format. Useful for DB Dev'rs.
author : Stephen C / Pontiac76
email : pontiac76@gmail.com
type : helper, render
lastupdate : 2010-09-29
compatible : Lemming
tags : data, database, tables
downloadurl: http://ginger.gotdns.com/public/wiki/download/dbtables.zip
----
===== Download and Installation =====
Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
Download the plugin from [[http://ginger.gotdns.com/public/wiki/download/dbtables.zip|here]]
Demo [[http://ginger.gotdns.com/public/wiki/doku.php?id=stephens:development:dbtables|here]]
===== Syntax and Usage =====
.
.
.
==== Options ====
^ Option ^ Description ^ Default ^
| groups | How many horizontal DW-tables are displayed | 4 |
| cols | How many columns per DW-table are rendered | 4 |
| c{#} | Name of DW-table field, where # the field number | c1=Field;c2=Type;c3=Relation;c4=Desc |
| fdelim | Field Delimeter - Character representing how each DW-DB field is seperated | : |
| thead | Table Heading - Character representing the line in which a table name is defined | _ {Underscore} |
| twidth | Width of the HTML table | Undefined - Dokuwiki decides |
| nosort | When assigned any value, does not sort the table names. Sorting happens by default. | Undefined |
| norender | Outputs the DW-tables in Dokuwiki text format | Undefined |
Note that with twidth, nosort, and norender, you must assign some sort of value, for example, ''norender=1''.
===== Examples =====
==== Example #1 ====
Table1
TableID:int:PK:ID of Table
TableName:varchar(50)
Table2
TableID:int:PK
TableParent:int:FK->Table1.TableID
TableDesc:varchar(50)::Description of Table:You won't see this rendered if cols=4
Table3
TableID:int:PK
Table4
TableID:int:PK
Table5
TableID:int:PK
Table6
TableID:int:PK
==== Example #2 ====
_Customers
CustomerID:int:Primary Key
FirstName:varchar(50)
LastName:varchar(50)
Address:text:Populated via TEXTAREA
_Orders
OrderID:int:Primary Key
CustomerID:int:FK->Customers.CustomerID
DateSumbitted:datetime
DateFilled:datetime
DateShipped:datetime
Shipper:varchar(50)
_OrderDetails
OrderID:int:FK->Orders.OrderID
ProductID:int:FK->Products.ProductID
Units:int
Price:money
_Products
ProductID:int:Primary Key
Name:varchar(50)
VolumeInStock:int
CurrentPrice:money
Photo:blob
Description:text