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
240
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
740
Supabase Edge Functions で最近追加された AI 機能を使ってみた
4geru
0
320
福山ネーター LINE DC ハッカソン 2023 @福山
4geru
0
120
Google Form とちょっと 仲良くなった話。
4geru
0
52
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
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Designing the Hi-DPI Web
ddemaree
280
34k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Scaling GitHub
holman
458
140k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
YesSQL, Process and Tooling at Scale
rocio
168
14k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Being A Developer After 40
akosma
86
590k
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🩷