Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
connection
models
.gitignore
README
adapter_test.rb
connection.example.yml
schema.native_mysql.expected.rb
schema.native_postgresql.expected.rb
schema.oracle_enhanced.expected.rb
schema_dumper_test.rb
test_helper.rb
view_model_test.rb
view_operations_test.rb

README

== Executing Tests

First create the test database: rails_sql_views_unittest 

Next, copy test/connection.example.yml to test/connection.yml and change the
settings to match your database configuration that you are testing.

To run the tests either use:

  rake
 
Which will run the MySQL tests, or use something like the following:

  rake DB=native_postgresql
 
Substituting the directory name inside the connection directory.

== Status

Currently the following adapters have been tested:

* MySQL
* PostgreSQL Pure Ruby
 
The Oracle and SQL Server adapters have not been tested by me.

== Implementing Adapters

If you would like to implement an adapter, it should go in 
lib/rails_sql_views/connection_adapters. Follow the conventions
of the other adapters currently implemented. Every adapter must implement the 
following methods:

  supports_views?
  base_tables(name = nil)
  views(name = nil)
  view_select_statement(view, name=nil)
  
The suports_views? method must return true. The views method must return an 
array of all view names. The view_select_statement method must return the 
select statement used to construct the specified view.

In addition you must include the following for testing purposes:

The script which establishes the database connection in ActiveRecord:

  test/connection/driver_name/connection.rb
  
The schema to setup the test database in your drivers native form:

  test/connection/driver_name/schema.sql
  
The expected schema output from a schema dump. Note that it must be formatted 
*exactly* as the output would be:
  
  test/schema.driver_name.out.rb
  
Once this is done you should send the diff of the changes to 
anthonyeden@gmail.com. Any questions can also be emailed to this address.

== Known Issues

* If you are running on Rails 1.1.6 then the schema dumper test will fail because the formatting of the schema output has changed between 1.1.6 and 1.2.