Giter VIP home page Giter VIP logo

activerecord-sqlanywhere-adapter's Introduction

=SQL Anywhere ActiveRecord Driver

This is a SQL Anywhere driver for Ruby ActiveRecord. This driver requires the
native SQL Anywhere Ruby driver. To get the native driver, use:

   gem install sqlanywhere

This driver is designed for use with ActiveRecord 3.0.3 and greater.

This driver is licensed under the Apache License, Version 2.

==Making a Connection

The following code is a sample database configuration object.

  ActiveRecord::Base.configurations = {
    'arunit' => {
      :adapter  => 'sqlanywhere', 
      :database => 'arunit',       #equivalent to the "DatabaseName" parameter
      :server   => 'arunit',       #equivalent to the "ServerName" parameter
      :username => 'dba',          #equivalent to the "UserID" parameter
      :password => 'sql',          #equivalent to the "Password" parameter
      :encoding => 'Windows-1252', #equivalent to the "CharSet" parameter
      :commlinks => 'TCPIP()',     #equivalent to the "Commlinks" parameter
      :connection_name => 'Rails'  #equivalent to the "ConnectionName" parameter
  }

==Running the ActiveRecord Unit Test Suite

1. Open <tt><ACTIVERECORD_INSTALL_DIR>/rakefile</tt> and modify the line:

      for adapter in %w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase openbase frontbase )

   to include <tt>sqlanywhere</tt>. It should now look like:

      for adapter in %w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase openbase frontbase sqlanywhere )

2. Create directory to hold the connection definition:
   
      mkdir <ACTIVERECORD_INSTALL_DIR>/test/connections/native_sqlanywhere

3. Copy <tt>test/connection.rb</tt> into the newly created directory.

4. Create the two test databases. These can be created in any directory.

      dbinit -c arunit
      dbinit -c arunit2
      dbsrv11 arunit arunit2

   <b>If the commands cannot be found, make sure you have set up the SQL Anywhere environment variables correctly.</b> For more information review the online documentation here[http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fdbadmin_en11%2Fda-envvar-sect1-3672410.html].

6. Run the unit test suite from the ActiveRecord install directory:

      rake test_sqlanywhere

   <b>If the migration tests fail, make sure you have set up the SQL Anywhere environment variables correctly.</b> For more information review the online documentation here[http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fdbadmin_en11%2Fda-envvar-sect1-3672410.html].

activerecord-sqlanywhere-adapter's People

Contributors

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