.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SQL::Translator::Parser::XML::SQLFairy 3pm" .TH SQL::Translator::Parser::XML::SQLFairy 3pm 2024-01-20 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME SQL::Translator::Parser::XML::SQLFairy \- parser for SQL::Translator's XML. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use SQL::Translator; \& \& my $translator = SQL::Translator\->new( show_warnings => 1 ); \& \& my $out = $obj\->translate( \& from => \*(AqXML\-SQLFairy\*(Aq, \& to => \*(AqMySQL\*(Aq, \& filename => \*(Aqschema.xml\*(Aq, \& ) or die $translator\->error; \& \& print $out; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This parser handles the flavor of XML used natively by the SQLFairy project (SQL::Translator). The XML must be in the XML namespace \&\f(CW\*(C`http://sqlfairy.sourceforge.net/sqlfairy.xml\*(C'\fR. See SQL::Translator::Producer::XML::SQLFairy for details of this format. .PP You do not need to specify every attribute of the Schema objects as any missing from the XML will be set to their default values. e.g. A field could be written using only; .PP .Vb 1 \& .Ve .PP Instead of the full; .PP .Vb 4 \& \& \& .Ve .PP If you do not explicitly set the order of items using order attributes on the tags then the order the tags appear in the XML will be used. .SS default_value .IX Subsection "default_value" Leave the attribute out all together to use the default in SQL::Translator::Schema::Field. Use empty quotes or 'EMPTY_STRING' for a zero length string. 'NULL' for an explicit null (currently sets default_value to undef in the field object). .PP .Vb 3 \& \& \& .Ve .SS ARGS .IX Subsection "ARGS" Doesn't take any extra parser args at the moment. .SH "LEGACY FORMAT" .IX Header "LEGACY FORMAT" The previous version of the SQLFairy XML allowed the attributes of the schema objects to be written as either xml attributes or as data elements, in any combination. While this allows for lots of flexibility in writing the XML the result is a great many possible XML formats, not so good for DTD writing, XPathing etc! So we have moved to a fixed version described in SQL::Translator::Producer::XML::SQLFairy. .PP This version of the parser will still parse the old formats and emit warnings when it sees them being used but they should be considered \fBheavily depreciated\fR. .PP To convert your old format files simply pass them through the translator :) .PP .Vb 1 \& $ sqlt \-f XML\-SQLFairy \-t XML\-SQLFairy schema\-old.xml > schema\-new.xml .Ve .SH BUGS .IX Header "BUGS" Ignores the order attribute for Constraints, Views, Indices, Views, Triggers and Procedures, using the tag order instead. (This is the order output by the SQLFairy XML producer). .SH "SEE ALSO" .IX Header "SEE ALSO" perl, SQL::Translator, SQL::Translator::Producer::XML::SQLFairy, SQL::Translator::Schema. .SH TODO .IX Header "TODO" .IP \(bu 4 Support options attribute. .IP \(bu 4 Test foreign keys are parsed ok. .IP \(bu 4 Control over defaulting. .SH AUTHOR .IX Header "AUTHOR" Mark D. Addison , Jonathan Yu