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
Facilitating Awesome Meetings
lara
50
6.1k
Bash Introduction
62gerente
608
210k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Code Review Best Practice
trishagee
64
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Measuring & Analyzing Core Web Vitals
bluesmoon
3
90
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
A designer walks into a library…
pauljervisheath
202
24k
Building Your Own Lightsaber
phodgson
103
6.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
830
A Modern Web Designer's Workflow
chriscoyier
693
190k
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🩷