Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CIフレンドリなDBドキュメント生成ツールでドキュメントの最新を維持し続ける / phpcon...
Search
Ken’ichiro Oyama
June 16, 2018
Technology
3
3.7k
CIフレンドリなDBドキュメント生成ツールでドキュメントの最新を維持し続ける / phpconfuk_rej
【非公式】PHPカンファレンス福岡2018前夜祭リジェクトコン #phpconfuk_rej
Ken’ichiro Oyama
June 16, 2018
Tweet
Share
More Decks by Ken’ichiro Oyama
See All by Ken’ichiro Oyama
実践 net/http Middleware パターン / Kizuku.go Vol.1
k1low
1
180
Cleanup handling in Go / Go Conference 2024
k1low
6
3.1k
CI/CDがあたりまえの今の時代にAPIテスティングツールに求められていること / CI/CD Test Night #7
k1low
17
8.5k
Command-line interface tool design / PHPerKaigi 2024
k1low
8
2.8k
gostyle IS NOT Go Style / Fukuoka.go#19 Reboot
k1low
1
220
Parsing case study in Go / Go Conference mini 2023 Winter IN KYOTO
k1low
2
1.3k
APIシナリオテストツールとしてのrunn / 4 API testing tools
k1low
3
1.4k
The future of tbls and "Documentation as Code" / phpconfuk 2023
k1low
4
5.8k
net/http/httptest.Server のアプローチをテスト戦略に活用する / Go Conference 2023
k1low
9
2.9k
Other Decks in Technology
See All in Technology
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
AGIについてChatGPTに聞いてみた
blueb
0
130
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
Taming you application's environments
salaboy
0
180
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
Featured
See All Featured
Scaling GitHub
holman
458
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
How to Ace a Technical Interview
jacobian
276
23k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Music & Morning Musume
bryan
46
6.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Transcript
খࢁ݈Ұ(.01FQBCP *OD 1)1ΧϯϑΝϨϯεԬલࡇϦδΣΫτίϯ $*ϑϨϯυϦͳ%#υΩϡϝϯτੜπʔϧͰ υΩϡϝϯτͷ࠷৽Λҡ࣋͠ଓ͚Δ
γχΞΤϯδχΞ খࢁ݈Ұ!L-P8 ϗεςΟϯάࣄۀ෦ϗεςΟϯάάϧʔϓϚωʔδυΫϥυνʔϜ IUUQTHJUIVCDPNL-P8
օ͞ΜͷϓϩδΣΫτʹ σʔλϕʔεઃܭॻ&3ਤ ͋Γ·͔͢ʁ
ͦΕߋ৽͞Ε͍ͯ·͔͢ʁ ࠷৽ͷঢ়ଶͰ͔͢ʁ
࠷ۙࢲ͕+0*/ͨ͠ ͋ΔϓϩδΣΫτͷ߹
͋ΔϓϩδΣΫτ -0-*101ϚωʔδυΫϥυ ͷྫ wͷ͍͍͢͝ͰػೳՃվળ͕܁Γฦ͞Ε͍ͯͨ w͍ΘΏΔ5JFSͳ୯७ͳ8FCΞϓϦέʔγϣϯͳͲͰͳ͘ɺϩʔϧ ͚ͩͰऑ͋Δɺ͍ΘΏΔ.JDSPTFSWJDFͳߏ wͦͷ͏ͪॏཁͳঢ়ଶอ࣋Λ୲͏σʔλϕʔε͕ϩʔϧ wνʔϜϝϯόʔ͕༏लͰ͋Δ͜ͱ͔ΒσʔλϕʔεͷεΩʔϚมߋ ;͘Ίಉ࣌ฒߦతʹߦΘΕ͍ͯͨ
͋ΔϓϩδΣΫτ -0-*101ϚωʔδυΫϥυ ͷྫ wίʔυͷཧ(JU)VC ()& Ͱશͯཧ wΤϯδχΞ͚ͩͰͳ͘σβΠφʔσΟϨΫλʔ(JU)VC্Ͱ׆ಈ wϓϩδΣΫτΛߏ͢ΔϦϙδτϦෳ wϓϩάϥϛϯάݴޠͭͰͳ͘5ZQF4DSJQU(PͳͲෳ
͘ฒߦతͳ։ൃͷσʔλϕʔεεΩʔϚͷߋ৽՝ w୭͕σʔλϕʔεεΩʔϚͷશͯΛѲ͍ͯ͠Δঢ়گͰͳ͔ͬͨ w ʮ͜ͷΧϥϜͲΜͳ༻్ͰΘΕΔΜͰ͔͢ʁʢࣗʣʯ w 4MBDLͰؾܰʹ࣭Ͱ͖Δ͠ɺௐͨΒΘ͔Δɻ͔͠͠ϫϯςϯϙΕΔ w୭͕σʔλϕʔεεΩʔϚͷ࠷৽ͷঢ়ଶΛѲ͍ͯ͠Δঢ়گͰͳ ͔ͬͨ w ʮ͋ΕʁԶ͕࡞ͬͨϚΠάϨʔγϣϯ͕ద༻͞Εͯͳ͍ʯˠฒߦͰϚΠάϨʔγϣ
ϯ͕ൃੜ͢Δ1VMM3FRVFTU͕͋ͬͨ݁ՌɺϚΠάϨʔγϣϯπʔϧͷϑΝΠϧ໊ ͷλΠϜελϯϓνΣοΫͰඈ͞Ε͍ͯͨ
࠷ॳͷࣗͷ wνʔϜʹ+0*/͔ͨ͠ΓͰσʔλϕʔεͷશମ૾͕Θ͔Βͳ͔ͬͨ wͱΓ͋͑ͣ4DIBNB4QZΛͬͯखݩʹσʔλϕʔευΩϡϝϯτΛ ࡞ͯ֬͠ೝ͍ͯͨ͠ wIUUQTDIFNBTQZPSH wશςʔϒϧશΧϥϜʹ$0..&/5ΛՃ͢Δ1VMM3FRVFTUΛ͢ΔͳͲ wͱΓ͋͑ͣ҆৺
ͱ͜Ζ͕ɺ͋Δͱ͖
ϓϩμΫτΦʔφʔ ʮͲ͔͜ʹσʔλϕʔεઃܭॻͳ͍Ͱ͔͢Ͷʁʯ
ΤϯδχΞͰͳͯ͘42-Λۦ͢Δձࣾͩͬͨ wσʔλϕʔεΛѲ͍ͨ͠ͷΤϯδχΞ͚ͩͰͳ͔ͬͨ w։ൃ͍ͯ͠ΔΤϯδχΞσʔλϕʔεͷεΩʔϚʹ͍ͭͯ࠷৽Ͱ ͳ͍ʹͤΑѲ͍ͯ͠Δʢ͠ͳ͍ͱ։ൃͰ͖ͳ͍ʣ w࣭֬ೝΛ͢Δͱ͖ʹΞλϦ͕͚ͭΒΕΔ wීஈผͷ͜ͱΛߟ͑Δඞཁ͕͋ΔσΟϨΫλʔͦ͏Ͱͳ͍ w͜Εʢྑ͍ҙຯͰʣఆ֎ɺ͜ͷ··ͩͱϚζ͍͔
UCMT
UCMT wUCMTJTB$*'SJFOEMZUPPMGPSEPDVNFOUBEBUBCBTF XSJUUFOJO(P wIUUQTHJUIVCDPNL-P8UCMT w.BSLEPXO ('. ܗࣜͰσʔλϕʔευΩϡϝϯτΛੜͯ͘͠ΕΔ$-* πʔϧ w$*ϑϨϯυϦʔͳίϚϯυ͋Δʢޙड़
Πϯετʔϧ w)PNFCSFXͰΠϯετʔϧՄೳ $ go get -u github.com/k1LoW/tbls $
brew install k1LoW/tbls/tbls w(PͳͷͰHPHFUͰΠϯετʔϧͰ͖·͢
Φϓγϣϯ(SBQIWJ[ͷΠϯετʔϧ w&3ਤੜͷͨΊͷ(SBQIWJ[ΛΠϯετʔϧ͠·͢ $ brew install graphviz
AUCMTEPDAσʔλϕʔευΩϡϝϯτͷੜ wAUCMTEPDAίϚϯυͰσʔλϕʔεʹଓͯ͠υΩϡϝϯτΛੜ͠·͢ $ tbls doc mysql://user:pass@hostname:3306/dbname ./dbdoc
ͦͯ͠(JU)VCʹίϛοτ
None
4".1-&
.BSLEPXOͰ͋Δྑ͞ w(JU)VC্ͰࣗಈͰϨϯμϦϯά͞ΕΔ wJNH؆୯ʹઃஔͰ͖Δ wϚʔΫμϯͳͷͰHJUEJ⒎Ͱ͕ࠩΘ͔Γ͍͢ wεΩʔϚߋ৽༰͕Θ͔Γ͍͢
lEJ⒎z
AUCMTEJ⒎AυΩϡϝϯτͱσʔλϕʔεͷࠩ wAUCMTEPDAΛAUCMTEJ⒎Aʹม͑Δ͚ͩͰσʔλϕʔεʹଓͯ͠طଘͷ ੜࡁΈυΩϡϝϯτͱͷࠩΛग़ྗ͠·͢ʢ(SBQIWJ[Ͱग़ྗͨ͠&3ਤ Ҏ֎ʣ w͕ࠩͳ͍ͱ͖Կग़ྗ͠ͳ͍ $ tbls diff
mysql://user:pass@hostname:3306/dbname ./dbdoc
l͕ࠩͳ͍ͱ͖Կग़ྗ͠ͳ͍z
͜ͷΈΛͬͯ$*ʹΈࠐΉ
$*࿈ܞ wσʔλϕʔεΛ࣋ͭΞϓϦέʔγϣϯͷςετʹ࠷৽ʹϚΠάϨʔγϣ ϯ͞Εͨσʔλϕʔε͕༻ҙ͞Ε͍ͯΔͣɻ wͦͷσʔλϕʔεʹଓͯ͠AUCMTEJ⒎AΛ࣮ߦɺίϛοτࡁΈͷυΩϡϝ ϯτͷࠩΛ֬ೝɺ͕ࠩ͋ΕΤϥʔʹ͢Δɻ wUCMTίϚϯυ(PͳͷͰϫϯόΠφϦɻͭ·Γ$*ʹΈࠐΈ͍͢
ྫ͑ϫϯϥΠφʔ w5SBWJT$*$JSDMF$*ͷ:".-ϑΝΠϧʹهड़ͯ͠ར༻Ͱ͖·͢ script: - DIFF=`tbls diff mysql://user:pass@hostname:3306/ dbname
./dbdoc` && if [ ! -z "$DIFF" ]; then echo "document does not match database." >&2 ; tbls diff mysql://user:pass@hostname:3306/dbname ./dbdoc; exit 1; fi
ྫ͑.BLFpMF wANBLFEPDAͱANBLFUFTUEPDA doc: ## Document database schema tbls
doc mysql://user:pass@hostname:3306/dbname ./dbdoc testdoc: ## Test database schema document $(eval DIFF := $(shell tbls diff mysql:// user:pass@hostname:3306/dbname ./dbdoc)) @test -z "$(DIFF)" || (echo "document does not match database." && tbls diff mysql://user:pass@hostname:3306/ dbname ./dbdoc && exit 1)
$*ϑϨϯυϦʔ
͞Βʹ
ABEEAϦϨʔγϣϯɺίϝϯτͷิ wUCMT',ΛΈͯϦϨʔγϣϯΛఆͯ͠&3ਤΛ࡞͢Δ w͔͠͠ɺੈͷதʹ',͕ͬͯͳ͍σʔλϕʔε͋ΔʢΩʔϨεΤϯ τϦʣ wӡ༻தͷσʔλϕʔεʹ$0..&/5ͷߋ৽ͷͨΊʹ"-5&3ͨ͘͠ͳ͍ wͦͷͨΊʹABEEAΦϓγϣϯͰ:".-ϑΝΠϧΛࢦఆ͢Δ͜ͱͰϦϨʔ γϣϯɺίϝϯτͷิ͕Ͱ͖·͢
ίϚϯυͰυΩϡϝϯτੜ ίϚϯυͰυΩϡϝϯτςετ
.Z42- 1PTUHSF42-
σʔλϕʔε υΩϡϝϯτ͕ͳ͍ υΩϡϝϯτ͕࠷৽Ͱͳ͍ ϓϩδΣΫτΛ ໓͢Δͧʂʂ
5IBOLZPV ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU