Categorygithub.com/gsiems/db-dictionary
modulepackage
0.0.0-20240808201208-03415f962d46
Repository: https://github.com/gsiems/db-dictionary.git
Documentation: pkg.go.dev

# README

db-dictionary

Use relational database meta-data to generate data dictionaries.

Features/roadmap

  • Generates static HTML pages

  • Dictionary information for:

    • Schemas
    • Tables
    • Views
    • Materialized views
    • Constraints
    • Domains
    • Indexes
    • Relationhips
  • Ability to filter tabular data on pages

  • Ability to sort tabular data on pages

    • single column sort only
  • Generate dependency (network) graphs (WIP)

    • GraphML file (WIP)
    • Graphviz file
    • Svg (requires Graphviz)
  • Generate relationship (network) graphs (WIP)

    • GraphML file (TODO)
    • Graphviz file (TODO)
    • Svg (TODO)
  • Ability to specify different CSS/image files for theming

  • Ability to specify additional javascript files

  • Reasonably fast

  • PostgreSQL support

  • Sqlite support

  • MySQL/Mariadb support

  • MS SQL-server support (WIP)

  • Oracle support

Configuration

Configurations can be specified through a combination of configuration file, environment variables, and command line arguments.

  • Command line arguments take precedence over both configuration file parameters and environment variables.
  • Environment variables take precedence over configuration file parameters.
ParameterCommand lineEnvironment/Config fileDescription
CommentsFormat-fcomments_formatThe formatter to use for rendering comments {none, markdown} (default: none)
ConfigFile-cThe configurations file to read, if any
CSSFiles-csscss_filesThe comma-separated list of CSS files to use in place of the default (default: none)
DbComment-commentdb_commentThe comment to use for the database (for those databases that do not support COMMENT ON DATABASE ...) (default: none)
DbEngine-dbmsdbmsThe dbms to generate the dictionary for {oracle, postgresql, mariadb, mysql, sqlite}
DbName-dbdb_nameThe name of the database to connect to
DSNdsnThe DSN to use for connecting to the database (will attempt to create one based on DbName, Host, Port, etc. if not specified)
ExcludeSchemas-xexclude_schemasThe comma-separated list of schemas to exclude (default: none)
File-filefile(Sqlite) The database file to read
GraphvizCmd-gvgraphviz_cmdThe Graphviz command to run (default: fdp)
HideSQL-nosqlhide_sqlDo not show the queries used for views and materialized views (default is to show queries)
Host-hosthostThe database host to connect to (default: localhost)
ImgFiles-imgimg_filesThe comma-separated list of image files to include (for use with custom CSS) (default: none)
IncludeSchemas-sinclude_schemasThe comma-separated list of schemas to include. Takes precedence over ExcludeSchemas. If neither are specified than all non-system schemas are included.
JSFiles-jsjs_filesThe comma-separated list of javascript files to include (default: none)
Minify-minifyminifyIndicates if the output should be minified to reduce files size (default: false)
NoGraphviz-nogvno_graphvizDo not (attempt to) run Graphviz (default is to run Graphviz)
OutputDir-outoutput_dirThe directory to write the output files to (defaults to the current directory)
Port-portportThe port number to connect to (default depends on the database engine)
SSLMode-sslmodessl_mode(Postgresql) Set the SSL mode to use {disable, require, verify-ca, verify-full} (default: require)
Username-userusernameThe username to connect as (defaults to the current OS user)
UserPassuser_passThe password to use to connect as
Verbose-vverboseIndicates if additional feedback should be printed to STDOUT (default: false)

See db-dictionary-example for some sample data dictionaries.

# Packages

Package config contains the configuration structure along the the functions for resolving the configuration to use when creating a data dictionary.
No description provided by the author
No description provided by the author
Package model contains the metadata structure used for generating data dictionaries along the the functions for initializing the metadata structure and loading (from go-db-mata), transforming, and retrieving that metadata.
Package runner takes an instance of a go-db-meta DBMS and initializes/loads a metadata (model) structure then creates a data dictionary.
No description provided by the author
Package util contains the utility functions used by db-dictionary.
No description provided by the author