Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
tblsの紹介@PHP_オレ_カンファレンス神戸
Search
sho44
July 21, 2024
60
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
tblsの紹介@PHP_オレ_カンファレンス神戸
sho44
July 21, 2024
Transcript
16 slides
tblsの紹介
sho44 新卒2年目エンジニア 媒体サイドの広告管理画面作ってます 普段はRails, AWS, postgresql 学生時代インターンでPHP (CodeIgniter) (副業先探してます!) 自己紹介
xにとびます
tblsの紹介
tbls ( is pronounced /ˈteɪbl̩z/. ) is a CI-Friendly tool
for document a database, written in Go. https://github.com/k1LoW/tblsより引用
Go製なんかい! DBドキュメントツールなんかい!
PHPの話じゃなくて ごめんなさい!! 寛大な気持ちで聞いてください🧚
tblsのすごいところ • 環境構築がとても楽 • 一瞬でER図付きのDBドキュメントを作ってくれる • CIでDBのdiffを出してくれる • ネットワークに接続しなくても良い(はず) •
対応しているDBが多い ◦
デモ動画の前提条件 • 使用DB:postgresql • docker composeで環境作っています ◦ dbコンテナ、tblsコンテナのみ https://github.com/shosho44/tbls-introductionにデモ環境を載せています
デモ動画 https://www.youtube.com/watch?v=jx4VwKDGR8s
デモ動画 https://www.youtube.com/watch?v=VWHoB_vhbpg
version: "3.9" services: db: image: postgres:14.11 volumes: - data:/var/lib/postgresql/data environment:
POSTGRES_DB: db POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres healthcheck: test: "psql -U postgres -l" interval: 1s timeout: 1s retries: 5 ports: - "5432:5432" networks: - net_internal - net_external tbls: image: ghcr.io/k1low/tbls:latest working_dir: /mnt tty: true depends_on: db: condition: service_healthy volumes: - ./docs:/mnt entrypoint: tbls doc --rm-dist postgres://postgres:postgres@db:5432/postgre s?sslmode=disable networks: - net_internal volumes: data: networks: net_internal: name: net_internal internal: true net_external: name: net_external
他にも色々できます その1 $ tbls lint users.username: column comment required. users.password: column
comment required. comments.post_id: column comment required. posts: too many columns. [12/10] comments: too many columns. [11/10] 5 detected DBに対してlintを適用
他にも色々できます その2 $ tbls coverage Table Coverage All tables 16.1% public.users
20% public.comments 14.3% public.post_comments 87.5% public.post_comment_stars 0% DBのcommentなどの カバレッジ計測
他にも色々できます その3 • yamlファイルに定義するだけで、、、 ◦ 外部キーがはられていない tableのリレーションを定義できる ◦ カラム・DBにコメントを定義できる ◦ ALTER,
Migrationする必要がない!
利用シーン • 新人が入ってきたけどDBのカラムの説明や関連付けについて説明するのが大 変 • SQLを叩くBizメンバーからER図を欲しいと言われた • 使ってないテーブルやカラムのお掃除をしたいけどDBの全体像を把握できない
おわり
More Decks by sho44
See All by sho44
PHPのバージョンアップを通して保守性の大切さを学んだ
shosho44
0
110
rettyインターン内容.pdf
shosho44
0
78
Featured
See All Featured
Building an army of robots
kneath
307
47k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Un-Boring Meetings
codingconduct
0
510
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
600
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Amusing Abliteration
ianozsvald
1
400
Designing for Performance
lara
612
70k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
A better future with KSS
kneath
240
18k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990