Coder Social home page Coder Social logo

jesseproudman / rails_sql_views Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webhoernchen/rails_sql_views

0.0 2.0 0.0 175 KB

Rails SQL Views project extracted from ActiveWarehouse

Home Page: http://activewarehouse.rubyforge.org/rails_sql_views

License: MIT License

Ruby 100.00%

rails_sql_views's Introduction

== Rails SQL Views

Library which adds SQL Views to Rails. Adds create_view and drop_view to the ActiveRecord::ConnectionAdapters::AbstractAdapter (which makes them available to migrations) and adds support for dumping views in the ActiveRecord::SchemaDumper.

== Installation

To install:

  gem install rails_sql_views
 
Then add the following to your Rails config/environment.rb:

  require_gem 'rails_sql_views'
  require 'rails_sql_views'

== Usage

You can then use create_view and drop_view in your migrations. For example:

  class CreatePersonView < ActiveRecord::Migration
    def self.up
      create_view :v_people, "select * from people" do |t|
        t.column :id
        t.column :name
        t.column :social_security
      end
    end

    def self.down
      drop_view :v_people
    end
  end
  
This extension also adds support for views in the ActiveRecord::SchemaDumper class.

The following drivers are supported:

 MySQL
 PostgreSQL (Native and Pure Ruby)
 Oracle
 SQL Server

== Known Issues

* Drivers not mentioned above are not supported.

If you find any issues please send an email to [email protected] .

== Contributing

If you would like to implement view support for other adapters then please drop me an email. Better yet, write up the adapter modifications and send them to me. :-)

rails_sql_views's People

Contributors

aeden avatar mainej avatar mschuerig avatar nragaz avatar rca avatar robertwahler avatar smtlaissezfaire avatar webhoernchen avatar

Watchers

 avatar  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.