|
DataFaucet 1.0 Beta | ||||
| FRAMES | |||||
WEB-INF.cftags.component
datafaucet.system.kernel
datafaucet.system.duck
datafaucet.system.schemaexport
public class schemaexport
This component exports the schema for a set of tables as an XML packet that can be executed by a datasource object to create tables in an alternate datasource
| Constructor Summary | |
|---|---|
init([string tables='*'], [any datasource=''])
|
|
| Method Summary | |
|---|---|
private string |
addReferenceAttribute(string column, string references)
removes autonumber and primary key attributes from an xml column string and replaces them with a references attribute |
private query |
getColumns(string table)
gets a list of columns for a specified table |
string |
getDDL()
|
any |
getDDLFromObject(any object, [string table=''])
|
private any |
getDateDefault(string content)
|
string |
getDiff(string New, string Old, [string drop=''])
|
private string |
getDiffXSLT()
|
private struct |
getImportedKeyStruct(string table)
|
private query |
getImportedKeys(string table)
returns primary keys that have been imported into a specified table |
private struct |
getPrimaryKeyFromProperties(string table, array properties)
returns a structure containing the attributes of a cfproperty tag specified as a primary key |
private query |
getPrimaryKeys(string table)
gets primary key constraints for a specified table |
private any |
getSequenceFromObject(any object)
|
string |
getUpgradeDiff(string New, [string drop=''])
|
private any |
raiseXrefPrimaryKeyException(string table, string references)
|
private any |
raiseXrefReferenceException(string property, string xref)
|
private any |
set_datasource()
prevents datasource from being set as a property of the export object |
private string |
set_tables(string propertyname, string propertyvalue)
sets the list of tables to export - allows wild-cards |
private string |
writeColumn(string name, string type, [string nullable='true'], [string def=''], [string size=''], [string size2=''], [string references=''], [boolean autonumber='false'])
|
private string |
writeColumnFromProperty(string name, [string type='string'], [string required='false'], [string default=''], [string length=''], [string references=''], [boolean autonumber='false'], [boolean key='false'])
|
private string |
writeCrossReferenceFromProperty(string name, string table, struct primary, string references, string xref)
creates the XML syntax for a cross-reference table from a cfproperty tag |
private string |
writeTable(string table)
|
| Methods inherited from class datafaucet.system.duck |
|---|
addObserver, getObservers, getProperties, getProperty, getPropertylist, getValue, identifyAccessorOrMutator, observe, onMissingMethod, raiseMissingMethodException, reset, setProperties, setProperty, setValue
|
| Methods inherited from class datafaucet.system.kernel |
|---|
arg, componentExists, getDataFaucet, getFaucetObject, getFile, getFileModified, getObject, getPlumbing, getTransaction, getTransactionManager, newTransaction, parseDate, setTransaction
|
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init([string tables='*'], [any datasource=''])
tablesdatasource| Method Detail |
|---|
private string addReferenceAttribute(string column, string references)
columnreferencesprivate query getColumns(string table)
tablepublic string getDDL()
public any getDDLFromObject(any object, [string table=''])
object - an object from which properties are discoveredtable - allows the name of the table to be declared explicitlyprivate any getDateDefault(string content)
contentpublic string getDiff(string New, string Old, [string drop=''])
New - an XML packet containing the DDL definition for the new schemaOld - an XML packet containing an old DDL definition to be upgradeddrop - comma-delimited list allows entities to be dropped during upgrade - options are tables, columns, views, proceduresprivate string getDiffXSLT()
private struct getImportedKeyStruct(string table)
tableprivate query getImportedKeys(string table)
table - the name of the table to return key data fromprivate struct getPrimaryKeyFromProperties(string table, array properties)
tablepropertiesprivate query getPrimaryKeys(string table)
table - the name of the table to return key data fromprivate any getSequenceFromObject(any object)
objectpublic string getUpgradeDiff(string New, [string drop=''])
New - an XML packet containing the DDL definition for the new schema - existing schema to compare will be exported from the database using the getDDL methoddrop - comma-delimited list allows entities to be dropped during upgrade - options are tables, columns, views, proceduresprivate any raiseXrefPrimaryKeyException(string table, string references)
tablereferencesprivate any raiseXrefReferenceException(string property, string xref)
propertyxrefprivate any set_datasource()
private string set_tables(string propertyname, string propertyvalue)
propertynamepropertyvalueprivate string writeColumn(string name, string type, [string nullable='true'], [string def=''], [string size=''], [string size2=''], [string references=''], [boolean autonumber='false'])
nametypenullabledefsizesize2referencesautonumberprivate string writeColumnFromProperty(string name, [string type='string'], [string required='false'], [string default=''], [string length=''], [string references=''], [boolean autonumber='false'], [boolean key='false'])
nametyperequireddefaultlengthreferencesautonumberkeyprivate string writeCrossReferenceFromProperty(string name, string table, struct primary, string references, string xref)
nametableprimaryreferencesxrefprivate string writeTable(string table)
table
|
DataFaucet 1.0 Beta | ||||
| FRAMES | |||||