Skip to content

Latest commit

 

History

History
96 lines (61 loc) · 4.04 KB

20231016_05.md

File metadata and controls

96 lines (61 loc) · 4.04 KB

PostgreSQL schema document(包括对象关系ER,注释,函数等)生成工具: tbls

作者

digoal

日期

2023-10-16

标签

PostgreSQL , PolarDB , er , tbls


背景

试想一下你拿到一个数据库, 如何快速了解对象之间的关系? 生成ER, 导出各对象的注释等.

https://github.com/k1LoW/tbls

https://github.com/k1LoW/tbls/blob/main/sample/postgres/README.md

testdb

Description

Sample PostgreSQL database document.

Tables

Name Columns Comment Type
public.users 6 Users table BASE TABLE
public.user_options 4 User options table BASE TABLE
public.posts 8 Posts table BASE TABLE
public.comments 7 Comments
Multi-line
table
comment
BASE TABLE
public.comment_stars 6 BASE TABLE
public.logs 7 audit log table BASE TABLE
public.post_comments 7 post and comments View table VIEW
public.post_comment_stars 5 MATERIALIZED VIEW
public.CamelizeTable 2 BASE TABLE
public.hyphen-table 4 BASE TABLE
administrator.blogs 6 admin blogs BASE TABLE
backup.blogs 5 BASE TABLE
backup.blog_options 4 BASE TABLE
time.bar 1 BASE TABLE
time.hyphenated-table 1 BASE TABLE
time.referencing 3 BASE TABLE

Stored procedures and functions

Name ReturnType Arguments Type
public.uuid_nil uuid FUNCTION
public.uuid_ns_dns uuid FUNCTION
public.uuid_ns_url uuid FUNCTION
public.uuid_ns_oid uuid FUNCTION
public.uuid_ns_x500 uuid FUNCTION
public.uuid_generate_v1 uuid FUNCTION
public.uuid_generate_v1mc uuid FUNCTION
public.uuid_generate_v3 uuid namespace uuid, name text FUNCTION
public.uuid_generate_v4 uuid FUNCTION
public.uuid_generate_v5 uuid namespace uuid, name text FUNCTION
public.update_updated trigger FUNCTION
public.reset_comment void IN comment_id integer PROCEDURE

Relations

er


Generated by tbls

digoal's wechat