Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ecto, você sabe o que é ?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Amanda
August 06, 2016
Technology
250
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ecto, você sabe o que é ?
Palestra apresentada no encontro do ELUG-SP
Amanda
August 06, 2016
More Decks by Amanda
See All by Amanda
Lessons Learned From an Elixir OTP Project
amandasposito
2
110
Aprendizados de um projeto Elixir OTP
amandasposito
4
650
SOLID - Dependency inversion principle
amandasposito
0
100
Como concorrência funciona em Elixir?
amandasposito
1
240
Programação Funcional & Elixir
amandasposito
3
140
Novidades no Rails 5
amandasposito
0
110
Rails Engines & RSpec
amandasposito
0
250
Elixir e Phoenix
amandasposito
3
600
Elixir em 5 minutos
amandasposito
1
110
Other Decks in Technology
See All in Technology
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
190
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
340
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.6k
パッチ更新でterraform initが落ちた日
grimoh
1
140
WasmをRustにする
sansantech
PRO
0
250
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
190
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
290
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
220
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
990
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
GitHub's CSS Performance
jonrohan
1033
470k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Transcript
Ecto Você sabe o que é?
@amandasposito @amsposito @amandasposito
None
Agenda • O que é? • Seus benefícios; • Componentes;
• Novidades da última versão.
O que é?
“Ecto is a domain specific language for writing queries and
interacting with databases in Elixir.”
object-relational mapping
object-relational mapping
None
Inspiração
LINQ Language Integrated Query
Parte do .NET Framework - Nov/2007
C#
Ecto
None
Vantagens
Composição
Você pode continuar a usar uma query em outra parte
do codigo
None
Isso é possível por causa dos Protocols de Elixir
None
Protocols ?
"Elixir provides protocols as a mechanism for polymorphism." http://elixir-lang.org/getting-started/protocols.html http://blog.plataformatec.com.br/2014/09/writing-assertive-code-with-elixir/
None
Sobre dados
Evita SQL injection
Interpolação e Casting de dados
Valores externos e expressões em Elixir podem ser adicionados a
uma query com ^ http://elixir-lang.org/getting-started/pattern-matching.html#the-pin-operator
None
None
Type safety
name == 1 ** (Ecto.Query.TypeCheckError) the following expression does not
type check:
Componentes
• Repo • Schema • Changeset • Query
Nosso modelo de dados
None
Ecto.Repo
Repo.all(query) https://hexdocs.pm/ecto/Ecto.Repo.html
Repo.start_link()
Ecto.Schema
None
None
None
Ecto.Changeset
None
None
None
Ecto.Query
None
None
https://hexdocs.pm/ecto/Ecto.Query.html#preload
https://hexdocs.pm/ecto/Ecto.Query.html#preload
https://hexdocs.pm/ecto/Ecto.Query.html#join/5
https://hexdocs.pm/ecto/Ecto.Query.html#join/5
https://hexdocs.pm/ecto/Ecto.Query.html#join/5
https://hexdocs.pm/ecto/Ecto.Query.html#preload
https://hexdocs.pm/ecto/Ecto.Query.html#preload
Novidades da última versão
Model -> Schema
Insert_all *http://blog.plataformatec.com.br/2016/05/ectos-insert_all-and-schemaless-queries/
None
Relacionamentos many_to_many
Subqueries
Chaves compostas
Otimização em connection pooling *https://github.com/elixir-ecto/ecto/releases/tag/v2.0.0 *http://blog.plataformatec.com.br/2016/04/ecto-2-0-0-rc-is-out/
Testes concorrentes, mesmo dependendo do banco de dados
Falei de mais né? Falei de mais né?
Resumindo
É uma Lib para você poder interagir com o banco
de dados
Consegue escrever queries no banco de dados escrevendo código Elixir
Composição / SQL Injection / Type Safety
Repo / Schema / Changeset / Query
https://github.com/amandasposito/ecto_demo
Obrigada!
Referências • http://blog.plataformatec.com.br/2016/05/ectos-insert_all-and-schemaless-queries/ • http://blog.plataformatec.com.br/2016/04/ecto-2-0-0-rc-is-out/ • https://hexdocs.pm/ecto/Ecto.html • https://github.com/elixir-ecto/ecto/wiki/Ecto-Basics •
https://changelog.com/208/ • https://www.youtube.com/watch?v=SJRfujy9vLA&feature=youtu.be&t=18m38s • https://www.youtube.com/watch?v=snka1bAtZS0