Postgres Describe
This library provides a Mix
task that documents PostgreSQL database tables
in files within the directory tree.
Installation
Add postgres_describe
to your list of dependencies in mix.exs
:
def deps do
[
{:postgres_describe, "~> 0.1.0"}
]
end
And mix deps.get
.
Basic Usage
The following configuration keys are the minimum required, and an example follows:
host
# Your PG hostport
# PG portuser
# Your PG userpassword
# Your PG passworddatabase
# Your PG database namewrite_dir
# Where we should write your description filestables
# A map: keys are schemas in your database (at a minimum you probably wantpublic
), and values are lists of table names within that schema
config :postgres_describe,
host: "localhost",
port: 5432,
user: "myuser",
password: "mypassword",
database: "mydatabase",
write_dir: "/tmp",
tables: %{
public: [
"table_1",
"table_2"
],
another_schema: [
"table_3",
"table_4"
]
}
Then run the generator from the root of your application:
$ mix PostgresDescribe
Full docs can be found online.