Parse::Dia::SQL(3pm)

πŸ“¦
version 0.31 Β· 2 versions
  • 0.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 .dia file(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 πŸ’–πŸŽ€πŸ¦‹