activerecord-fb-adapter 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,6 @@
|
|
3
3
|
# Based originally on FireRuby extension by Ken Kunz <kennethkunz@gmail.com>
|
4
4
|
|
5
5
|
require 'active_record/connection_adapters/abstract_adapter'
|
6
|
-
# require 'active_support/core_ext/kernel/requires'
|
7
6
|
require 'base64'
|
8
7
|
|
9
8
|
module Arel
|
@@ -160,7 +159,7 @@ module ActiveRecord
|
|
160
159
|
#
|
161
160
|
# === Sequence (Generator) Names
|
162
161
|
# The Fb adapter supports the same approach adopted for the Oracle
|
163
|
-
# adapter. See ActiveRecord::
|
162
|
+
# adapter. See ActiveRecord::ModelSchema::ClassMethods#sequence_name= for more details.
|
164
163
|
#
|
165
164
|
# Note that in general there is no need to create a <tt>BEFORE INSERT</tt>
|
166
165
|
# trigger corresponding to a Firebird sequence generator when using
|
@@ -257,9 +256,9 @@ module ActiveRecord
|
|
257
256
|
@@boolean_domain = { :true => 1, :false => 0, :name => 'BOOLEAN', :type => 'integer' }
|
258
257
|
cattr_accessor :boolean_domain
|
259
258
|
|
260
|
-
def initialize(connection, logger,
|
259
|
+
def initialize(connection, logger, config=nil)
|
261
260
|
super(connection, logger)
|
262
|
-
@
|
261
|
+
@config = config
|
263
262
|
@visitor = Arel::Visitors::FB.new(self)
|
264
263
|
end
|
265
264
|
|
@@ -299,8 +298,7 @@ module ActiveRecord
|
|
299
298
|
false
|
300
299
|
end
|
301
300
|
|
302
|
-
# Does this adapter support savepoints?
|
303
|
-
# does not.
|
301
|
+
# Does this adapter support savepoints? FirebirdSQL does
|
304
302
|
def supports_savepoints?
|
305
303
|
true
|
306
304
|
end
|
@@ -343,7 +341,7 @@ module ActiveRecord
|
|
343
341
|
# new connection with the database.
|
344
342
|
def reconnect!
|
345
343
|
disconnect!
|
346
|
-
@connection = Fb::Database.connect(@
|
344
|
+
@connection = Fb::Database.connect(@config)
|
347
345
|
end
|
348
346
|
|
349
347
|
# Disconnects from the database if already connected. Otherwise, this
|
@@ -363,10 +361,10 @@ module ActiveRecord
|
|
363
361
|
end
|
364
362
|
|
365
363
|
# Returns true if its required to reload the connection between requests for development mode.
|
366
|
-
# This is not the case for
|
367
|
-
|
368
|
-
|
369
|
-
|
364
|
+
# This is not the case for FirebirdSQL and it's not necessary for any adapters except SQLite.
|
365
|
+
def requires_reloading?
|
366
|
+
false
|
367
|
+
end
|
370
368
|
|
371
369
|
# Checks whether the connection to the database is still active (i.e. not stale).
|
372
370
|
# This is done under the hood by calling <tt>active?</tt>. If the connection
|
@@ -685,9 +683,9 @@ module ActiveRecord
|
|
685
683
|
end
|
686
684
|
sql
|
687
685
|
end
|
688
|
-
|
689
|
-
def default_sequence_name(table_name, column=nil)
|
690
|
-
"#{table_name}_seq"
|
686
|
+
|
687
|
+
def default_sequence_name(table_name, column = nil)
|
688
|
+
"#{table_name.to_s[0, table_name_length - 4]}_seq"
|
691
689
|
end
|
692
690
|
|
693
691
|
# Set the sequence to the max value of the table's column.
|
@@ -697,7 +695,7 @@ module ActiveRecord
|
|
697
695
|
end
|
698
696
|
|
699
697
|
def next_sequence_value(sequence_name)
|
700
|
-
select_one("SELECT
|
698
|
+
select_one("SELECT NEXT VALUE FOR #{sequence_name} FROM RDB$DATABASE").values.first
|
701
699
|
end
|
702
700
|
|
703
701
|
# Inserts the given fixture into the table. Overridden in adapters that require
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-fb-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fb
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.7.
|
21
|
+
version: 0.7.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.7.
|
29
|
+
version: 0.7.1
|
30
30
|
description:
|
31
31
|
email: rowland@rowlandresearch.com
|
32
32
|
executables: []
|