- APPENDIX 1: CUT AND PASTE FOR POD-BASED EXAMPLES
- APPENDIX 2: USING MYSQL AND POSTGRESQL
Catalyst::Manual::Tutorial::Appendices - Catalyst Tutorial - Part 9: Appendices
This is Part 9 of 9 of the Catalyst tutorial.
This part of the tutorial provides supporting information relevant to the Catalyst tutorial.
You may notice that Pod indents example code with four spaces. This section provides some quick advice to "un-indent" this text in common editors.
When cutting and pasting multi-line text from Pod-based documents, the following vi/vim regexs can be helpful to "un-indent" the inserted text (do NOT type the quotes, they are only included to show spaces in the regex patterns). Note that all 3 of the regexs end in 4 spaces:
Removes four leading spaces from the entire file (from the first line,
0, to the last line,
Removes the first four spaces from the line the cursor is on at the time the regex command is executed (".") to the last line of the file.
Removes four leading space from the current line through line 44 (obviously adjust the
44to the appropriate value in your example).
The main database used in this tutorial is the very simple yet powerful SQLite. This section provides information that can be used to "convert" the tutorial to use MySQL and PostgreSQL. However, note that part of the beauty of the MVC architecture is that very little database-specific code is spread throughout the system (at least when MVC is "done right"). Consequently, converting from one database to another is relatively painless with most Catalyst applications. In general, you just need to adapt the schema definition
.sql file you use to initialize your database and adjust a few configuration parameters.
Also note that the purpose of the data definition statements for this section are not designed to take maximum advantage of the various features in each database for issues such as referential integrity and field types/constraints.