richter 01/08/15 12:23:04 Modified: embperl CVS.pod.1.html Changes.pod.1.html Embperl.pod.17.html Recordset.pod.2.html Recordset.pod.7.html Recordset.pod.cont.html Log: Embperl Webpages - Changes Revision Changes Path 1.22 +1 -1 modperl-site/embperl/CVS.pod.1.html Index: CVS.pod.1.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/CVS.pod.1.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- CVS.pod.1.html 2001/07/18 10:30:38 1.21 +++ CVS.pod.1.html 2001/08/15 19:23:04 1.22 @@ -126,7 +126,7 @@ <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="web_access">web-access</A></H2> <P> You may browse the the <EM>Embperl</EM> CVS via <A -HREF="http://www.apache.org/websrc/cvsweb.cgi/embperl/">http://www.apache.org/websrc/cvsweb.cgi/embperl/</A> +HREF="http://cvs.apache.org/viewcvs.cgi/embperl/">http://cvs.apache.org/viewcvs.cgi/embperl/</A> <P> 1.223 +1 -1 modperl-site/embperl/Changes.pod.1.html Index: Changes.pod.1.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/Changes.pod.1.html,v retrieving revision 1.222 retrieving revision 1.223 diff -u -r1.222 -r1.223 --- Changes.pod.1.html 2001/08/15 19:21:34 1.222 +++ Changes.pod.1.html 2001/08/15 19:23:04 1.223 @@ -21,7 +21,7 @@ [<a href="" >HOME</a>] [<a href="Changes.pod.cont.html">CONTENT</a>] [<a href="Changes.pod.cont.html">PREV (Revision History - Content)</a>] [<a href="Changes.pod.2.html">NEXT (1.3.3 (RELEASE) 6. Juni 2001)</a>] <br><hr> <P> -Last Update: Wed Aug 15 21:24:56 2001 (MET) +Last Update: Wed Aug 15 21:26:34 2001 (MET) <P> NOTE: This version is only available via <A HREF="CVS.pod.1.html#INTRO" >"CVS"</A> 1.7 +8 -0 modperl-site/embperl/Embperl.pod.17.html Index: Embperl.pod.17.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/Embperl.pod.17.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Embperl.pod.17.html 2001/02/12 09:18:45 1.6 +++ Embperl.pod.17.html 2001/08/15 19:23:04 1.7 @@ -51,6 +51,14 @@ <HR> <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="VIM">VIM</A></H2> <P> +Vim Syntaxfile for Vim 5.x & 6.x from Lukas Zapletal with syntax +highliting for JavaScript, VBScript, Perl+Embperl, CSS and HTML, yellow +background for Perl`s code (like M$ Interdev) and working Perl folding can +be found at <A +HREF="http://vim.sourceforge.net/scripts/search_results.php?keywords=Embperl">http://vim.sourceforge.net/scripts/search_results.php?keywords=Embperl</A> + + +<P> Vim Syntaxfile from Steve Willer can be found at <A HREF="http://www.interlog.com/~willer/embperl.vim">http://www.interlog.com/~willer/embperl.vim</A> 1.3 +3 -1 modperl-site/embperl/Recordset.pod.2.html Index: Recordset.pod.2.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/Recordset.pod.2.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Recordset.pod.2.html 2001/05/16 06:03:44 1.2 +++ Recordset.pod.2.html 2001/08/15 19:23:04 1.3 @@ -56,7 +56,9 @@ Takes the same database handle as the given DBIx::Recordset object. <br> <DT><STRONG><A NAME="DBIx">DBIx::Database object</A></STRONG><DD> -Takes Driver/DB/Host from the given database object. +Takes Driver/DB/Host from the given database object. See <A HREF="/DBIx/Database.html">DBIx::Database</A> +for details about DBIx::Database object. When using more then one Recordset +object, this is the most efficient method. <br> <DT><STRONG><A NAME="DBIx">DBIx::Datasbase object name</A></STRONG><DD> Takes Driver/DB/Host from the database object which is saved under the 1.2 +198 -2 modperl-site/embperl/Recordset.pod.7.html Index: Recordset.pod.7.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/Recordset.pod.7.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Recordset.pod.7.html 2001/02/12 09:21:25 1.1 +++ Recordset.pod.7.html 2001/08/15 19:23:04 1.2 @@ -30,6 +30,9 @@ <LI><A href="Recordset.pod.7.html#_db_AllTables">$db -> AllTables</A> <LI><A href="Recordset.pod.7.html#_db_AllNames_table_">$db -> AllNames ($table)</A> <LI><A href="Recordset.pod.7.html#_db_AllTypes_table_">$db -> AllTypes ($table)</A> + <LI><A href="Recordset.pod.7.html#_db_CreateTables_dbschema_">$db -> CreateTables ($dbschema, $schemaname, $user, $setpriv, $alterconstraints)</A> + <LI><A href="Recordset.pod.7.html#Schema_definition">Schema definition</A> + <LI><A href="Recordset.pod.7.html#_db_DropTables_schemaname_">$db -> DropTables ($schemaname, $user) </A> </UL> <hr> <P> @@ -41,6 +44,20 @@ be retreived automatically. <P> +Example: + +<P> +<PRE> $db = DBIx::Database -> new ({'!DataSource' => $DSN, + '!Username' => $User, + '!Password' => $Password, + '!KeepOpen' => 1}) ; +</PRE> +<P> +<PRE> *set = DBIx::Recordset -> Search ({'!DataSource' => $db, + '!Table' => 'foo', + }) ; +</PRE> +<P> <HR> <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="new_data_source_username_p">new ($data_source, $username, $password, \%attr, $saveas, $keepopen)</A></H2> <DL> @@ -75,8 +92,8 @@ Normaly the database connection will be closed after the metadata has been retrieved from the database. This makes sure you don't get trouble when using the new method in a mod_perl startup file. You can keep the -connection open to use them in further setup call to DBIx::Recordset -objects. +connection open to use them in further setup calls to DBIx::Recordset +objects. When the database is not kept open, you must specify the <CODE>!Password</CODE> parameter each time the recordset has to be reopend. <br> <DT><STRONG><A NAME="_tabfilter">$tabfilter</A></STRONG><DD> same as setup parameter !TableFilter @@ -195,6 +212,185 @@ <DT><STRONG><A NAME="_db">$db -> do ($statement, $attribs, \%params)</A></STRONG><DD> Same as DBI. Executes a single SQL statement on the open database. +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="_db_CreateTables_dbschema_">$db -> CreateTables ($dbschema, $schemaname, $user, $setpriv, $alterconstraints)</A></H2> +<P> +The CreateTables method is used to create an modify the schema of your +database. The idea is to define the schema as a Perl data structure and +give it to this function, it will compare the actual schema of the database +with the one provided and creates new tables, new fields or drop fields as +neccessary. It also sets the permission on the tables and is able to create +indices for the tables. It will <STRONG>never</STRONG> drop a whole table! NOTE: Create tables cannot deteminate changes of the +datatype of a fields, because DBI is not able to provide this information +in a standart way. + +<DL> +<DT><STRONG><A NAME="_dbschema">$dbschema</A></STRONG><DD> +Either the name of a file which contains the schema or a array ref. See +below how this schema must look like. + +<br> <DT><STRONG><A NAME="_schemaname">$schemaname</A></STRONG><DD> +schemaname (only used for Oracle) + +<br> <DT><STRONG><A NAME="_user">$user</A></STRONG><DD> +User that should be granted access. See <CODE>!Grant</CODE> parameter. + +<br> <DT><STRONG><A NAME="_setpriv">$setpriv</A></STRONG><DD> +If set to true, access privilegs are revoked and granted again for already +existing tables. That is necessary when <CODE>$user</CODE> changes. + +<br> <DT><STRONG><A NAME="_alterconstraints">$alterconstraints</A></STRONG><DD> +If set to true contrains are cleared/set for already existing fields. DBI +doesn't provide a database independ way to check which contrains already +exists. + +</DL> +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Schema_definition">Schema definition</A></H2> +<P> +If give as a filename, the file must contain an hash <CODE>%DBDefault</CODE> and an array <CODE>@DBSchema</CODE>. The first gives default and the second is an array of hashs. Every of +this hash defines one table. + +<P> +Example: + +<P> +<PRE> %DBDefault = +</PRE> +<P> +<PRE> ( + '!Grant' => + [ + 'select', + 'insert', + 'update', + 'delete', + ], + ) + ; +</PRE> +<P> +<PRE> @DBSchema = ( +</PRE> +<P> +<PRE> { + '!Table' => 'language', + '!Fields' => + [ + 'id' => 'char (2)', + 'directory' => 'varchar(40)', + 'name' => 'varchar(40)', + 'europe' => 'bool', + ], + '!PrimKey' => 'id', + '!Default' => + { + 'europe' => 1, + }, + '!Init' => + [ + {'id' => 'de', 'directory' => 'html_49', 'name' => 'deutsch'}, + {'id' => 'en', 'directory' => 'html_76', 'name' => 'english'}, + {'id' => 'fr', 'directory' => 'html_31', 'name' => 'french'}, + ], + '!Index' => + [ + 'directory' => '', + ] + + }, +</PRE> +<P> +<PRE> ); +</PRE> +<P> +The hash which defines a table can have the following keys: + +<DL> +<DT><STRONG><A NAME="_Table">!Table</A></STRONG><DD> +Gives the table name + +<br> <DT><STRONG><A NAME="_Fields">!Fields</A></STRONG><DD> +Array with field names and types. There a some types which a translated +database specifc. You can define more database specific translation in +Compat.pm. + +<DL> +<DT><STRONG><A NAME="bit">bit</A></STRONG><DD> +boolean + +<br> <DT><STRONG><A NAME="counter">counter</A></STRONG><DD> +If an autoincrementing integer. For databases (like Oracle) that doesn't +have such a datatype a sequence is generated to provide the autoincrement +value and the fields will be of type integer. + +<br> <DT><STRONG><A NAME="tinytext">tinytext</A></STRONG><DD> +variables length text with up to 255 characters + +<br> <DT><STRONG><A NAME="text">text</A></STRONG><DD> +variables length text + +</DL> +<br> <DT><STRONG><A NAME="_PrimKey">!PrimKey</A></STRONG><DD> +Name of the primary key + +<br> <DT><STRONG><A NAME="_For">!For</A></STRONG><DD> +Can contain the same key as the table definintion, but is only executed for +a specifc database. + +<P> +Example: + +<P> +<PRE> '!For' => { + 'Oracle' => { + '!Constraints' => + { + 'web_id' => ['foreign key' => 'REFERENCES web (id)'], +</PRE> +<P> +<PRE> 'prim__menu_id' => ['!Name' => 'web_prim_menu_id', + 'foreign key' => 'REFERENCES menu (id)', + 'not null' => ''], + } + }, + }, +</PRE> +<br> <DT><STRONG><A NAME="_Contraints">!Contraints</A></STRONG><DD> +Used to define contraints. See example under <CODE>!For</CODE>. + +<DL> +<DT><STRONG><A NAME="_Name">!Name => <name></A></STRONG><DD> +<DT><STRONG><A NAME="_constraint_"><constraint> => <second part></A></STRONG><DD> +</DL> +<DT><STRONG><A NAME="_Init">!Init</A></STRONG><DD> +Used to initialy populate the table. + +<br> <DT><STRONG><A NAME="_Default">!Default</A></STRONG><DD> +Used to set a default value for a field, when the table is created. This +doesn't have any affect for further INSERTs/UPDATEs. + +<br> <DT><STRONG><A NAME="_Grant">!Grant</A></STRONG><DD> +Give the rights that should be grant to <CODE>$user</CODE> + + + +<br> <DT><STRONG><A NAME="_Index">!Index</A></STRONG><DD> +Gives the names for the fields for which indices should be created. If the +second parameter for an index is not empty, it gives the index name, +otherwise a default name is used. + +</DL> +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="_db_DropTables_schemaname_">$db -> DropTables ($schemaname, $user)</A></H2> +<P> +Drops <STRONG>all</STRONG> tables. Use with care! + +<DL> +<DT><STRONG>$schemaname</STRONG><DD> +schemaname (only used for Oracle) + +<br> <DT><STRONG>$user</STRONG><DD> +User that should be revoked access. See <CODE>!Grant</CODE> parameter. + +</DL> </DL> <p>[<a href="" >HOME</a>] [<a href="Recordset.pod.cont.html">CONTENT</a>] [<a href="Recordset.pod.6.html">PREV (WORKING WITH MULTIPLE TABLES)</a>] [<a href="Recordset.pod.8.html">NEXT (Casesensitive/insensitiv)</a>] <br> <font color="#808080">___________________________________________________________________________________<br> 1.2 +3 -0 modperl-site/embperl/Recordset.pod.cont.html Index: Recordset.pod.cont.html =================================================================== RCS file: /home/cvs/modperl-site/embperl/Recordset.pod.cont.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Recordset.pod.cont.html 2001/02/12 09:21:25 1.1 +++ Recordset.pod.cont.html 2001/08/15 19:23:04 1.2 @@ -67,6 +67,9 @@ <LI><A href="Recordset.pod.7.html#_db_AllTables">$db -> AllTables</A> <LI><A href="Recordset.pod.7.html#_db_AllNames_table_">$db -> AllNames ($table)</A> <LI><A href="Recordset.pod.7.html#_db_AllTypes_table_">$db -> AllTypes ($table)</A> + <LI><A href="Recordset.pod.7.html#_db_CreateTables_dbschema_">$db -> CreateTables ($dbschema, $schemaname, $user, $setpriv, $alterconstraints)</A> + <LI><A href="Recordset.pod.7.html#Schema_definition">Schema definition</A> + <LI><A href="Recordset.pod.7.html#_db_DropTables_schemaname_">$db -> DropTables ($schemaname, $user) </A> </UL> <LI><A href="Recordset.pod.8.html#Casesensitive_insensitiv">Casesensitive/insensitiv</A>