activerecord-jdbc-adapter 0.9.7-java → 1.0.0.beta1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/History.txt +11 -0
  2. data/Manifest.txt +71 -38
  3. data/lib/active_record/connection_adapters/cachedb_adapter.rb +1 -1
  4. data/lib/active_record/connection_adapters/derby_adapter.rb +1 -13
  5. data/lib/active_record/connection_adapters/h2_adapter.rb +1 -13
  6. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +1 -13
  7. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -1
  8. data/lib/active_record/connection_adapters/jdbc_adapter.rb +1 -661
  9. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -1
  10. data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -13
  11. data/lib/active_record/connection_adapters/mysql_adapter.rb +1 -13
  12. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -1
  13. data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -13
  14. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -13
  15. data/lib/activerecord-jdbc-adapter.rb +2 -2
  16. data/lib/arjdbc.rb +29 -0
  17. data/lib/arjdbc/cachedb.rb +3 -0
  18. data/lib/arjdbc/cachedb/adapter.rb +20 -0
  19. data/lib/arjdbc/cachedb/connection_methods.rb +10 -0
  20. data/lib/arjdbc/db2.rb +2 -0
  21. data/lib/{jdbc_adapter/jdbc_db2.rb → arjdbc/db2/adapter.rb} +1 -17
  22. data/lib/arjdbc/derby.rb +7 -0
  23. data/lib/{jdbc_adapter/jdbc_derby.rb → arjdbc/derby/adapter.rb} +8 -26
  24. data/lib/arjdbc/derby/connection_methods.rb +18 -0
  25. data/lib/arjdbc/discover.rb +99 -0
  26. data/lib/arjdbc/firebird.rb +2 -0
  27. data/lib/{jdbc_adapter/jdbc_firebird.rb → arjdbc/firebird/adapter.rb} +12 -16
  28. data/lib/arjdbc/h2.rb +4 -0
  29. data/lib/arjdbc/h2/adapter.rb +15 -0
  30. data/lib/arjdbc/h2/connection_methods.rb +12 -0
  31. data/lib/arjdbc/hsqldb.rb +4 -0
  32. data/lib/{jdbc_adapter/jdbc_hsqldb.rb → arjdbc/hsqldb/adapter.rb} +6 -58
  33. data/lib/arjdbc/hsqldb/connection_methods.rb +14 -0
  34. data/lib/arjdbc/informix.rb +3 -0
  35. data/lib/{jdbc_adapter/jdbc_informix.rb → arjdbc/informix/adapter.rb} +6 -19
  36. data/lib/arjdbc/informix/connection_methods.rb +10 -0
  37. data/lib/arjdbc/jdbc.rb +2 -0
  38. data/lib/arjdbc/jdbc/adapter.rb +235 -0
  39. data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
  40. data/lib/arjdbc/jdbc/callbacks.rb +44 -0
  41. data/lib/arjdbc/jdbc/column.rb +38 -0
  42. data/lib/arjdbc/jdbc/compatibility.rb +51 -0
  43. data/lib/arjdbc/jdbc/connection.rb +97 -0
  44. data/lib/arjdbc/jdbc/connection_methods.rb +16 -0
  45. data/lib/arjdbc/jdbc/core_ext.rb +24 -0
  46. data/lib/arjdbc/jdbc/discover.rb +18 -0
  47. data/lib/arjdbc/jdbc/driver.rb +44 -0
  48. data/lib/arjdbc/jdbc/extension.rb +47 -0
  49. data/lib/arjdbc/jdbc/java.rb +14 -0
  50. data/lib/{jdbc_adapter → arjdbc/jdbc}/jdbc.rake +0 -0
  51. data/lib/{jdbc_adapter → arjdbc/jdbc}/missing_functionality_helper.rb +5 -5
  52. data/lib/arjdbc/jdbc/quoted_primary_key.rb +28 -0
  53. data/lib/{jdbc_adapter → arjdbc/jdbc}/railtie.rb +1 -1
  54. data/lib/{jdbc_adapter → arjdbc/jdbc}/rake_tasks.rb +0 -0
  55. data/lib/arjdbc/jdbc/require_driver.rb +16 -0
  56. data/lib/arjdbc/jdbc/type_converter.rb +119 -0
  57. data/lib/arjdbc/mimer.rb +2 -0
  58. data/lib/{jdbc_adapter/jdbc_mimer.rb → arjdbc/mimer/adapter.rb} +16 -19
  59. data/lib/arjdbc/mssql.rb +4 -0
  60. data/lib/{jdbc_adapter/jdbc_mssql.rb → arjdbc/mssql/adapter.rb} +19 -31
  61. data/lib/arjdbc/mssql/connection_methods.rb +13 -0
  62. data/lib/{jdbc_adapter → arjdbc/mssql}/tsql_helper.rb +1 -1
  63. data/lib/arjdbc/mysql.rb +4 -0
  64. data/lib/arjdbc/mysql/adapter.rb +388 -0
  65. data/lib/arjdbc/mysql/connection_methods.rb +26 -0
  66. data/lib/arjdbc/oracle.rb +3 -0
  67. data/lib/{jdbc_adapter/jdbc_oracle.rb → arjdbc/oracle/adapter.rb} +9 -17
  68. data/lib/arjdbc/oracle/connection_methods.rb +11 -0
  69. data/lib/arjdbc/postgresql.rb +4 -0
  70. data/lib/{jdbc_adapter/jdbc_postgre.rb → arjdbc/postgresql/adapter.rb} +7 -36
  71. data/lib/arjdbc/postgresql/connection_methods.rb +21 -0
  72. data/lib/arjdbc/sqlite3.rb +4 -0
  73. data/lib/{jdbc_adapter/jdbc_sqlite3.rb → arjdbc/sqlite3/adapter.rb} +106 -104
  74. data/lib/arjdbc/sqlite3/connection_methods.rb +33 -0
  75. data/lib/arjdbc/sybase.rb +2 -0
  76. data/lib/arjdbc/sybase/adapter.rb +46 -0
  77. data/lib/arjdbc/version.rb +8 -0
  78. data/lib/jdbc_adapter.rb +2 -27
  79. data/lib/jdbc_adapter/version.rb +3 -5
  80. data/rails_generators/templates/config/initializers/jdbc.rb +1 -1
  81. data/rakelib/compile.rake +3 -2
  82. data/rakelib/package.rake +3 -3
  83. data/src/java/{jdbc_adapter/JdbcDerbySpec.java → arjdbc/derby/DerbyModule.java} +32 -32
  84. data/src/java/{jdbc_adapter/JdbcAdapterInternalService.java → arjdbc/jdbc/AdapterJavaService.java} +13 -7
  85. data/src/java/{jdbc_adapter → arjdbc/jdbc}/JdbcConnectionFactory.java +6 -6
  86. data/src/java/{jdbc_adapter → arjdbc/jdbc}/RubyJdbcConnection.java +91 -16
  87. data/src/java/arjdbc/jdbc/SQLBlock.java +48 -0
  88. data/src/java/{jdbc_adapter → arjdbc/mssql}/MssqlRubyJdbcConnection.java +5 -2
  89. data/src/java/{jdbc_adapter/JdbcMySQLSpec.java → arjdbc/mysql/MySQLModule.java} +12 -12
  90. data/src/java/{jdbc_adapter/PostgresRubyJdbcConnection.java → arjdbc/postgresql/PostgresqlRubyJdbcConnection.java} +11 -9
  91. data/src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java +64 -0
  92. data/test/abstract_db_create.rb +4 -1
  93. data/test/activerecord/connection_adapters/type_conversion_test.rb +1 -1
  94. data/test/db/cachedb.rb +0 -0
  95. data/test/db/derby.rb +12 -14
  96. data/test/db/hsqldb.rb +3 -2
  97. data/test/db/jndi_config.rb +4 -4
  98. data/test/db/sqlite3.rb +2 -6
  99. data/test/db2_simple_test.rb +23 -0
  100. data/test/derby_migration_test.rb +50 -3
  101. data/test/jdbc_common.rb +1 -1
  102. data/test/jndi_callbacks_test.rb +1 -0
  103. data/test/postgres_nonseq_pkey_test.rb +0 -2
  104. data/test/postgres_schema_search_path_test.rb +0 -2
  105. data/test/simple.rb +3 -3
  106. data/test/sybase_jtds_simple_test.rb +22 -0
  107. metadata +82 -46
  108. data/lib/active_record/connection_adapters/jdbc_adapter_spec.rb +0 -26
  109. data/lib/jdbc_adapter/jdbc_adapter_internal.jar +0 -0
  110. data/lib/jdbc_adapter/jdbc_cachedb.rb +0 -33
  111. data/lib/jdbc_adapter/jdbc_mysql.rb +0 -260
  112. data/lib/jdbc_adapter/jdbc_sybase.rb +0 -50
  113. data/src/java/jdbc_adapter/SQLBlock.java +0 -27
  114. data/src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java +0 -41
  115. data/test/jdbc_adapter/jdbc_db2_test.rb +0 -26
  116. data/test/jdbc_adapter/jdbc_sybase_test.rb +0 -33
  117. data/test/minirunit.rb +0 -109
  118. data/test/minirunit/testConnect.rb +0 -14
  119. data/test/minirunit/testH2.rb +0 -73
  120. data/test/minirunit/testHsqldb.rb +0 -73
  121. data/test/minirunit/testLoadActiveRecord.rb +0 -3
  122. data/test/minirunit/testMysql.rb +0 -83
  123. data/test/minirunit/testRawSelect.rb +0 -24
@@ -1 +1 @@
1
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/jdbc'
@@ -1,13 +1 @@
1
- tried_gem = false
2
- begin
3
- require "jdbc/jtds"
4
- rescue LoadError
5
- unless tried_gem
6
- require 'rubygems'
7
- gem "jdbc-mssql"
8
- tried_gem = true
9
- retry
10
- end
11
- # trust that the jtds jar is already present
12
- end
13
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/mssql'
@@ -1,13 +1 @@
1
- tried_gem = false
2
- begin
3
- require "jdbc/mysql"
4
- rescue LoadError
5
- unless tried_gem
6
- require 'rubygems'
7
- gem "jdbc-mysql"
8
- tried_gem = true
9
- retry
10
- end
11
- # trust that the mysql jar is already present
12
- end
13
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/mysql'
@@ -1 +1 @@
1
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/oracle'
@@ -1,13 +1 @@
1
- tried_gem = false
2
- begin
3
- require "jdbc/postgres"
4
- rescue LoadError
5
- unless tried_gem
6
- require 'rubygems'
7
- gem "jdbc-postgres"
8
- tried_gem = true
9
- retry
10
- end
11
- # trust that the postgres jar is already present
12
- end
13
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/postgresql'
@@ -1,13 +1 @@
1
- tried_gem = false
2
- begin
3
- require "jdbc/sqlite3"
4
- rescue LoadError
5
- unless tried_gem
6
- require 'rubygems'
7
- gem "jdbc-sqlite3"
8
- tried_gem = true
9
- retry
10
- end
11
- # trust that the sqlite jar is already present
12
- end
13
- require 'active_record/connection_adapters/jdbc_adapter'
1
+ require 'arjdbc/sqlite3'
@@ -1,6 +1,6 @@
1
- require 'jdbc_adapter'
1
+ require 'arjdbc'
2
2
  begin
3
- require 'jdbc_adapter/railtie'
3
+ require 'arjdbc/jdbc/railtie'
4
4
  rescue LoadError
5
5
  # Assume we don't have railties in this version of AR
6
6
  end
@@ -0,0 +1,29 @@
1
+ if defined?(JRUBY_VERSION)
2
+ begin
3
+ tried_gem ||= false
4
+ require 'active_record/version'
5
+ rescue LoadError
6
+ raise if tried_gem
7
+ require 'rubygems'
8
+ gem 'activerecord'
9
+ tried_gem = true
10
+ retry
11
+ end
12
+ if ActiveRecord::VERSION::MAJOR < 2
13
+ if defined?(RAILS_CONNECTION_ADAPTERS)
14
+ RAILS_CONNECTION_ADAPTERS << %q(jdbc)
15
+ else
16
+ RAILS_CONNECTION_ADAPTERS = %w(jdbc)
17
+ end
18
+ if ActiveRecord::VERSION::MAJOR == 1 && ActiveRecord::VERSION::MINOR == 14
19
+ require 'arjdbc/jdbc'
20
+ end
21
+ else
22
+ require 'active_record'
23
+ require 'arjdbc/jdbc'
24
+ end
25
+ else
26
+ warn "ActiveRecord-JDBC is for use with JRuby only"
27
+ end
28
+
29
+ require 'arjdbc/version'
@@ -0,0 +1,3 @@
1
+ require 'arjdbc/jdbc'
2
+ require 'arjdbc/cachedb/connection_methods'
3
+ require 'arjdbc/cachedb/adapter'
@@ -0,0 +1,20 @@
1
+ require 'arjdbc/mssql/tsql_helper'
2
+
3
+ module ::ArJdbc
4
+ module CacheDB
5
+ include TSqlMethods
6
+
7
+ def self.column_selector
8
+ [ /cache/i, lambda { | cfg, col | col.extend( ::ArJdbc::CacheDB::Column ) } ]
9
+ end
10
+
11
+ module Column
12
+ end
13
+
14
+ def create_table(name, options = { })
15
+ super(name, options)
16
+ primary_key = options[:primary_key] || "id"
17
+ execute "ALTER TABLE #{name} ADD CONSTRAINT #{name}_PK PRIMARY KEY(#{primary_key})" unless options[:id] == false
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ class ActiveRecord::Base
2
+ class << self
3
+ def cachedb_connection( config )
4
+ config[:port] ||= 1972
5
+ config[:url] ||= "jdbc:Cache://#{config[:host]}:#{config[:port]}/#{ config[:database]}"
6
+ config[:driver] ||= "com.intersys.jdbc.CacheDriver"
7
+ jdbc_connection(config)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,2 @@
1
+ require 'arjdbc/jdbc'
2
+ require 'arjdbc/db2/adapter'
@@ -1,21 +1,5 @@
1
- module JdbcSpec
1
+ module ArJdbc
2
2
  module DB2
3
- def self.adapter_matcher(name, config)
4
- if name =~ /db2/i
5
- return config[:url] =~ /^jdbc:derby:net:/ ? ::JdbcSpec::Derby : self
6
- end
7
- false
8
- end
9
-
10
- def self.adapter_selector
11
- [/db2/i, lambda {|cfg,adapt|
12
- if cfg[:url] =~ /^jdbc:derby:net:/
13
- adapt.extend(::JdbcSpec::Derby)
14
- else
15
- adapt.extend(::JdbcSpec::DB2)
16
- end }]
17
- end
18
-
19
3
  def self.extended(obj)
20
4
  # Ignore these 4 system tables
21
5
  ActiveRecord::SchemaDumper.ignore_tables |= %w{hmon_atm_info hmon_collection policy stmg_dbsize_info}
@@ -0,0 +1,7 @@
1
+ require 'arjdbc/jdbc'
2
+ jdbc_require_driver 'jdbc/derby'
3
+ require 'arjdbc/derby/connection_methods'
4
+ require 'arjdbc/derby/adapter'
5
+
6
+
7
+
@@ -1,30 +1,9 @@
1
- require 'jdbc_adapter/missing_functionality_helper'
2
-
3
- module ::JdbcSpec
4
- module ActiveRecordExtensions
5
- def derby_connection(config)
6
- require File.dirname(__FILE__) + "/../active_record/connection_adapters/derby_adapter"
7
- config[:url] ||= "jdbc:derby:#{config[:database]};create=true"
8
- config[:driver] ||= "org.apache.derby.jdbc.EmbeddedDriver"
9
- check_version(embedded_driver(config))
10
- end
11
-
12
- def check_version(conn)
13
- md = conn.raw_connection.connection.meta_data
14
- if md.database_major_version < 10 || md.database_minor_version < 5
15
- raise ::ActiveRecord::ConnectionFailed, "Derby adapter requires Derby 10.5 or later"
16
- end
17
- conn
18
- end
19
- end
1
+ require 'arjdbc/jdbc/missing_functionality_helper'
20
2
 
3
+ module ::ArJdbc
21
4
  module Derby
22
- def self.adapter_matcher(name, *)
23
- name =~ /derby/i ? self : false
24
- end
25
-
26
5
  def self.column_selector
27
- [/derby/i, lambda {|cfg,col| col.extend(::JdbcSpec::Derby::Column)}]
6
+ [/derby/i, lambda {|cfg,col| col.extend(::ArJdbc::Derby::Column)}]
28
7
  end
29
8
 
30
9
  def self.monkey_rails
@@ -76,7 +55,11 @@ module ::JdbcSpec
76
55
  'Derby'
77
56
  end
78
57
 
79
- include JdbcSpec::MissingFunctionalityHelper
58
+ include ArJdbc::MissingFunctionalityHelper
59
+
60
+ def index_name_length
61
+ 128
62
+ end
80
63
 
81
64
  # Convert the speficied column type to a SQL string. In Derby, :integers cannot specify
82
65
  # a limit.
@@ -232,7 +215,6 @@ module ::JdbcSpec
232
215
  super
233
216
  end
234
217
 
235
-
236
218
  # I don't think this method is ever called ??? (stepheneb)
237
219
  def create_column(name, refid, colno)
238
220
  stmt = COLUMN_TYPE_STMT % [refid, strip_quotes(name)]
@@ -0,0 +1,18 @@
1
+ module ActiveRecord
2
+ class Base
3
+ class << self
4
+ def derby_connection(config)
5
+ config[:url] ||= "jdbc:derby:#{config[:database]};create=true"
6
+ config[:driver] ||= "org.apache.derby.jdbc.EmbeddedDriver"
7
+ conn = embedded_driver(config)
8
+ md = conn.raw_connection.connection.meta_data
9
+ if md.database_major_version < 10 || md.database_minor_version < 5
10
+ raise ::ActiveRecord::ConnectionFailed, "Derby adapter requires Derby 10.5 or later"
11
+ end
12
+ conn
13
+ end
14
+
15
+ alias_method :jdbcderby_connection, :derby_connection
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,99 @@
1
+ # arjdbc/discover.rb: Declare ArJdbc.extension modules in this file
2
+ # that loads a custom module and adapter.
3
+
4
+ module ::ArJdbc
5
+ # Adapters built-in to AR are required up-front so we can override
6
+ # the native ones
7
+ require 'arjdbc/mysql'
8
+ extension :MySQL do |name|
9
+ name =~ /mysql/i
10
+ end
11
+
12
+ require 'arjdbc/postgresql'
13
+ extension :PostgreSQL do |name|
14
+ name =~ /postgre/i
15
+ end
16
+
17
+ require 'arjdbc/sqlite3'
18
+ extension :SQLite3 do |name|
19
+ name =~ /sqlite/i
20
+ end
21
+
22
+ # Other adapters are lazy-loaded
23
+ extension :CacheDB do |name|
24
+ if name =~ /cache/i
25
+ require 'arjdbc/cachedb'
26
+ true
27
+ end
28
+ end
29
+
30
+ extension :DB2 do |name, config|
31
+ if name =~ /db2/i && config[:url] !~ /^jdbc:derby:net:/
32
+ require 'arjdbc/db2'
33
+ true
34
+ end
35
+ end
36
+
37
+ extension :Derby do |name|
38
+ if name =~ /derby/i
39
+ require 'arjdbc/derby'
40
+ true
41
+ end
42
+ end
43
+
44
+ extension :FireBird do |name|
45
+ if name =~ /firebird/i
46
+ require 'arjdbc/firebird'
47
+ true
48
+ end
49
+ end
50
+
51
+ extension :H2 do |name|
52
+ if name =~ /\.h2\./i
53
+ require 'arjdbc/h2'
54
+ true
55
+ end
56
+ end
57
+
58
+ extension :HSQLDB do |name|
59
+ if name =~ /hsqldb/i
60
+ require 'arjdbc/hsqldb'
61
+ true
62
+ end
63
+ end
64
+
65
+ extension :Informix do |name|
66
+ if name =~ /informix/i
67
+ require 'arjdbc/informix'
68
+ true
69
+ end
70
+ end
71
+
72
+ extension :Mimer do |name|
73
+ if name =~ /mimer/i
74
+ require 'arjdbc/mimer'
75
+ true
76
+ end
77
+ end
78
+
79
+ extension :MsSQL do |name|
80
+ if name =~ /sqlserver|tds/i
81
+ require 'arjdbc/mssql'
82
+ true
83
+ end
84
+ end
85
+
86
+ extension :Oracle do |name|
87
+ if name =~ /oracle/i
88
+ require 'arjdbc/oracle'
89
+ true
90
+ end
91
+ end
92
+
93
+ extension :Sybase do |name|
94
+ if name =~ /sybase|tds/i
95
+ require 'arjdbc/sybase'
96
+ true
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,2 @@
1
+ require 'arjdbc/jdbc'
2
+ require 'arjdbc/firebird/adapter'
@@ -1,16 +1,12 @@
1
- module ::JdbcSpec
1
+ module ::ArJdbc
2
2
  module FireBird
3
- def self.adapter_matcher(name, *)
4
- name =~ /firebird/i ? self : false
5
- end
6
-
7
3
  def modify_types(tp)
8
4
  tp[:primary_key] = 'INTEGER NOT NULL PRIMARY KEY'
9
5
  tp[:string][:limit] = 252
10
6
  tp[:integer][:limit] = nil
11
7
  tp
12
8
  end
13
-
9
+
14
10
  def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) # :nodoc:
15
11
  execute(sql, name)
16
12
  id_value
@@ -31,11 +27,11 @@ module ::JdbcSpec
31
27
  def default_sequence_name(table_name, primary_key) # :nodoc:
32
28
  "#{table_name}_seq"
33
29
  end
34
-
30
+
35
31
  def next_sequence_value(sequence_name)
36
32
  select_one("SELECT GEN_ID(#{sequence_name}, 1 ) FROM RDB$DATABASE;")["gen_id"]
37
33
  end
38
-
34
+
39
35
  def create_table(name, options = {}) #:nodoc:
40
36
  super(name, options)
41
37
  execute "CREATE GENERATOR #{name}_seq"
@@ -44,7 +40,7 @@ module ::JdbcSpec
44
40
  def rename_table(name, new_name) #:nodoc:
45
41
  execute "RENAME #{name} TO #{new_name}"
46
42
  execute "UPDATE RDB$GENERATORS SET RDB$GENERATOR_NAME='#{new_name}_seq' WHERE RDB$GENERATOR_NAME='#{name}_seq'" rescue nil
47
- end
43
+ end
48
44
 
49
45
  def drop_table(name, options = {}) #:nodoc:
50
46
  super(name)
@@ -62,10 +58,10 @@ module ::JdbcSpec
62
58
  def remove_index(table_name, options) #:nodoc:
63
59
  execute "DROP INDEX #{index_name(table_name, options)}"
64
60
  end
65
-
61
+
66
62
  def quote(value, column = nil) # :nodoc:
67
63
  return value.quoted_id if value.respond_to?(:quoted_id)
68
-
64
+
69
65
  if [Time, DateTime].include?(value.class)
70
66
  "CAST('#{value.strftime("%Y-%m-%d %H:%M:%S")}' AS TIMESTAMP)"
71
67
  else
@@ -79,27 +75,27 @@ module ::JdbcSpec
79
75
  def quote_string(string) # :nodoc:
80
76
  string.gsub(/'/, "''")
81
77
  end
82
-
78
+
83
79
  def quote_column_name(column_name) # :nodoc:
84
80
  %Q("#{ar_to_fb_case(column_name)}")
85
81
  end
86
-
82
+
87
83
  def quoted_true # :nodoc:
88
84
  quote(1)
89
85
  end
90
-
86
+
91
87
  def quoted_false # :nodoc:
92
88
  quote(0)
93
89
  end
94
90
 
95
91
  private
96
-
92
+
97
93
  # Maps uppercase Firebird column names to lowercase for ActiveRecord;
98
94
  # mixed-case columns retain their original case.
99
95
  def fb_to_ar_case(column_name)
100
96
  column_name =~ /[[:lower:]]/ ? column_name : column_name.to_s.downcase
101
97
  end
102
-
98
+
103
99
  # Maps lowercase ActiveRecord column names to uppercase for Fierbird;
104
100
  # mixed-case columns retain their original case.
105
101
  def ar_to_fb_case(column_name)