Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

alzabo::faq(3pm) [debian man page]

Alzabo::FAQ(3pm)					User Contributed Perl Documentation					  Alzabo::FAQ(3pm)

NAME
Alzabo::FAQ - Frequently Asked Questions How can I generate the SQL to turn one schema into another? Assuming you have schema objects representing these already created (through reverse engineering for example) and both schemas are for the same RDBMS, you can simply do this: my @sql = $schema1->rules->schema_diff( old => $schema1, new => $schema2 ); The @sql array will contain all the SQL statements necessary to transform the schema in $schema1 into the schema in $schema2. If you want to sync a schema object to the current state of the RDBMS backend's schema, check out the "Alzabo::Create::Schema->sync_back- end" method. How can I make a local copy of the documentation as HTML? Alzabo comes with a script called "make_html_docs.pl". It takes three arguments. The first is the source file directory root. The second is the target directory. The last is the absolute URL path that this target directory represents. If you have perl 5.6.0 or greated installed, it is recommended that you use it to run this script as the Pod::Html module included with more recent Perls does a much better job of making HTML. If you were in the root of the source directory you might run this as: perl ./make_html_docs.pl ./lib /usr/local/apache/htdocs/Alzabo_docs /Alzabo_docs The script will create an index.html file as well as turning the documentation into HTML. How can I optimize memory usage under mod_perl? You should simply preload the Alzabo::Runtime module (which loads all the other modules it needs). In addition, if you are using Alzabo::MethodMaker, make sure it runs in the parent. This module can create a lot of methods on the fly and each method eats up some memory. Finally, you can preload one or more schema objects. The easiest way to do this is to simply pass its name to Alzabo::Runtime when you use it, like this: use Alzabo::Runtime qw( schema1 schema2 ); How can I get objects for tables linked via the Mason GUI? For example, if I have a websites2categories table which maps a list of categories that a given web site should display -- and uses website_id and category_id in a 1..n relationship -- what is the proper way to set that up in the GUI and then in my code? In the GUI, you can simply create a relationship from websites to categories, and declare it n..n. Alzabo will automatically create a ta- ble called websites_categories, and you're free to change the name to whatever you want. Then if you use "Alzabo::MethodMaker", Alzabo will see that you have a table with 2 cols, both of which are part of the PK, and that it has 1..n relationships with 2 other tables, and it will create the appropriate methods. You can see what methods are being created by setting the "ALZABO_DEBUG" environment variable to "METHODMAKER" before loading Alz- abo::MethodMaker. It'll spit everything out to STDERR. There's also the generated documentation, which is available via the "docs_as_pod()" schema method after MethodMaker does its thing. AUTHOR
Dave Rolsky, <autarch@urth.org> perl v5.8.8 2007-12-23 Alzabo::FAQ(3pm)

Check Out this Related Man Page

Alzabo(3pm)						User Contributed Perl Documentation					       Alzabo(3pm)

NAME
Alzabo - A data modelling tool and RDBMS-OO mapper SYNOPSIS
Cannot be summarized here. DESCRIPTION
What is Alzabo? Alzabo is a suite of modules with two core functions. Its first use is as a data modelling tool. Through either a schema creation GUI, a perl program, or reverse engineering, you can create a set objects to represent a schema. Its second function is as an RDBMS to object mapping system. Once you have created a schema, you can use the "Alzabo::Runtime::Table" and "Alzabo::Runtime::Row" classes to access its data. These classes offer a high level interface to common operations such as SQL "SELECT", "INSERT", "DELETE", and "UPDATE" commands. Because you can manipulate construct queries through object-oriented Perl, creating complex queries on the fly is much easier than it would be if you had to dynamically construct strings of SQL. A higher level interface can be created through the use of the "Alzabo::MethodMaker" module. This module takes a schema object and auto- generates useful methods based on the tables, columns, and relationships it finds in the module. The code is generates can be integrated with your own code quite easily. To take it a step further, you could then aggregate a set of rows from different tables into a larger container object which could under- stand the logical relationship between these tables. What to Read? Alzabo has a lot of documentation. If you are primarily interested in using Alzabo as an RDBMS-OO wrapper, much of the documentation can be skipped. This assumes that you will create your schema via a schema creation GUI or via reverse engineering. Here is the suggested reading order: Introduction to Alzabo The RDBMS-specific documentation: Alzabo and MySQL Alzabo and PostgreSQL The Alzabo::Runtime::Schema docs - The most important parts here are those related to loading a schema and connecting to a database. Also be sure to read about the "join()" method. The Alzabo::Runtime::Table docs - This contains most of the methods used to fetch rows from the database, as well as the "insert()" method. The Alzabo::Runtime::Row docs - The row objects contain the methods used to update, delete, and retrieve data from the database. The Alzabo::Runtime::RowCursor docs - A cursor object that returns only a single row. The Alzabo::Runtime::JoinCursor docs - A cursor object that returns multiple rows at once. The Alzabo::MethodMaker docs - One of the most useful parts of Alzabo. This module can be used to auto-generate methods based on the structure of your schema. The Alzabo::Runtime::UniqueRowCache docs - This describes the simple caching system included with Alzabo. The Alzabo::Debug docs - How to turn on various kinds of debugging output. The Alzabo::Exceptions docs - Describes the nature of all the exceptions used in Alzabo. The FAQ. The quick reference - A quick reference for the various methods of the Alzabo objects. SCRIPTS
Alzabo comes with a few handy scripts in the eg/ directory of the distribution. These are: * alzabo_grep Given a regex and a schema name, this script will print out the table and column name for all columns which match the regex. * alzabo_to_ascii Given a schema name, this script will generate a set of simple ASCII tables for the schema. SUPPORT
The Alzabo docs are conveniently located online at http://www.alzabo.org/docs/. There is also a mailing list. You can sign up at http://lists.sourceforge.net/lists/listinfo/alzabo-general. Please don't email me directly. Use the list instead so others can see your questions. COPYRIGHT
Copyright (c) 2000-2003 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. AUTHOR
Dave Rolsky, <autarch@urth.org> perl v5.8.8 2007-12-23 Alzabo(3pm)
Man Page