activerecord7-redshift-adapter-pennylane 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record/connection_adapters/redshift_7_0/schema_statements.rb +14 -16
- data/lib/active_record/connection_adapters/redshift_7_1/database_statements.rb +122 -174
- data/lib/active_record/connection_adapters/redshift_7_1/quoting.rb +78 -16
- data/lib/active_record/connection_adapters/redshift_7_1/schema_statements.rb +14 -16
- data/lib/active_record/connection_adapters/redshift_7_1/type_metadata.rb +18 -14
- data/lib/active_record/connection_adapters/redshift_7_1_adapter.rb +257 -178
- metadata +2 -2
@@ -4,36 +4,40 @@ module ActiveRecord
|
|
4
4
|
module ConnectionAdapters
|
5
5
|
module Redshift
|
6
6
|
class TypeMetadata < DelegateClass(SqlTypeMetadata)
|
7
|
-
|
7
|
+
undef to_yaml if method_defined?(:to_yaml)
|
8
|
+
|
9
|
+
include Deduplicable
|
10
|
+
|
11
|
+
attr_reader :oid, :fmod
|
8
12
|
|
9
13
|
def initialize(type_metadata, oid: nil, fmod: nil)
|
10
14
|
super(type_metadata)
|
11
|
-
@type_metadata = type_metadata
|
12
15
|
@oid = oid
|
13
16
|
@fmod = fmod
|
14
|
-
@array = /\[\]$/ === type_metadata.sql_type
|
15
|
-
end
|
16
|
-
|
17
|
-
def sql_type
|
18
|
-
super.gsub(/\[\]$/, '')
|
19
17
|
end
|
20
18
|
|
21
19
|
def ==(other)
|
22
|
-
other.is_a?(
|
23
|
-
|
20
|
+
other.is_a?(TypeMetadata) &&
|
21
|
+
__getobj__ == other.__getobj__ &&
|
22
|
+
oid == other.oid &&
|
23
|
+
fmod == other.fmod
|
24
24
|
end
|
25
25
|
alias eql? ==
|
26
26
|
|
27
27
|
def hash
|
28
|
-
|
28
|
+
TypeMetadata.hash ^
|
29
|
+
__getobj__.hash ^
|
30
|
+
oid.hash ^
|
31
|
+
fmod.hash
|
29
32
|
end
|
30
33
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
private
|
35
|
+
def deduplicated
|
36
|
+
__setobj__(__getobj__.deduplicate)
|
37
|
+
super
|
35
38
|
end
|
36
39
|
end
|
37
40
|
end
|
41
|
+
RedshiftTypeMetadata = Redshift::TypeMetadata
|
38
42
|
end
|
39
43
|
end
|