Giter Club home page Giter Club logo

postgres-markdown's Introduction

Postgres Markdown

Builds markdown from a Postgres connection

Installation:

npm install -g postgres-markdown

Usage:

Usage: postgres-markdown [options]


  Options:

    -V, --version              output the version number
    -h, --host [host]          Host
    -p, --port [port]          Port
    -d, --database [database]  Database
    -u, --user [user]          User
    -W, --password [password]  Password
    -o, --output [output]      Output file name
    -l, --locale [locale]      Documentation language (en|ru)
    -h, --help                 output usage information

Example DB:

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 - закрытый

Статусы указаны для примера';

Example output:

Database Documentation

Created at: 2019-09-08T14:32:51.401Z Server version: PostgreSQL 10.10, compiled by Visual C++ build 1800, 64-bit

Schema: users

Tables

users.user

Inherited tables:

column comment type length default constraints values
id (pk) integer nextval('users.user_id_seq'::regclass) NOT NULL
email Уникальный email пользователя (логин) character varying 100 NOT NULL

Schema: web_users

Tables

web_users.user

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.