v5:axmls:extractschema
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:axmls:extractschema [2016/01/13 02:26] – ↷ Page moved from axmls:extractschema to v5:axmls:extractschema mnewnham | v5:axmls:extractschema [2020/12/30 01:03] (current) – typos and sync params with source code peterdd | ||
---|---|---|---|
Line 3: | Line 3: | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[axmls:parseSchemaFile()]] | + | [[v5:axmls:parseschemafile]] |
== Syntax == | == Syntax == | ||
string extractSchema ( | string extractSchema ( | ||
- | optional bool $includeData | + | optional bool $data = false, |
- | optional string $indent = ' ', | + | optional string $indent = ' |
optional string $prefix = '', | optional string $prefix = '', | ||
optional bool $stripprefix = false | optional bool $stripprefix = false | ||
Line 13: | Line 13: | ||
</ | </ | ||
===== Description ===== | ===== Description ===== | ||
- | Extracts | + | Extracts |
Call this method to create an XML schema string from an existing database. If the data parameter is set to TRUE, AXMLS will include the data from the database in the schema. | Call this method to create an XML schema string from an existing database. If the data parameter is set to TRUE, AXMLS will include the data from the database in the schema. | ||
Line 20: | Line 20: | ||
===== Parameters ===== | ===== Parameters ===== | ||
- | ==== $includeData | + | ==== $data ==== |
- | Include data from the database in schema dump. There are a number of issues that affect the successful outcome of use of this option: | + | Include data from the database |
* The size of the tables being dumped | * The size of the tables being dumped | ||
* The database in use | * The database in use | ||
Line 28: | Line 28: | ||
Because the method results in the entire database being held in a single string variable, a good rule of thumb is that if a single table contains more than 1,000 records then it would be more appropriate to consider use of a database specific data dump utility. | Because the method results in the entire database being held in a single string variable, a good rule of thumb is that if a single table contains more than 1,000 records then it would be more appropriate to consider use of a database specific data dump utility. | ||
==== $indent ==== | ==== $indent ==== | ||
- | The indentation character to use. The default value is ' '(space). Other alternatives might be " | + | The indentation character(s) to use. The default value is ' |
==== $prefix ==== | ==== $prefix ==== | ||
- | Only match tables with this prefix. | + | Only match tables with this prefix. |
==== $stripprefix ==== | ==== $stripprefix ==== | ||
- | strip prefix string when storing in XML schema. This option works in conjunction with the $prefix option. For example, if required table names were all prefixed with e.g. ' | + | Strips the prefix string |
===== Return ===== | ===== Return ===== | ||
Line 38: | Line 38: | ||
===== Database Migration ===== | ===== Database Migration ===== | ||
- | For small databases, use of this method paired with [[axmls:parseSchemaFile()]] provides an easy to use database schema and data migration tool. | + | For small databases, use of this method paired with [[v5:axmls:parseschemafile]] provides an easy to use database schema and data migration tool. |
v5/axmls/extractschema.1452648362.txt.gz · Last modified: 2017/04/21 11:23 (external edit)