rails-sqlserver-2000-2005-adapter 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +39 -0
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +20 -29
- metadata +6 -14
- data/README.textile +0 -0
data/README.rdoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
== Rails SQL Server 2000 & 2005 Adapter
|
3
|
+
|
4
|
+
For Rails/ActiveRecord 2.2 and up. More details to come.
|
5
|
+
|
6
|
+
|
7
|
+
== Installation
|
8
|
+
|
9
|
+
This method is unconfirmed. You can install the adapter as a gem using the following command. Once I confirm this I can give you an example of a config.gem command too. For now I know that rails and/or ActiveRecord expects to find the SQL Server adapter in the vendor/plugins/adapters/sqlserver folder of your rails project.
|
10
|
+
|
11
|
+
$ sudo gem install rails-sqlserver-2000-2005-adapter
|
12
|
+
|
13
|
+
Ruby DBI is required and to my knowledge the ADO DBD driver is no longer supported, meaning that ODBC is the only way to go. During development ancient versions of DBI back to 0.0.23 were tested along with the current latest 0.4.0 version. Because later versions of DBI will be changing many things, IT IS HIGHLY RECOMMENDED that you install 0.4.0 which the examples below show. This is not a compressive how to since ODBC mode requires also that you install Ruby ODBC and possibly FreeTDS.
|
14
|
+
|
15
|
+
$ sudo gem install dbi --version 0.4.0
|
16
|
+
$ sudo gem install dbd-odbc --version 0.2.4
|
17
|
+
|
18
|
+
Optionally configure your gem dependencies in your rails environment.rb file.
|
19
|
+
|
20
|
+
config.gem 'dbi', :version => '0.4.0'
|
21
|
+
config.gem 'dbd-odbc', :version => '0.2.4', :lib => 'dbd/ODBC'
|
22
|
+
|
23
|
+
|
24
|
+
== Contributing
|
25
|
+
|
26
|
+
Please read the RUNNING_UNIT_TESTS file for the details of how to run the unit tests. Bugs can be reported to our lighthouse page at http://rails-sqlserver.lighthouseapp.com/projects/20277-sql-server-05-adapter/overview
|
27
|
+
|
28
|
+
There is also a #rails-sqlserver channel on irc.freenode.net if you want to discuss any topics about the adapter.
|
29
|
+
|
30
|
+
|
31
|
+
== Credits
|
32
|
+
|
33
|
+
Many many people have contributed to this over
|
34
|
+
|
35
|
+
|
36
|
+
== License
|
37
|
+
|
38
|
+
Copyright © 2008. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
39
|
+
|
@@ -108,48 +108,39 @@ module ActiveRecord
|
|
108
108
|
|
109
109
|
end #SQLServerColumn
|
110
110
|
|
111
|
-
# In ADO mode, this adapter will ONLY work on Windows systems,
|
112
|
-
#
|
113
|
-
# available on Windows.
|
111
|
+
# In ADO mode, this adapter will ONLY work on Windows systems, since it relies on
|
112
|
+
# Win32OLE, which, to my knowledge, is only available on Windows.
|
114
113
|
#
|
115
114
|
# This mode also relies on the ADO support in the DBI module. If you are using the
|
116
|
-
# one-click installer of Ruby, then you already have DBI installed, but
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
# to
|
122
|
-
#
|
123
|
-
#
|
124
|
-
# Once you've installed that file, you are ready to go.
|
125
|
-
#
|
115
|
+
# one-click installer of Ruby, then you already have DBI installed, but the ADO module
|
116
|
+
# is *NOT* installed. You will need to get the latest source distribution of Ruby-DBI
|
117
|
+
# from http://ruby-dbi.sourceforge.net/ unzip it, and copy the file from
|
118
|
+
# <tt>src/lib/dbd_ado/ADO.rb</tt> to <tt>X:/Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb</tt>
|
119
|
+
#
|
120
|
+
# You will more than likely need to create the ADO directory. Once you've installed
|
121
|
+
# that file, you are ready to go.
|
122
|
+
#
|
126
123
|
# In ODBC mode, the adapter requires the ODBC support in the DBI module which requires
|
127
|
-
# the Ruby ODBC module.
|
124
|
+
# the Ruby ODBC module. Ruby ODBC 0.996 was used in development and testing,
|
128
125
|
# and it is available at http://www.ch-werner.de/rubyodbc/
|
129
126
|
#
|
130
127
|
# Options:
|
131
128
|
#
|
132
|
-
# * <tt>:mode</tt>
|
133
|
-
# * <tt>:username</tt>
|
134
|
-
# * <tt>:password</tt>
|
135
|
-
# * <tt>:windows_auth</tt>
|
129
|
+
# * <tt>:mode</tt> -- ADO or ODBC. Defaults to ADO.
|
130
|
+
# * <tt>:username</tt> -- Defaults to sa.
|
131
|
+
# * <tt>:password</tt> -- Defaults to empty string.
|
132
|
+
# * <tt>:windows_auth</tt> -- Defaults to "User ID=#{username};Password=#{password}"
|
136
133
|
#
|
137
134
|
# ADO specific options:
|
138
135
|
#
|
139
|
-
# * <tt>:host</tt>
|
140
|
-
# * <tt>:database</tt>
|
141
|
-
# * <tt>:windows_auth</tt>
|
136
|
+
# * <tt>:host</tt> -- Defaults to localhost.
|
137
|
+
# * <tt>:database</tt> -- The name of the database. No default, must be provided.
|
138
|
+
# * <tt>:windows_auth</tt> -- Use windows authentication instead of username/password.
|
142
139
|
#
|
143
140
|
# ODBC specific options:
|
144
141
|
#
|
145
|
-
# * <tt>:dsn</tt>
|
146
|
-
#
|
147
|
-
# ADO code tested on Windows 2000 and higher systems,
|
148
|
-
# running ruby 1.8.2 (2004-07-29) [i386-mswin32], and SQL Server 2000 SP3.
|
149
|
-
#
|
150
|
-
# ODBC code tested on a Fedora Core 4 system, running FreeTDS 0.63,
|
151
|
-
# unixODBC 2.2.11, Ruby ODBC 0.996, Ruby DBI 0.0.23 and Ruby 1.8.2.
|
152
|
-
# [Linux strongmad 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686 i386 GNU/Linux]
|
142
|
+
# * <tt>:dsn</tt> -- Defaults to nothing.
|
143
|
+
#
|
153
144
|
class SQLServerAdapter < AbstractAdapter
|
154
145
|
|
155
146
|
ADAPTER_NAME = 'SQLServer'.freeze
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-sqlserver-2000-2005-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -14,16 +14,8 @@ cert_chain: []
|
|
14
14
|
|
15
15
|
date: 2008-11-19 00:00:00 -08:00
|
16
16
|
default_executable:
|
17
|
-
dependencies:
|
18
|
-
|
19
|
-
name: activerecord
|
20
|
-
version_requirement:
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
-
requirements:
|
23
|
-
- - ">="
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 2.2.0
|
26
|
-
version:
|
17
|
+
dependencies: []
|
18
|
+
|
27
19
|
description: SQL Server 2000 & 2005 Adapter For Rails.
|
28
20
|
email: ken@metaskills.net
|
29
21
|
executables: []
|
@@ -31,12 +23,12 @@ executables: []
|
|
31
23
|
extensions: []
|
32
24
|
|
33
25
|
extra_rdoc_files:
|
34
|
-
- README.
|
26
|
+
- README.rdoc
|
35
27
|
files:
|
36
28
|
- CHANGELOG
|
37
29
|
- MIT-LICENSE
|
38
30
|
- Rakefile
|
39
|
-
- README.
|
31
|
+
- README.rdoc
|
40
32
|
- RUNNING_UNIT_TESTS
|
41
33
|
- autotest
|
42
34
|
- autotest/discover.rb
|
@@ -52,7 +44,7 @@ rdoc_options:
|
|
52
44
|
- --line-numbers
|
53
45
|
- --inline-source
|
54
46
|
- --main
|
55
|
-
- README.
|
47
|
+
- README.rdoc
|
56
48
|
require_paths:
|
57
49
|
- lib
|
58
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/README.textile
DELETED
File without changes
|