1 package SQL::Translator::Producer::YAML;
3 # -------------------------------------------------------------------
4 # $Id: YAML.pm,v 1.2 2003-10-08 17:27:40 dlc Exp $
5 # -------------------------------------------------------------------
6 # Copyright (C) 2003 darren chamberlain <darren@cpan.org>,
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # -------------------------------------------------------------------
24 use vars qw($VERSION);
25 $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/;
30 my $translator = shift;
31 my $schema = $translator->schema;
35 map { ($_->name => view_table($_)) } $schema->get_tables
42 my $name = $table->name;
45 map { ($_->name => view_field($_)) } $table->get_fields
53 'order' => scalar $field->order,
54 'name' => scalar $field->name,
55 'type' => scalar $field->data_type,
56 'size' => [ $field->size ],
57 'extra' => { $field->extra },
65 SQL::Translator::Producer::YAML - A YAML producer for SQL::Translator