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
Supabase x Ruby on Rails
Search
4geru sakisaka
May 31, 2024
0
270
Supabase x Ruby on Rails
Shinjuku.rb #92 好きなもの紹介LT大会 での登壇資料です。
https://shinjukurb.connpass.com/event/317784/
4geru sakisaka
May 31, 2024
Tweet
Share
More Decks by 4geru sakisaka
See All by 4geru sakisaka
趣味コーディングってやっぱ楽しいんだから
4geru
1
88
横断組織として考える共通DBの課題解決 〜 桃園の誓いアーキテクチャ 〜 / Addressing Shared Database Challenges as Cross-Team: “Peach Garden Oath” Architecture
4geru
2
860
Supabase Edge Functions で最近追加された AI 機能を使ってみた
4geru
0
340
福山ネーター LINE DC ハッカソン 2023 @福山
4geru
0
130
Google Form とちょっと 仲良くなった話。
4geru
0
53
Flutter x Graph
4geru
0
240
Github Discussions がイケてる
4geru
0
800
Flutter Academy final presentatoin
4geru
0
38
ハッカソン x Gatsby
4geru
0
58
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
KATA
mclloyd
29
14k
BBQ
matthewcrist
85
9.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
How to Ace a Technical Interview
jacobian
276
23k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Transcript
4VQBCBTFY3VCZPO3BJMT 4IJOKVLVSC͖ͳͷհ-5େձ!HFSV
͛͠Δ!HFSV 9 چ5XJUUFS ɿ!@HFSV ॴଐɿϚωʔϑΥϫʔυ झຯɿ📷🎱🐟🤿✈ ՝֎׆ಈɿ ɾ-*/&"1*&YQFSU ɾ,BJHJPO3BJMTPSHBOJ[FS ࣗݾհ
None
None
4VQBCBTF-PWF🩷
݄ʹ4VQBCBTFͷ (" ਖ਼ࣜ൛ϦϦʔε
ੈք֤Ͱ ϛʔτΞοϓ ͕։࠵ʂʂ
4VQBCBTFͬͯͳΜͳΜʁ ڭ͑ͯ$IBU(15ઌੜʂ ɾ1PTUHSF42-Λϕʔεʹͨ͠σʔλϕʔεཧ ɾࣗಈੜ͞Εͨ"1*Λ௨ͨ͡σʔλΞΫηεʢ3&45GVM͓Αͼ(SBQI2-ʣ ɾϦΞϧλΠϜػೳʹΑΓσʔλมߋΛଈ࣌ө ɾೝূͱϢʔβʔཧػೳʢϝʔϧɺ0"VUIɺి൪߸ೝূͳͲʣ ɾετϨʔδαʔϏεͰϑΝΠϧͷΞοϓϩʔυɾμϯϩʔυΛཧ ɾαʔόʔϨεؔʹΑΔΧελϜϩδοΫͷ࣮ʢ&EHF'VODUJPOTʣ ɾϒϥβϕʔεͷཧπʔϧʢ4VQBCBTF4UVEJPʣͰσʔλϕʔεػೳ Λࢹ֮తʹཧ
4VQBCBTFਪ͠ͳΜͰ͢ʂ ͛͠ΔɻΦεεϝϙΠϯτʂ ɾ6*͕γϯϓϧʂԼతͳૢ࡞ ɹɾϒϥβͰςʔϒϧ֬ೝɺ42-࣮ߦՄೳ ɾαϯϓϧίʔυ͕ଟ͍ʂʂ ɹɾࠓճͷ-5αϯϓϧίʔυΛࢀߟʹʂ ɾ෦తʹར༻͍͢͠ ɹɾαʔόʔϨεɺ"VUIɺ(SBQI2-ɺ"*ͳͲར༻Մೳ ɾແྉͰ͑Δػೳ͕ଟ͍
(FUUJOHTUBSUFEXJUI3VCZPO3BJMTBOE 1PTUHSFTPO4VQBCBTF IUUQTTVQBCBTFDPNCMPHSVCZPOSBJMTQPTUHSFT
3BJMTΞϓϦͷͷ࡞ 4UFQ3BJMTͷઃఆ rails new blog -d=postgresql export DATABASE_URL=postgres://postgresxxxx/postgres
4VQBCBTF1SPKFDUͷ࡞ 4UFQ4VQBCBTFͷઃఆ ɾIUUQTTVQBCBTFDPNEBTICPBSEOFXOFXQSPKFDU͔Β 4VQBCBTFͷϓϩδΣΫτΛ࡞
ɾڥมͷઃఆΛͨ͠ͷͰɺ͏ଓ͕Մೳʂ %#ͷNJHSBUJPOͷ࣮ߦ 4UFQ4VQBCBTFͷઃఆ bin/rails generate scaffold Article title:string body:text bin/rails
db:migrate
4VQBCBTF1SPKFDUͷ࡞ 4UFQ4VQBCBTFͷઃఆ ɾ4VQBCBTFʹςʔϒϧ͕࡞͞ΕΔ
ɾͪΖΜSBJMTDPOTPMF͔Βσʔλͷ࡞ɺࢀর͕Մೳʂ SBJMTDPOTPMF͔ΒσʔλͷՃ bin/rails console article = Article.new( title: "Hello Rails”,
body: "I am on Rails!” ) article.save # Saves the entry to the database Article.all 4UFQ4VQBCBTFͷઃఆ
࡞ͨ͠σʔλͷ֬ೝ 4UFQ4VQBCBTFͷઃఆ ɾ4VQBCBTFʹσʔλ͕Ճ͞ΕΔ
ɾͪΖΜϩʔΧϧͰSBJMTTFSWFSىಈ͠·͢ʂ SBJMTTFSWFSͷ࣮ߦ bin/rails server 4UFQ4VQBCBTFͷઃఆ
None
ɾ fl ZJPʹ3BJMTΞϓϦΛσϓϩΠ͠·͢ɻ GMZJPʹσϓϩΠ 4UFQ fl ZJPʹσϓϩΠ fly launch #
=> select postgresql = none fly secrets set DATABASE_URL=$DATABASE_URL fly deploy fly apps open
None
͋ΕʁGMZJP ಥવग़͖ͯͨʁ
4VQBCBTF͚ͩͰ 3BJMTಈ͔ͳ͍ʜ
GMZJPͬͯͳΜͳΜʁ ɾϚΠΫϩ7.ϕʔεͷΞʔΩςΫνϟʹΑΓɺܰྔͰߴͳԾϚγϯΛ༻ͨ͠σϓϩΠ͕Մೳɻ ɾάϩʔόϧͳΤοδωοτϫʔΫΛ׆༻͠ɺΞϓϦέʔγϣϯΛϢʔβʔͷۙ͘Ͱ࣮ߦ͢Δ͜ͱͰϨΠςϯ γΛ࠷খԽɻ ɾࣗಈεέʔϦϯάʹΑΓɺτϥϑΟοΫͷ૿ݮʹԠͯ͡ϦιʔεΛಈతʹௐɻ ɾσʔλϕʔεϗεςΟϯάʢ1PTUHSF42-ͳͲʣͰɺΞϓϦέʔγϣϯͷσʔλཧΛγʔϜϨεʹ౷߹ɻ ɾΧελϜυϝΠϯͱ5-4ূ໌ॻͷࣗಈཧΛαϙʔτ͠ɺηΩϡΞͳ௨৴Λอূɻ ɾαʔόʔϨεΞϓϦέʔγϣϯͷϗεςΟϯάΛαϙʔτ͠ɺؔίϯςφϕʔεͷΞϓϦέʔγϣϯΛ ؆୯ʹσϓϩΠՄೳɻ ɾϩʔϧΞτͱϩʔϧόοΫػೳʹΑΓɺ৽͍͠ϦϦʔεͷಋೖͱൃੜ࣌ͷਝͳϦόʔτ͕Մೳɻ
ɾแׅతͳσϓϩΠπʔϧΛఏڙ͠ɺ$*$%ύΠϓϥΠϯͱͷ౷߹͕༰қɻ ڭ͑ͯ$IBU(15ઌੜʂ
͋ΕʁGMZJPͰ QPTHSFTRM͑Δʁ
GMZJP͚ͩͰྑ͘ͳ͍ʁ ɾϒϥβͰ%#4DIFNB σʔλͷ֬ೝ 42-࣮ߦ͕Ͱ͖Δ ɾαʔόʔϨεͰ"*ͷػೳͳͲॊೈʹௐͰ͖Δ ɾ"1*(SBQI2-Λࣗಈ࡞ͰɺϞόΠϧɺϑϩϯτͱͷ૬ੑ˕ ɾ%"5"#"4&@63-ͷઃఆ͚ͩͰɺMPDBMTUHಉ͡σʔλ͕͑Δ ɾGMZJPͱൺͯ%#ͷίετ͕͍҆ 3BJMTҎ֎ʹ4VQBCBTFΛ͏ϝϦοτ͕͋Δʂ
4VQBCBTF ͍Ζ͍ΖࢼͤΔ💪
4VQBCBTFͰ 3VCZPO3BJMT ಈ͘Α͏ʹͯ͠΄͍͠ʂ
4VQBCBTF ·ͩதʂʂ
4VQBCBTF-PWF🩷