Giter Club home page Giter Club logo

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

abachman avatar aeden avatar laripk avatar mainej avatar mschuerig avatar nragaz avatar rca avatar rgabo avatar robertwahler avatar smtlaissezfaire avatar webhoernchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

astashov bval undev

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.