Builds markdown from a Postgres connection
npm install -g postgres-markdown
Usage: postgres-markdown [options]
Options:
-V, --version output the version number
-H, --host [host] Host (default: "127.0.0.1")
-p, --port [port] Port (default: 5432)
-u, --user [user] User (default: "postgres")
-W, --password [password] Password
-d, --database [database] Database (default: "postgres")
-o, --output [output] Output file name (default: "index.md")
-l, --locale [locale] Locale (default: "ru")
-i, --ignore <ignore> Pattern of objects to ignore
-v, --verbose Verbose output
-h, --help output usage information
CREATE SCHEMA users;
COMMENT ON SCHEMA users
IS 'Пользователи';
CREATE TABLE users."user"
(
id serial NOT NULL,
email character varying(100) NOT NULL,
CONSTRAINT user_pkey PRIMARY KEY (id),
CONSTRAINT user_email_key UNIQUE (email)
);
COMMENT ON COLUMN users."user".email IS 'Уникальный email пользователя (логин)';
CREATE TYPE web_users.test_enum AS ENUM
('NEW',
'CLOSED');
CREATE TABLE web_users."user"
(
settings integer[],
status web_users.test_enum,
CONSTRAINT user_pkey PRIMARY KEY (id)
)
INHERITS (users."user");
COMMENT ON COLUMN web_users."user".settings IS 'Массив int флагов';
COMMENT ON COLUMN web_users."user".status IS 'Статус пользователя
NEW - новый, CLOSED - закрытый
Статусы указаны для примера';
Created at: 2019-09-08T14:32:51.401Z Server version: PostgreSQL 10.10, compiled by Visual C++ build 1800, 64-bit
Inherited tables:
column | comment | type | length | default | constraints | values |
---|---|---|---|---|---|---|
id (pk) | integer | nextval('users.user_id_seq'::regclass) | NOT NULL | |||
Уникальный email пользователя (логин) | character varying | 100 | NOT NULL |
column | comment | type | length | default | constraints | values |
---|---|---|---|---|---|---|
id (pk) | integer | nextval('users.user_id_seq'::regclass) | NOT NULL | |||
email inherits from users.user | Уникальный email пользователя (логин) | character varying | 100 | NOT NULL | ||
settings | Массив int флагов | integer[] | ||||
status | Статус пользователя NEW - новый, CLOSED - закрытый Статусы указаны для примера | user-defined | NEW, CLOSED |