# HG changeset patch # User heiko # Date 1216625816 0 # Node ID 67f2083ea02d1dd68ff9acb4d73b6067053b4b9d # Parent 32d0a049fa94d8d8960a1a38c3b10704dcfabd91 - comment reformatted diff -r 32d0a049fa94 -r 67f2083ea02d mail2db --- a/mail2db Mon Jul 21 07:34:30 2008 +0000 +++ b/mail2db Mon Jul 21 07:36:56 2008 +0000 @@ -237,19 +237,19 @@ =item B<--dsn> -The data source name. Something like "DBI:mysql:mail:hostname=schnuffi". [default: ""] +The data source name. Something like "DBI:mysql:mail:hostname=schnuffi". (default: "") =item B<--dbuser> =item B<--dbpass> -The credentials to access the database. [default: ""] +The credentials to access the database. (default: "") =item B<-n>|B<--dry> Do not modify the database, just start a transaction but do not commit it. (This feature needs a database with transactions (as MySQL 5.x with InnoDB tables -is). [default: off] +is). (default: off) =item B<-h>|B<--help> @@ -264,30 +264,30 @@ Beside having transactions and real support for foreign keys, the database has the following layout: - header_field - ------------------- - id: int, unique, autoincrement - name: char(255) + header_field + ------------------- + id: int, unique, autoincrement + name: char(255) - message_header - ------------------- - message_id: int, foreign key message.id - header_field_id: int, foreign key header_field.id - idx: int -- position in unfolded header fields - content: text + message_header + ------------------- + message_id: int, foreign key message.id + header_field_id: int, foreign key header_field.id + idx: int -- position in unfolded header fields + content: text - message - ------------------ - id: int, unique, autoincrement - timestamp: timestamp -- date of insertion - content: text -- complete message (incl. all headers) + message + ------------------ + id: int, unique, autoincrement + timestamp: timestamp -- date of insertion + content: text -- complete message (incl. all headers) - VIEW header - ------------------ - message_id: int, foreign key message.id - name: char(255) - idx: int - content: text + VIEW header + ------------------ + message_id: int, foreign key message.id + name: char(255) + idx: int + content: text All foreign key constraints use "ON DELETE CASCADE" to remove unwanted stuff automagically. @@ -295,13 +295,13 @@ If you want to see the message headers in a nice form, you may use the view above or just use the following statement: - SELECT message_header.message_id, - header_field.name, - message_header.idx, - message_header.content - FROM message_header - JOIN header_field ON header_field.id = message_header.header_field_id - ORDER BY message_header.message_id, header_field.name, message_header.idx; + SELECT message_header.message_id, + header_field.name, + message_header.idx, + message_header.content + FROM message_header + JOIN header_field ON header_field.id = message_header.header_field_id + ORDER BY message_header.message_id, header_field.name, message_header.idx; =head1 FILES