Skip to content
This repository has been archived by the owner on Aug 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from foresmac/master
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
foresmac committed Jan 6, 2016
2 parents dc1b3da + 7f70e4f commit d9e20ac
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
7 changes: 7 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**Author:**
- Brian Hines, @projectweekend


**Contributors:**
- Chris Foresman, @foresmac
- François Pietka, @fpietka
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
A command line tool that generates markdown documentation for Postgres tables in a given schema
A command line tool that generates Markdown documentation for Postgres tables in a given schema.

## Installation
```
pip install pg-table-markdown
```

_Note:_ Since `pg-table-markdown` is intended to connect to Postgres databases, it has a dependedncy on `psycopg2`. However, `psycopg2` includes compiled C modules, and therefore may require compiling from source if it's not already installed. Installing via `pip` will require `python-dev` and `libpq-dev`. `psycopg2` maintainers generally recommend [installing from binary](http://initd.org/psycopg/docs/install.html#install-from-package) instead.


## Usage
```
Usage: pgtablemd [OPTIONS]
Expand All @@ -25,6 +28,21 @@ postgres://username:password@host:port/dbname
```


## Sample Output

The generated Markdown details the column name, type, and default value for each table defined in your schema. It also displays nicely in GitHub (see more [here](./SAMPLE_TABLES.md)).

### app_users

Column | Type | Default | Nullable
--- | --- | --- | ---
id | integer | nextval('app_users_id_seq'::regclass) | NO
email | character varying | None | NO
password | character varying | None | YES
is_active | boolean | true | YES
is_admin | boolean | false | YES


## Run tests with Docker Compose
```
docker-compose run cli nosetests -v
Expand Down
40 changes: 40 additions & 0 deletions SAMPLE_TABLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### app_email_change_request

Column | Type | Default | Nullable
--- | --- | --- | ---
id | integer | nextval('app_email_change_request_id_seq'::regclass) | NO
user_id | integer | None | YES
new_email | character varying | None | NO
code | character varying | None | NO
expires | timestamp without time zone | (timezone('utc'::text, now()) + '1 day'::interval) | YES

### app_password_reset

Column | Type | Default | Nullable
--- | --- | --- | ---
id | integer | nextval('app_password_reset_id_seq'::regclass) | NO
user_id | integer | None | YES
code | character varying | None | NO
expires | timestamp without time zone | (timezone('utc'::text, now()) + '1 day'::interval) | YES
code_used | boolean | false | YES

### app_push_tokens

Column | Type | Default | Nullable
--- | --- | --- | ---
id | integer | nextval('app_push_tokens_id_seq'::regclass) | NO
user_id | integer | None | YES
token | character varying | None | NO
type | character varying | None | NO
sns_arn | character varying | None | NO
created | timestamp without time zone | timezone('utc'::text, now()) | YES

### app_users

Column | Type | Default | Nullable
--- | --- | --- | ---
id | integer | nextval('app_users_id_seq'::regclass) | NO
email | character varying | None | NO
password | character varying | None | YES
is_active | boolean | true | YES
is_admin | boolean | false | YES

0 comments on commit d9e20ac

Please sign in to comment.