.\" 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::Output::SQLite3fk 3pm"
.TH Parse::Dia::SQL::Output::SQLite3fk 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::Output::SQLite3fk \- Create SQL for SQLite version 3, with foreign key support
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 3
\& use Parse::Dia::SQL;
\& my $dia = Parse::Dia::SQL\->new(file => \*(Aqfoo.dia\*(Aq, db => \*(Aqsqlite3fk\*(Aq);
\& print $dia\->get_sql();
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This sub-class creates \s-1SQL\s0 for the SQLite database version 3.
.SS "new"
.IX Subsection "new"
The constructor.
.PP
Object names in SQLite have no inherent limit. 60 has been arbitrarily chosen.
.SS "_get_create_table_sql"
.IX Subsection "_get_create_table_sql"
Generate create table statement for a single table using SQLite
syntax:
.PP
Includes class comments before the table definition.
.PP
Includes autoupdate triggers based on the class comment.
.PP
Includes foreign key support of the form
.PP
.Vb 1
\& foreign key(thisColumn) references thatTable(thatColumn) {action}
.Ve
.PP
Where {action} is the optional contraint condition, such as 'on delete cascade' exactly as entered in the diagram.
.PP
\fIautoupdate triggers\fR
.IX Subsection "autoupdate triggers"
.PP
If the class comment includes a line like:
.PP
.PP
Then an 'after update' trigger is generated for this table which
executes the statement \fIfoo\fR for the updated row.
.PP
Examples of use include tracking record modification dates
(\f(CW\*(C`) or deriving a value from
another field (\f(CW\*(C`)
.SS "_create_pk_string"
.IX Subsection "_create_pk_string"
Override default function to include foreign key clauses
.SS "get_schema_drop"
.IX Subsection "get_schema_drop"
Generate drop table statements for all tables using SQLite syntax:
.PP
.Vb 1
\& drop table {foo} if exists
.Ve
.SS "get_view_drop"
.IX Subsection "get_view_drop"
Generate drop view statements for all tables using SQLite syntax:
.PP
.Vb 1
\& drop view {foo} if exists
.Ve
.SS "_get_fk_drop"
.IX Subsection "_get_fk_drop"
Foreign key enforcement is embedded in the table definitions for SQLite, so no output is required here.
.SS "_get_drop_index_sql"
.IX Subsection "_get_drop_index_sql"
drop index statement using SQLite syntax:
.PP
.Vb 1
\& drop index {foo} if exists
.Ve
.SS "get_permissions_create"
.IX Subsection "get_permissions_create"
SQLite doesn't support permissions, so suppress this output.
.SS "get_permissions_drop"
.IX Subsection "get_permissions_drop"
SQLite doesn't support permissions, so suppress this output.
.SS "_get_create_association_sql"
.IX Subsection "_get_create_association_sql"
Foreign key enforcement is embedded in the table definitions for SQLite, so no output is required here.
.SH "TODO"
.IX Header "TODO"
Things that might get added in future versions:
.PP
\fIViews\fR
.IX Subsection "Views"
.PP
Views haven't been tested. They might already work, but who knows...
.PP
\fIOther stuff\fR
.IX Subsection "Other stuff"
.PP
Bugs etc