SQL::T...iagram(3pm)

πŸ’– SQL::Translator::Producer::Diagram πŸ’–

okay so bestie, welcome to SQL::T...iagram(3pm) β€” aka SQL::Translator::Producer::Diagram, the ER diagram producer for SQL::Translator πŸŽ€ it's giving "turn your schema into a picture" and honestly? iconic.

It lives in the User Contributed Perl Documentation, and yes the name is literally truncated to SQL::T...iagram(3pm) up in the header, we don't make the rules πŸ’…


✨ NAME ✨

SQL::Translator::Producer::Diagram β€” ER diagram producer for SQL::Translator πŸ¦‹


✨ SYNOPSIS ✨

Use it via SQL::Translator, bestie:

use SQL::Translator;

my $t = SQL::Translator->new(
    from          => 'MySQL',
    to            => 'Diagram',
    producer_args => {
        # All args are optional
        out_file         => 'schema.png',# if not provided will return from translate()
        output_type      => 'png',       # is default or 'jpeg'
        title            => 'My Schema', # default is filename
        font_size        => 'medium',    # is default or 'small,' 'large'
        imap_file        => '',          # filename to write image map coords
        imap_url         => '',          # base URL for image map
        gutter           => 30           # is default, px distance b/w cols
        num_columns      => 5,           # the number of columns
        no_lines         => 1,           # do not draw lines to show FKs
        add_color        => 1,           # give it some color
        show_fk_only     => 1,           # show only fields used in FKs
        join_pk_only     => 1,           # use only primary keys to figure PKs
        natural_join     => 1,           # intuit FKs if not defined
        skip_fields      => [...],       # list* of field names to exclude
        skip_tables      => [...],       # list* of table names to exclude
        skip_tables_like => [...],       # list* of regexen to exclude tables
    }
) or die SQL::Translator->error;
$t->translate;

✨ little note, bestie: * "list" can be either an array-ref or a comma-separated string 🌸 so do whatever feels right for your vibe, no cap.

πŸ’€ heads up: every single one of those producer_args is optional. You can just roll in with the defaults and let the diagram cook.

✨ AUTHOR ✨

Ken Youens-Clark <kclark@cpan.org> 🫢 absolute main character energy for writing this.


and that's the whole page, bestie, we ate πŸ’…βœ¨

cute little sign-off: this was perl v5.40.0, dated 2024-11-23, filed under the manual page name SQL::T...iagram(3pm) πŸŒˆπŸŽ€ bye ilysm, go draw some diagrams πŸ¦‹

πŸ“¦ where this page comes from