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
230
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
横断組織として考える共通DBの課題解決 〜 桃園の誓いアーキテクチャ 〜 / Addressing Shared Database Challenges as Cross-Team: “Peach Garden Oath” Architecture
4geru
2
720
Supabase Edge Functions で最近追加された AI 機能を使ってみた
4geru
0
320
福山ネーター LINE DC ハッカソン 2023 @福山
4geru
0
120
Google Form とちょっと 仲良くなった話。
4geru
0
51
Flutter x Graph
4geru
0
230
Github Discussions がイケてる
4geru
0
740
Flutter Academy final presentatoin
4geru
0
36
ハッカソン x Gatsby
4geru
0
58
GASをハンズオンのAPIサーバーに使ってみた
4geru
1
30
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building an army of robots
kneath
302
42k
Automating Front-end Workflow
addyosmani
1366
200k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
RailsConf 2023
tenderlove
29
890
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
Writing Fast Ruby
sferik
626
61k
GraphQLとの向き合い方2022年版
quramy
43
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
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🩷