PostgresDescribe v0.1.4 PostgresDescribe View Source

This library provides a Mix task that documents PostgreSQL database tables in files within the directory tree.

Link to this section Summary

Functions

Main entry point into PostgresDescribe’s library code. Takes no arguments, pulls configuration from the environment and/or defaults

Link to this section Functions

Main entry point into PostgresDescribe’s library code. Takes no arguments, pulls configuration from the environment and/or defaults.

The following configuration values are required at a minimum:

  • database: Your PG database name
  • write_dir: Where we should write your description files
  • tables (map): Keys are schemas in your database (at a minimum you probably want public), and values are lists of table names within that schema

If any of these values are not provided, this function will raise an ArgumentError.

Additional configuration values you can set:

  • host: Your PG host (defaults to localhost)
  • port: PG port (defaults to 5432)
  • user: Your PG user (defaults to your current username, whoami)
  • password: Your PG password (defaults to nil)

Configuration can be provided through your application config under the postgres_describe application:

config :postgres_describe,
  database: "mydatabase",
  write_dir: Path.join([System.tmp_dir, "db_docs"]),
  tables: %{
    public: ["table1", "table2"]
  }

Or through system environment variables.