Giter Site home page Giter Site logo

sql-orm-web-0616's Introduction

Connecting SQL to Ruby

Objective:

  • Understand how Ruby can use SQL to access data.

So far, we've written Ruby methods that can create, edit, update and destroy classes and instances. We've also seen how we can persist data in a SQLite database and write SQL queries to access that data. But, how would we give a Ruby program access to this data? We need to understand how we can write Ruby methods that our program can use to retrieve our data.

Instructions:

Please work with a partner to fill in the methods outlined in sql_manager.rb. Our goal is to write methods that will query our database so that our program can use the following methods to return our data:

  • Book.all (written for you)
  • Book.find(1)
  • book = Book.new
  • book.title = 'huck finn'
  • book.page_count = 300
  • book.insert
  • book.destroy
  • book.update

When you've finished, create a pull request with your code. Please add your partner's name in a comment so we'll know who you worked with.

sql-orm-web-0616's People

Contributors

leighsn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.