Parse::Dia::SQL(3pm)
π NAME π
Parse::Dia::SQL β bestie, it turns your Dia class diagrams into SQL. That's the whole vibe. It's the 3pm manual page for it, and yes we're doing this together, grab a snack π
β¨ SYNOPSIS β¨
okay so here's the whole thing in two flavours, library mode and command-line mode:
use Parse::Dia::SQL;
my $dia = Parse::Dia::SQL->new(
file => 't/data/TestERD.dia',
db => 'db2'
);
print $dia->get_sql();
# or command-line version
perl parsediasql --file t/data/TestERD.dia --db db2
like. it's giving effortless. π
πΈ DESCRIPTION πΈ
So Dia is a diagram creation program for Linux, Unix and Windows, released under the GNU General Public License. Iconic of it.
And Parse::Dia::SQL converts Dia class diagrams into SQL. Periodt.
Here's the tea on how it's split up tho, because it's lowkey two besties working as a duo:
- Parse::Dia::SQL is the parser that interprets the
.diafile(s) into an internal datastructure. - Parse::Dia::SQL::Output (or one of its sub classes) can take the datastructure and generate the SQL statements it represents.
so one of them reads, one of them writes. main character energy from both ngl π«Ά
π¦ MODELLING HOWTO π¦
Go read this, bestie:
<http://tedia2sql.tigris.org/usingtedia2sql.html>
π Modelling differences from tedia2sql π
okay so this is the part where we're not like other girls (other girls = tedia2sql):
- Index options are supported. Text is taken from the comments field of the operation, i.e. the index. A database specific default value is used if the comments field is left blank. Consult the Output sub class' constructor. π
- Type mapping is supported. A type mapping is a user-defined column name replacement. Unlike tedia2sql the type mapping is non-recursive. Consult
"t/data/typemap.dia"for an example. (yes it's non-recursive, no we're not doing recursion, don't ask π) - Preliminary support for Dia's database shapes is added. β¨
- Table comments are used as table postfix options. This means per-table options (e.g. partitioning options) are supported on a per-database level. cute, right?
- backticks notation is supported for MySQL-InnoDB.
``slay.
π DIA VERSIONS π
Parse::Dia::SQL has been tested with Dia versions 0.93 - 0.97. π
Parse::Dia::SQL uses the XML "version" tag information in the .dia input file to determine how each XML construct is formatted. Future versions of Dia may change the internal format, and XML "version" tag is used to detect such changes. so basically it's doing a vibe check on your file's version tag before it commits. π
π DATABASE SUPPORT π
The following databases are supported, and honestly? the range. the versatility. we love a flexible parser:
- DB2
- Informix
- Ingres
- Oracle
- Postgres
- Sas
- SQLite3
- SQLite3fk (with foreign key support)
- Sybase
- MySQL InnoDB
- MySQL MyISAM
Adding support for additional databases means to create a subclass of Parse::Dia::SQL::Output. So if your fave db isn't hereβ¦ you know what to do. πͺ
Patches are welcome. π₯Ί (fr fr, they said it, not me)
π AUTHOR π
Parse::Dia::SQL is based on tedia2sql by Tim Ellis and others. See the AUTHORS file for details.
Modified by Andreas Faafeng, "<aff at cpan.org>" for release on CPAN. π
π BUGS π
Please report any bugs or feature requests to "bug-parse-dia-sql at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parse-Dia-SQL>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. so like, you file it, they know, you know, everyone's in the loop. communication queen. π
π«Ά SUPPORT π«Ά
You can find documentation for this module with the perldoc command.
perldoc Parse::Dia::SQL
You can also look for information at:
- Project home
Documentation and public source code repository:
<http://tedia2sql.tigris.org/>
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parse-Dia-SQL>
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Parse-Dia-SQL>
- CPAN Ratings
<http://cpanratings.perl.org/d/Parse-Dia-SQL>
- Search CPAN
<http://search.cpan.org/dist/Parse-Dia-SQL>
so many places to lurk, pick your fave π§
β SEE ALSO β
iykyk π
π ACKNOWLEDGEMENTS π
See the AUTHORS file. (they're all in there, go say hi π₯°)
π LICENSE π
This program is released under the GNU General Public License. ποΈ
π₯ TERMINOLOGY π₯
By database we mean relational database management system (RDBMS). Just so we're all on the same page bestie, no confusion, we're precise here. β¨
π METHODS π
πΈ new() πΈ
The constructor. Mandatory arguments:
file - The .dia file to parse
db - The target database type
Dies if target database is unknown or unsupported. π like it will simply not tolerate an unsupported db. respect.
π get_sql() π
Return sql for given db. Calls underlying methods that performs parsing and sql generation.
so it's the lil multitasker, parsing and generating, all in one call. ate. π
okay that's the whole page bestie!! this one's from perl v5.36.0, dated 2022-11-19 β shoutout to the Parse::Dia::SQL(3pm) manual for the lore, and to you for reading all the way down here π«Άβ¨ go make some diagrams and turn them into SQL, you got this πππ¦
π¦ where this page comes from
- debian bookworm: libparse-dia-sql-perl 0.31-2 Β· GPL-2.0-or-later
- debian trixie: libparse-dia-sql-perl 0.31-2 Β· GPL-2.0-or-later
- ubuntu noble: libparse-dia-sql-perl 0.31-2 Β· GPL-2.0-or-later
- ubuntu resolute: libparse-dia-sql-perl 0.31-2 Β· GPL-2.0-or-later
- ubuntu stonking: libparse-dia-sql-perl 0.31-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms