.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Parse::Dia::SQL::Utils 3pm" .TH Parse::Dia::SQL::Utils 3pm "2018-01-01" "perl v5.26.1" "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" Parse::Dia::SQL::Utils \- Helper class for Parse::Dia::SQL. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& Not to be used directly. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Utility functions for Parse::Dia::SQL. .SS "set_default_pk" .IX Subsection "set_default_pk" Define primary key column names and types for automatic generation of primary keys in tables that need them, but do not have them defined. .SS "new" .IX Subsection "new" The constructor. No arguments. .SS "new" .IX Subsection "new" .SS "get_node_attribute_values" .IX Subsection "get_node_attribute_values" Given a node with dia:attribute nodes inside it, go through the dia:attribute nodes with attribute \*(L"name='...'\*(R" and return the string values .PP \&\f(CW@infosToGet\fR is an array of strings, where the first character is the data type to get, and the remaining characters are the name to parse for. first character legal values are: .PP .Vb 3 \& a = alpha \& 9 = numeric \& b = boolean .Ve .PP example: aname, 9dollars, bkillOrNot .SS "get_string_from_node" .IX Subsection "get_string_from_node" If it looks like value then we will get the 'value' part out given the node is 'thingy'. .SS "get_value_from_object" .IX Subsection "get_value_from_object" Given an object, node name, attribute name, attribute value, and value to retrieve type, find the info and return it. .SS "get_node_from_object" .IX Subsection "get_node_from_object" Given an object, node name, attribute name, and attribute value, return the node that has all these things. .SS "name_case" .IX Subsection "name_case" Transform case for name comparisons to that of the database; leave unchanged if \-C (preserve case) is in effect. Only sybase is known to be case sensitive. .SS "get_num_from_node" .IX Subsection "get_num_from_node" Return value part of . .SS "get_bool_from_node" .IX Subsection "get_bool_from_node" Return value part of . .SS "classify_multiplicity" .IX Subsection "classify_multiplicity" Look at a multiplicity descriptor and classify it as 'one' (1, or 1..1), 'zone' (0..1), 'many' (n..m, n..*, where n > 1, m >= n) and \&'zmany' (0..n, 0..*, where n > 1) .SS "attlist_from_names" .IX Subsection "attlist_from_names" Generate a list of attributes from a comma-separated list of names by looking up a class' attribute table. .SS "names_from_attlist" .IX Subsection "names_from_attlist" Generate a comma-separated list of attribute names from a list of attributes. .SS "check_att_list_types" .IX Subsection "check_att_list_types" Check that a list of primary key attributes has types corresponding to the types in a list of foreign key attributes .SS "get_base_type" .IX Subsection "get_base_type" Check that a list of primary key attributes has types corresponding to the types in a list of foreign key attributes. .PP Returns base type of some \s-1DMBS\s0 specific types (eg in PostgreSQL serial is integer). .PP \&\s-1AFF\s0 note: This is better implemented in each sql formatter class. .SS "make_name" .IX Subsection "make_name" Generate a longer name from parts supplied. Except for the first part, the first letter of each part is capitalised. If lcFirstWord is set, then any initial string of capitals in the first part is made lower case; otherwise the first part is left unchanged. .PP Dies if \f(CW$self\fR\->{db} is not set. .PP The \f(CW@parts_org\fR values are save for \*(L"Desperation time\*(R" :) .SS "name_scramble" .IX Subsection "name_scramble" PSuda: Name scrambling helper function, for code which auto-generates names. Takes one arg, which is string to use for md5 hashing. This returns names which consist entirely of underscores and alphanumeric characters, and starts with one or more alpha characters. .SS "mangle_name" .IX Subsection "mangle_name" Get a name to mangle and mangle it to the length specified \*(-- avoid too much manglification if the name is only slightly long, but mangle lots if it's a lot longer than the specified length. .SS "add_default_pk" .IX Subsection "add_default_pk" For \-p \- add a default primary key to a parsed table definition .PP \&\s-1TODO :\s0 Add a meaningful return value. .SS "add_default_fk" .IX Subsection "add_default_fk" For \-f \- add missing parts of a default foreign key to a parsed table definition.