SQLT-GRAPH(1)
π NAME π
sqlt-graph(1) β a User Contributed Perl Documentation page that will Automatically create a graph from a database schema. Bestie, it's literally giving βschema but make it visualβ β¨.
β¨ SYNOPSIS β¨
./sqlt-graph -d|--db|-f|--from=db_parser [options] schema.sql
π Options π
-l,--layoutβ picks the GraphViz layout for your schema:"dot","neato", or"twopi"; default is"dot".-n,--node-shapeβ shape of the nodes:"record","plaintext","ellipse","circle","egg","triangle","box","diamond","trapezium","parallelogram","house","hexagon","octagon"; default is"record".-o,--outputβ output file name; default isSTDOUT.-t,--output-typeβ output file type:"canon","text","ps","hpgl","pcl","mif","pic","gd","gd2","gif","jpeg","png","wbmp","cmap","ismap","imap","vrml","vtx","mp","fig","svg","plain"; default is"png".-c,--colorβ add colors.--clusterβ cluster tables.--no-fieldsβ don't show field names.--heightβ image height (in inches, default"11", set to"0"to undefine).--widthβ image width (in inches, default"8.5", set to"0"to undefine).--fontsizeβ custom font size for node and edge labels.--fontnameβ name of custom font (or full path to font file) for node, edge, and graph labels.--nodeattrβ attribute name and value (inkey=valsyntax) for nodes; this option may be repeated to specify multiple node attributes.--edgeattrβ same as--nodeattr, but for edge attributes.--graphattrβ same as--nodeattr, but for graph attributes.--natural-joinβ perform natural joins.--natural-join-pkβ perform natural joins from primary keys only.--show-datatypesβ show datatype of each field.--show-sizesβ show column sizes forVARCHARandCHARfields.--show-constraintsβ show list of constraints for each field.-s,--skipβ fields to skip in natural joins.--skip-tablesβ comma-separated list of table names to exclude.--skip-tables-likeβ comma-separated list of regexen to exclude tables.--debugβ print debugging information.--traceβ print parser trace info.
πΈ DESCRIPTION πΈ
Okay so this script will create a graph of your schema. Only the database driver argument (for SQL::Translator) is required. If no output file name is given, then the image will be printed to STDOUT, so you should redirect the output into a file. No cap, that's the whole flow. π«Ά
The default action is to assume the presence of foreign key relationships defined via REFERNCES or FOREIGN KEY constraints on the tables. (Yes, REFERNCES is spelled like that in the original β we keep it moving. π
) If you are parsing the schema of a file that does not have these, you will find the natural join options helpful.
With natural joins, like-named fields will be considered foreign keys. This can prove too permissive, however, as you probably don't want a field called name to be considered a foreign key, so you could include it in the skip option, and all fields called name will be excluded from natural joins. A more efficient method, however, might be to simply deduce the foreign keys from primary keys to other fields named the same in other tables. Use the natural-join-pk option to achieve this. Slay. β¨
If the schema defines foreign keys, then the graph produced will be directed showing the direction of the relationship. If the foreign keys are intuited via natural joins, the graph will be undirected.
Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is:
cluster1=table1,table2;cluster2=table3,table4
π«Ά AUTHOR π«Ά
Ken Youens-Clark <kclark@cpan.org>. That's the icon behind this one. π
π SEE ALSO π
perlSQL::Translator
Bye bestie π«Ά this page is from perl v5.40.2, dated 2026-07-16, and it's SQLT-GRAPH(1) β periodt. π
β¨
π¦ where this page comes from
- epel 10: sqlt-graph 1.66-5.el10_3 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms