cvs: pear /MDB2_Schema/docs xml_schema_documentation.html
| From: | Igor Feghali | Date: | Sat, 30 Sep 2006 03:15:40 +0000 |
| Subject: | cvs: pear /MDB2_Schema/docs xml_schema_documentation.html | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42311@lists.php.net to get a copy of this message | ||
ifeghali Sat Sep 30 03:15:40 2006 UTC
Modified files:
/pear/MDB2_Schema/docs xml_schema_documentation.html
Log:
- initialization section finished. examples added.
http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/docs/xml_schema_documentation.html?r1=1.6&r2=1.7&diff_format=u Index: pear/MDB2_Schema/docs/xml_schema_documentation.html diff -u pear/MDB2_Schema/docs/xml_schema_documentation.html:1.6 pear/MDB2_Schema/docs/xml_schema_documentation.html:1.7 --- pear/MDB2_Schema/docs/xml_schema_documentation.html:1.6 Mon Sep 25 17:56:34 2006 +++ pear/MDB2_Schema/docs/xml_schema_documentation.html Sat Sep 30 03:15:40 2006 @@ -5,7 +5,7 @@ <body> <center><h1>MDB2 XML Schema documentation</h1></center> <p><b>Author:</b> Manuel Lemos (<a href="mailto:mlemos@acm.org">mlemos@acm.org</a>)</p> -<p><b>Version control:</b> <tt>@(#) $Id: xml_schema_documentation.html,v 1.6 2006/09/25 17:56:34 ifeghali Exp $</tt></p> +<p><b>Version control:</b> <tt>@(#) $Id: xml_schema_documentation.html,v 1.7 2006/09/30 03:15:40 ifeghali Exp $</tt></p> <h2>Contents</h2> <ul> @@ -284,46 +284,195 @@ <!-- INITIALIZATION --> <h3><a name="3.2.2"><tt>initialization</tt></a></h3> -<p><tt>initialization</tt> is another section that is part of the table definition. This section is optional and may contain the definition of actions that should be executed when installing the database for the first time. <tt>update</tt> and <tt>delete</tt> was added in version 0.7.0.</p> +<p><tt>initialization</tt> is another section that is part of the table definition. This section is optional and may contain the definition of actions that should be executed when installing the database for the first time. <tt>update</tt> and <tt>delete</tt> was added in Schema version 0.7.0.</p> <p>The available actions, in the execution order, are: </p> <!-- INSERT --> <h4><tt>insert</tt></h4> <p><tt>insert</tt> is a table initialization command that specifies the values of the fields of rows that should be inserted in the respective table after the database is created for the first time.</p> +<p>The <tt>insert</tt> initialization object do not have any property.</p> <h5>insert <tt>field</tt></h5> <p><tt>field</tt> is a section that is part of the table insert initialization. It should be used once per each field which should be filled with data.</p> <p>It may have only the property <tt>name</tt>.</p> -<p>One of the following objects should be used to specify the initial data:</p> - +<p>One, and only one, of the following objects should be used to specify the initial data:</p> <ul> <p><li><tt>value</tt></li></p> <p>Plain text data.</p> - <p><b>Default:</b> none</p> <p><li><tt>column</tt></li></p> <p>Take data from the specified column of the respective table.</p> - <p><b>Default:</b> none</p> <p><li><tt>function</tt></li></p> <p>Take the output of the specified <i>DBMS</i> function.</p> - <p><b>Default:</b> none</p> <p><li><tt>expression</tt></li></p> <p>Recursive structure capable of mixing all of the above objects.</p> - <p><b>Default:</b> none</p> </ul> -<p>Missing fields are implicitly initialized by the <i>DBMS</i> with the respective default values.</p> +<p>When doing an <tt>insert</tt> missing fields are implicitly initialized by the <i>DBMS</i> with the respective default values.</p> + +<h5>Example</h5> +<ul> + <p><tt><insert></tt></p> + <ul> + <p><tt><field></tt></p> + <ul> + <p><tt><name>foo</name></tt></p> + <p><tt><value>1601</value></tt></p> + </ul> + <p><tt></field></tt></p> + <p><tt><field></tt></p> + <ul> + <p><tt><name>creation</name></tt></p> + <p><tt><function></tt></p> + <ul> + <p><tt><name>NOW</name></tt></p> + </ul> + <p><tt></function></tt></p> + </ul> + <p><tt></field></tt></p> + </ul> + <p><tt></insert></tt></p> +</ul> <!-- UPDATE --> <h4><tt>update</tt></h4> <p><tt>update</tt> is a table initialization command that replaces the values of the fields of rows, matched by a condition, in the respective table after the database is created for the first time.</p> +<p>The <tt>update</tt> initialization object do not have any property.</p> + +<h5>update <tt>field</tt></h5> +<p>The update <tt>field</tt> object is defined exactly the same way as insert <tt>field</tt></p> + +<h5>update <tt>where</tt></h5> +<p>The update <tt>where</tt> object, that is not required, must contain only one <tt>expression</tt> object.</p> +<p>In that case the <tt>expression</tt> object usually links operants by logical operators like AND, OR and others.</p> + +<h5>Example</h5> +<ul> + <p><tt><update></tt></p> + <ul> + <p><tt><field></tt></p> + <ul> + <p><tt><name>id</name></tt><br/> + <tt><expression></tt></p> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>MINUS</operator></tt><br/> + <tt><value>10</value></tt></p> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></field></tt></p> + </ul> + <p><tt></update></tt></p> +</ul> <!-- DELETE --> <h4><tt>delete</tt></h4> <p><tt>delete</tt> is a table initialization command that removes rows, matched by a condition, in the respective table after the database is created for the first time.</p> -<p>The <tt>delete</tt> command definition only contains one more <tt>where</tt> section with <tt>expression</tt> that selects the rows to be deleted.</p> +<p>The <tt>delete</tt> command definition only contains one more <tt>where</tt> section used to select the rows to be deleted.</p> +<p>The <tt>delete</tt> initialization object do not have any property.</p> + +<h5>delete <tt>where</tt></h5> +<p>The delete <tt>where</tt> object must contain only one <tt>expression</tt> object.</p> +<p>In that case the <tt>expression</tt> object usually links operants by logical operators like AND, OR and others.</p> + +<h5>Example</h5> +<ul> + <p><tt><delete></tt></p> + <ul> + <p><tt><where></tt></p> + <ul> + <p><tt><expression></tt></p> + <ul> + <p><tt><expression></tt></p> + <ul> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>GREATER THAN</operator></tt><br/> + <tt><value>10</value></tt></p> + </ul> + </ul> + <p><tt></expression></tt><br/> + <tt><operator>AND</operator></tt><br/> + <tt><expression></tt></p> + <ul> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>NOT EQUAL</operator></tt><br/> + <tt><value>15</value></tt></p> + </ul> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></where></tt></p> + </ul> + <p><tt></delete></tt></p> +</ul> + +<!-- INITIALIZATION OBJECTS --> +<h4>Complex initialization objects</h4> + +<h5><tt>function</tt></h5> +<p>The <tt>function</tt> object will bind to a <i>DBMS</i> function, that can be called with any number of arguments. +<p>It may have only the property <tt>name</tt>.</p> +<p>Any of the following objects should be used, how many times it is necessary, to provide the arguments:</p> +<ul> + <p><li><tt>value</tt></li></p> + <p>Plain text data.</p> + + <p><li><tt>column</tt></li></p> + <p>Take data from the specified column of the respective table.</p> + + <p><li><tt>function</tt></li></p> + <p>Take the output of the specified <i>DBMS</i> function.</p> + + <p><li><tt>expression</tt></li></p> + <p>Recursive structure capable of mixing all of the above objects.</p> +</ul> + +<h5><tt>expression</tt></h5> +<p>The <tt>expression</tt> object is a recursive structure used to relate pairs of <tt>value</tt>, <tt>column</tt>, <tt>function</tt> and <tt>expression</tt> objects. +<p>The <tt>expression</tt> object do not have any property and has the exact form <tt>operant</tt> <tt>operator</tt> <tt>operant</tt>.</p> + +<h6>expression <tt>operant</tt></h6> +<p>The expression <tt>operant</tt> isn't a object itself but may be represented by one of the following objects: +<ul> + <p><li><tt>value</tt></li></p> + <p>Plain text data.</p> + + <p><li><tt>column</tt></li></p> + <p>Take data from the specified column of the respective table.</p> + + <p><li><tt>function</tt></li></p> + <p>You can pass a new function as an argument.</p> + + <p><li><tt>expression</tt></li></p> + <p>Expressions are recursive.</p> +</ul> + +<h6>expression <tt>operator</tt></h6> +<p>Operators aren't implemented in a portable way yet. Currently the following descriptive operators are always binded to the same operators: +<table> + <tr> + <td>Operator</td><td>Binding</td> + </tr> + <tr><td>PLUS</td><td>+</td></tr> + <tr><td>MINUS</td><td>-</td></tr> + <tr><td>TIMES</td><td>*</td></tr> + <tr><td>DIVIDED</td><td>/</td></tr> + <tr><td>EQUAL</td><td>=</td></tr> + <tr><td>NOT EQUAL</td><td>!=</td></tr> + <tr><td>LESS THAN</td><td><</td></tr> + <tr><td>GREATER THAN</td><td>></td></tr> + <tr><td>LESS THAN OR EQUAL</td><td><=</td></tr> + <tr><td>GREATER THAN OR EQUAL</td><td>>=</td></tr> +</table> +<p>Any other value given to <tt>operator</tt> will be parsed with no translation.</p> +<p>Future versions of Schema may provide a common set of descriptive operators that are translated to the respective operator for your <i>DBMS</i></p> <!-- SEQUENCE --> <h3><a name="3.3.0"><tt>sequence</tt></a></h3> @@ -511,19 +660,11 @@ </ul> <li>{expression}</li> - <p> - <ul>Some Operators example: - <li>NOT, AND, OR, XOR</li> - <li>EQUAL, LIKE, LESS THAN, GREATER THAN</li> - <li>IS NULL, BETWEEN</li> - <li>etc.</li> - </ul> - </p> <ul> <p><tt><expression></tt></p> <ul> <p><tt><value/> or <column/> or {function} or {expression}<br/> - <operator>OPERATOR</operator><br/> + <operator/><br/> <value/> or <column/> or {function} or {expression}</tt></p> </ul> <p><tt></expression></tt></p>
http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/docs/xml_schema_documentation.html?r1=1.6&r2=1.7&diff_format=u Index: pear/MDB2_Schema/docs/xml_schema_documentation.html diff -u pear/MDB2_Schema/docs/xml_schema_documentation.html:1.6 pear/MDB2_Schema/docs/xml_schema_documentation.html:1.7 --- pear/MDB2_Schema/docs/xml_schema_documentation.html:1.6 Mon Sep 25 17:56:34 2006 +++ pear/MDB2_Schema/docs/xml_schema_documentation.html Sat Sep 30 03:15:40 2006 @@ -5,7 +5,7 @@ <body> <center><h1>MDB2 XML Schema documentation</h1></center> <p><b>Author:</b> Manuel Lemos (<a href="mailto:mlemos@acm.org">mlemos@acm.org</a>)</p> -<p><b>Version control:</b> <tt>@(#) $Id: xml_schema_documentation.html,v 1.6 2006/09/25 17:56:34 ifeghali Exp $</tt></p> +<p><b>Version control:</b> <tt>@(#) $Id: xml_schema_documentation.html,v 1.7 2006/09/30 03:15:40 ifeghali Exp $</tt></p> <h2>Contents</h2> <ul> @@ -284,46 +284,195 @@ <!-- INITIALIZATION --> <h3><a name="3.2.2"><tt>initialization</tt></a></h3> -<p><tt>initialization</tt> is another section that is part of the table definition. This section is optional and may contain the definition of actions that should be executed when installing the database for the first time. <tt>update</tt> and <tt>delete</tt> was added in version 0.7.0.</p> +<p><tt>initialization</tt> is another section that is part of the table definition. This section is optional and may contain the definition of actions that should be executed when installing the database for the first time. <tt>update</tt> and <tt>delete</tt> was added in Schema version 0.7.0.</p> <p>The available actions, in the execution order, are: </p> <!-- INSERT --> <h4><tt>insert</tt></h4> <p><tt>insert</tt> is a table initialization command that specifies the values of the fields of rows that should be inserted in the respective table after the database is created for the first time.</p> +<p>The <tt>insert</tt> initialization object do not have any property.</p> <h5>insert <tt>field</tt></h5> <p><tt>field</tt> is a section that is part of the table insert initialization. It should be used once per each field which should be filled with data.</p> <p>It may have only the property <tt>name</tt>.</p> -<p>One of the following objects should be used to specify the initial data:</p> - +<p>One, and only one, of the following objects should be used to specify the initial data:</p> <ul> <p><li><tt>value</tt></li></p> <p>Plain text data.</p> - <p><b>Default:</b> none</p> <p><li><tt>column</tt></li></p> <p>Take data from the specified column of the respective table.</p> - <p><b>Default:</b> none</p> <p><li><tt>function</tt></li></p> <p>Take the output of the specified <i>DBMS</i> function.</p> - <p><b>Default:</b> none</p> <p><li><tt>expression</tt></li></p> <p>Recursive structure capable of mixing all of the above objects.</p> - <p><b>Default:</b> none</p> </ul> -<p>Missing fields are implicitly initialized by the <i>DBMS</i> with the respective default values.</p> +<p>When doing an <tt>insert</tt> missing fields are implicitly initialized by the <i>DBMS</i> with the respective default values.</p> + +<h5>Example</h5> +<ul> + <p><tt><insert></tt></p> + <ul> + <p><tt><field></tt></p> + <ul> + <p><tt><name>foo</name></tt></p> + <p><tt><value>1601</value></tt></p> + </ul> + <p><tt></field></tt></p> + <p><tt><field></tt></p> + <ul> + <p><tt><name>creation</name></tt></p> + <p><tt><function></tt></p> + <ul> + <p><tt><name>NOW</name></tt></p> + </ul> + <p><tt></function></tt></p> + </ul> + <p><tt></field></tt></p> + </ul> + <p><tt></insert></tt></p> +</ul> <!-- UPDATE --> <h4><tt>update</tt></h4> <p><tt>update</tt> is a table initialization command that replaces the values of the fields of rows, matched by a condition, in the respective table after the database is created for the first time.</p> +<p>The <tt>update</tt> initialization object do not have any property.</p> + +<h5>update <tt>field</tt></h5> +<p>The update <tt>field</tt> object is defined exactly the same way as insert <tt>field</tt></p> + +<h5>update <tt>where</tt></h5> +<p>The update <tt>where</tt> object, that is not required, must contain only one <tt>expression</tt> object.</p> +<p>In that case the <tt>expression</tt> object usually links operants by logical operators like AND, OR and others.</p> + +<h5>Example</h5> +<ul> + <p><tt><update></tt></p> + <ul> + <p><tt><field></tt></p> + <ul> + <p><tt><name>id</name></tt><br/> + <tt><expression></tt></p> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>MINUS</operator></tt><br/> + <tt><value>10</value></tt></p> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></field></tt></p> + </ul> + <p><tt></update></tt></p> +</ul> <!-- DELETE --> <h4><tt>delete</tt></h4> <p><tt>delete</tt> is a table initialization command that removes rows, matched by a condition, in the respective table after the database is created for the first time.</p> -<p>The <tt>delete</tt> command definition only contains one more <tt>where</tt> section with <tt>expression</tt> that selects the rows to be deleted.</p> +<p>The <tt>delete</tt> command definition only contains one more <tt>where</tt> section used to select the rows to be deleted.</p> +<p>The <tt>delete</tt> initialization object do not have any property.</p> + +<h5>delete <tt>where</tt></h5> +<p>The delete <tt>where</tt> object must contain only one <tt>expression</tt> object.</p> +<p>In that case the <tt>expression</tt> object usually links operants by logical operators like AND, OR and others.</p> + +<h5>Example</h5> +<ul> + <p><tt><delete></tt></p> + <ul> + <p><tt><where></tt></p> + <ul> + <p><tt><expression></tt></p> + <ul> + <p><tt><expression></tt></p> + <ul> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>GREATER THAN</operator></tt><br/> + <tt><value>10</value></tt></p> + </ul> + </ul> + <p><tt></expression></tt><br/> + <tt><operator>AND</operator></tt><br/> + <tt><expression></tt></p> + <ul> + <ul> + <p><tt><column>id</column></tt><br/> + <tt><operator>NOT EQUAL</operator></tt><br/> + <tt><value>15</value></tt></p> + </ul> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></expression></tt></p> + </ul> + <p><tt></where></tt></p> + </ul> + <p><tt></delete></tt></p> +</ul> + +<!-- INITIALIZATION OBJECTS --> +<h4>Complex initialization objects</h4> + +<h5><tt>function</tt></h5> +<p>The <tt>function</tt> object will bind to a <i>DBMS</i> function, that can be called with any number of arguments. +<p>It may have only the property <tt>name</tt>.</p> +<p>Any of the following objects should be used, how many times it is necessary, to provide the arguments:</p> +<ul> + <p><li><tt>value</tt></li></p> + <p>Plain text data.</p> + + <p><li><tt>column</tt></li></p> + <p>Take data from the specified column of the respective table.</p> + + <p><li><tt>function</tt></li></p> + <p>Take the output of the specified <i>DBMS</i> function.</p> + + <p><li><tt>expression</tt></li></p> + <p>Recursive structure capable of mixing all of the above objects.</p> +</ul> + +<h5><tt>expression</tt></h5> +<p>The <tt>expression</tt> object is a recursive structure used to relate pairs of <tt>value</tt>, <tt>column</tt>, <tt>function</tt> and <tt>expression</tt> objects. +<p>The <tt>expression</tt> object do not have any property and has the exact form <tt>operant</tt> <tt>operator</tt> <tt>operant</tt>.</p> + +<h6>expression <tt>operant</tt></h6> +<p>The expression <tt>operant</tt> isn't a object itself but may be represented by one of the following objects: +<ul> + <p><li><tt>value</tt></li></p> + <p>Plain text data.</p> + + <p><li><tt>column</tt></li></p> + <p>Take data from the specified column of the respective table.</p> + + <p><li><tt>function</tt></li></p> + <p>You can pass a new function as an argument.</p> + + <p><li><tt>expression</tt></li></p> + <p>Expressions are recursive.</p> +</ul> + +<h6>expression <tt>operator</tt></h6> +<p>Operators aren't implemented in a portable way yet. Currently the following descriptive operators are always binded to the same operators: +<table> + <tr> + <td>Operator</td><td>Binding</td> + </tr> + <tr><td>PLUS</td><td>+</td></tr> + <tr><td>MINUS</td><td>-</td></tr> + <tr><td>TIMES</td><td>*</td></tr> + <tr><td>DIVIDED</td><td>/</td></tr> + <tr><td>EQUAL</td><td>=</td></tr> + <tr><td>NOT EQUAL</td><td>!=</td></tr> + <tr><td>LESS THAN</td><td><</td></tr> + <tr><td>GREATER THAN</td><td>></td></tr> + <tr><td>LESS THAN OR EQUAL</td><td><=</td></tr> + <tr><td>GREATER THAN OR EQUAL</td><td>>=</td></tr> +</table> +<p>Any other value given to <tt>operator</tt> will be parsed with no translation.</p> +<p>Future versions of Schema may provide a common set of descriptive operators that are translated to the respective operator for your <i>DBMS</i></p> <!-- SEQUENCE --> <h3><a name="3.3.0"><tt>sequence</tt></a></h3> @@ -511,19 +660,11 @@ </ul> <li>{expression}</li> - <p> - <ul>Some Operators example: - <li>NOT, AND, OR, XOR</li> - <li>EQUAL, LIKE, LESS THAN, GREATER THAN</li> - <li>IS NULL, BETWEEN</li> - <li>etc.</li> - </ul> - </p> <ul> <p><tt><expression></tt></p> <ul> <p><tt><value/> or <column/> or {function} or {expression}<br/> - <operator>OPERATOR</operator><br/> + <operator/><br/> <value/> or <column/> or {function} or {expression}</tt></p> </ul> <p><tt></expression></tt></p>