Skip to content

Commit 9628923

Browse files
committed
Make sure that native text database type for 2008 is the same as 2005.
1 parent cbf4ff5 commit 9628923

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.rdoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11

2-
== Rails SQL Server 2000 & 2005 Adapter
2+
== Rails SQL Server 2000 & 2005 & 2008 Adapter
33

44
The SQL Server adapter for rails is back for ActiveRecord 2.2 and up! We are currently passing all tests and hope to continue to do so moving forward.
55

66

77
== What's New
88

9+
* Now supports SQL Server 2008 too!
910
* Fully tested under 1.9!!! Correctly encodes/decodes UTF-8 types in ruby 1.9 too.
1011
* Now supports both rails 2.2 & 2.3!!!
1112
* An ActiveRecord::Base.execute_procedure method that can be used by classes.
@@ -20,6 +21,13 @@ The SQL Server adapter for rails is back for ActiveRecord 2.2 and up! We are cur
2021
* A block method to run queries within a specific isolation level.
2122
* Automatically reconnects to lost database connections.
2223

24+
25+
==== SQL Server 2008 Support
26+
27+
Because this adapter is primarily coded to SQL Server 2000/2005, it does not take advantage of many of the things in 2008 that would speed up the code. At some point in the future there we be a branch of this code that is specifically targeted for 2008. That adapter version will remove much of the dirty innards of this version that are meant to code around many of their short comings in 2000/2005, the biggest being no limit/offset.
28+
29+
30+
2331
==== Date/Time Data Type Hinting
2432

2533
Both SQL Server 2000 and 2005 do not have native data types for just 'date' or 'time', it only has 'datetime'. To pass the ActiveRecord tests we implemented two simple class methods that can teach your models to coerce column information to be cast correctly. Simply past a list of symbols to either the <tt>coerce_sqlserver_date</tt> or <tt>coerce_sqlserver_time</tt> methods that correspond to 'datetime' columns that need to be cast correctly.

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def native_string_database_type
272272

273273
def native_text_database_type
274274
@@native_text_database_type ||
275-
if sqlserver_2005?
275+
if sqlserver_2005? || sqlserver_2008?
276276
enable_default_unicode_types ? 'nvarchar(max)' : 'varchar(max)'
277277
else
278278
enable_default_unicode_types ? 'ntext' : 'text'

0 commit comments

Comments
 (0)