SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
RELATIONAL ALGEBRA
         @tomas_stefano
https://github.com/tomas-stefano
PRIMEIRO ...
VISITORS PATTERN
“TOMAS ... NÃO ENTENDI
       NADA!!”
SHOW ME THE CODE!

users = Arel::Table.new(:users)

users.project('*').to_sql
=> “SELECT * FROM users”
THE VISITOR DISPATCH
# Quando você escreve:
users.project('*')

# Então por “baixo dos panos” dentro do Visitor:
{
    Arel::Nodes::SelectStatement =>"visit_Arel_Nodes_SelectStatement",
    Arel:SqlLiteral => "visit_Arel_SqlLiteral",
    Arel::Table => "visit_Arel_Table"
}
MIXED CASE
QUERIA CRIAR ALGO EM C
CRIAR ALGO QUE PRECISA
      SER RÁPIDO!
RELATION! EM C! E WRAPPER
        EM RUBY!
CURRENT STATUS!
MAS ESTÁ PROGREDINDO!
products = Relation::Table.new(:products)

products.select('*').to_sql
"SELECT * FROM products"

products.where("company = 'SuccesSoft'").to_sql
=>"SELECT * FROM products WHERE company = 'SuccesSoft'"

products.limit(1).to_sql
=> "SELECT * FROM products LIMIT 1"

                 # E Ainda Tem muito mais!!
BENCHMARK PREMATURO!
MAS TÁ MUITO RÁPIDO! =P
C É DIFÍCIL!
O COMEÇO É DÍFICIL!
MAS O TDD AJUDA!
E NO FINAL DO PLACAR:
      C vs TOMAS
CREIO QUE GANHEI! K.O!
COMING SOON!
OBRIGADO! ;)




         @tomas_stefano
https://github.com/tomas-stefano
REFERÊNCIAS DAS IMAGENS
• http://www.magopaco.com/

• http://mislav.uniqpath.com/poignant-guide/images/
 the.foxes-4a.png

• http://pecademissaoevatrabalhar.files.wordpress.com/2007/05/
 ideia.jpg

• http://www.globalnerdy.com/wordpress/wp-content/uploads/
 2010/08/chunkybacon.png

Weitere ähnliche Inhalte

Ähnlich wie Relational Algebra

Ähnlich wie Relational Algebra (6)

Perkenalan ReasonML
Perkenalan ReasonMLPerkenalan ReasonML
Perkenalan ReasonML
 
Introduction to ReasonML
Introduction to ReasonMLIntroduction to ReasonML
Introduction to ReasonML
 
Rails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power StackRails, Postgres, Angular, and Bootstrap: The Power Stack
Rails, Postgres, Angular, and Bootstrap: The Power Stack
 
Ruby gems
Ruby gemsRuby gems
Ruby gems
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, Badoo"Writing Maintainable JavaScript". Jon Bretman, Badoo
"Writing Maintainable JavaScript". Jon Bretman, Badoo
 

Mehr von SuccesSoft LTDA (6)

Testes Rápidos
Testes RápidosTestes Rápidos
Testes Rápidos
 
Machinist-caching
Machinist-cachingMachinist-caching
Machinist-caching
 
Fun driven development com Ruby
Fun driven development com RubyFun driven development com Ruby
Fun driven development com Ruby
 
Infinity test and RVM
Infinity test and RVMInfinity test and RVM
Infinity test and RVM
 
Cucumber and BDD
Cucumber and BDDCucumber and BDD
Cucumber and BDD
 
Desenvolvimento orientado à introspecção
Desenvolvimento orientado à introspecçãoDesenvolvimento orientado à introspecção
Desenvolvimento orientado à introspecção
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Relational Algebra