activerecord6-redshift-adapter 1.1.3 → 1.2.0
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0dc8d364db3ea08cfe01d0eefb993b42c9099a799df7f8daf2dfd94259ac5c7a
|
|
4
|
+
data.tar.gz: cba360ca422639049907bd642d2a1ea391e18c0619207ffc0eeb05ffedd94cff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19cd8ba355241a062c9a1dc06aaf29eb6baf94d716b4f3300644837ad90dfb2fa4c349a9ac816e5c66b899d965bb0057f6eaf5d2dad93f33c14e16eed6ba28cb
|
|
7
|
+
data.tar.gz: b04c5d7c7a57cf69383b376b5714630f3f0ef2f43ac0a8ff980170c08cc0588d26d40f220b703c9ec3979f8bd8cd4843b11bdc9a3d62a5515004aa22049dfe21
|
|
@@ -3,8 +3,18 @@ module ActiveRecord
|
|
|
3
3
|
class RedshiftColumn < Column #:nodoc:
|
|
4
4
|
delegate :oid, :fmod, to: :sql_type_metadata
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
if ActiveRecord::VERSION::MAJOR >= 6 && ActiveRecord::VERSION::MINOR >= 1
|
|
7
|
+
# Required for Rails 6.1, see https://github.com/rails/rails/pull/41756
|
|
8
|
+
mattr_reader :array, default: false
|
|
9
|
+
alias :array? :array
|
|
10
|
+
|
|
11
|
+
def initialize(name, default, sql_type_metadata, null = true, default_function = nil, **)
|
|
12
|
+
super name, default, sql_type_metadata, null, default_function
|
|
13
|
+
end
|
|
14
|
+
else
|
|
15
|
+
def initialize(name, default, sql_type_metadata, null = true, default_function = nil)
|
|
16
|
+
super name, default, sql_type_metadata, null, default_function
|
|
17
|
+
end
|
|
8
18
|
end
|
|
9
19
|
end
|
|
10
20
|
end
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
module ActiveRecord
|
|
2
2
|
module ConnectionAdapters
|
|
3
3
|
module Redshift
|
|
4
|
-
class SchemaCreation < AbstractAdapter::SchemaCreation
|
|
5
|
-
private
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
if ActiveRecord::VERSION::MAJOR >= 6 && ActiveRecord::VERSION::MINOR >= 1
|
|
6
|
+
class SchemaCreation < SchemaCreation
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
def visit_ColumnDefinition(o)
|
|
10
|
+
o.sql_type = type_to_sql(o.type, limit: o.limit, precision: o.precision, scale: o.scale)
|
|
11
|
+
super
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def add_column_options!(sql, options)
|
|
15
|
+
column = options.fetch(:column) { return super }
|
|
16
|
+
if column.type == :uuid && options[:default] =~ /\(\)/
|
|
17
|
+
sql << " DEFAULT #{options[:default]}"
|
|
18
|
+
else
|
|
19
|
+
super
|
|
20
|
+
end
|
|
21
|
+
end
|
|
10
22
|
end
|
|
23
|
+
else
|
|
24
|
+
class SchemaCreation < AbstractAdapter::SchemaCreation
|
|
25
|
+
private
|
|
11
26
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if column.type == :uuid && options[:default] =~ /\(\)/
|
|
15
|
-
sql << " DEFAULT #{options[:default]}"
|
|
16
|
-
else
|
|
27
|
+
def visit_ColumnDefinition(o)
|
|
28
|
+
o.sql_type = type_to_sql(o.type, limit: o.limit, precision: o.precision, scale: o.scale)
|
|
17
29
|
super
|
|
18
30
|
end
|
|
31
|
+
|
|
32
|
+
def add_column_options!(sql, options)
|
|
33
|
+
column = options.fetch(:column) { return super }
|
|
34
|
+
if column.type == :uuid && options[:default] =~ /\(\)/
|
|
35
|
+
sql << " DEFAULT #{options[:default]}"
|
|
36
|
+
else
|
|
37
|
+
super
|
|
38
|
+
end
|
|
39
|
+
end
|
|
19
40
|
end
|
|
20
41
|
end
|
|
21
42
|
|
|
@@ -159,7 +159,7 @@ module ActiveRecord
|
|
|
159
159
|
super(connection, logger, config)
|
|
160
160
|
|
|
161
161
|
@visitor = Arel::Visitors::PostgreSQL.new self
|
|
162
|
-
@visitor.extend(ConnectionAdapters::DetermineIfPreparableVisitor)
|
|
162
|
+
@visitor.extend(ConnectionAdapters::DetermineIfPreparableVisitor) if defined?(ConnectionAdapters::DetermineIfPreparableVisitor)
|
|
163
163
|
@prepared_statements = false
|
|
164
164
|
|
|
165
165
|
@connection_parameters = connection_parameters
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord6-redshift-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nancy Foen
|
|
@@ -11,29 +11,26 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2021-05-16 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: pg
|
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
|
19
19
|
requirements:
|
|
20
|
-
- - "
|
|
20
|
+
- - "~>"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '0
|
|
22
|
+
version: '1.0'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
|
-
- - "
|
|
27
|
+
- - "~>"
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0
|
|
29
|
+
version: '1.0'
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: activerecord
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
33
|
requirements:
|
|
34
|
-
- - ">="
|
|
35
|
-
- !ruby/object:Gem::Version
|
|
36
|
-
version: 6.0.0
|
|
37
34
|
- - "~>"
|
|
38
35
|
- !ruby/object:Gem::Version
|
|
39
36
|
version: '6.0'
|
|
@@ -41,14 +38,11 @@ dependencies:
|
|
|
41
38
|
prerelease: false
|
|
42
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
40
|
requirements:
|
|
44
|
-
- - ">="
|
|
45
|
-
- !ruby/object:Gem::Version
|
|
46
|
-
version: 6.0.0
|
|
47
41
|
- - "~>"
|
|
48
42
|
- !ruby/object:Gem::Version
|
|
49
43
|
version: '6.0'
|
|
50
|
-
description: Amazon Redshift
|
|
51
|
-
email:
|
|
44
|
+
description: Amazon Redshift adapter for ActiveRecord 6.x.
|
|
45
|
+
email: contact@quent.in
|
|
52
46
|
executables: []
|
|
53
47
|
extensions: []
|
|
54
48
|
extra_rdoc_files: []
|