arel 7.1.4 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +10 -18
- data/README.md +14 -3
- data/lib/arel/alias_predication.rb +1 -0
- data/lib/arel/attributes/attribute.rb +1 -0
- data/lib/arel/attributes.rb +1 -0
- data/lib/arel/collectors/bind.rb +6 -18
- data/lib/arel/collectors/composite.rb +32 -0
- data/lib/arel/collectors/plain_string.rb +2 -1
- data/lib/arel/collectors/sql_string.rb +1 -1
- data/lib/arel/collectors/substitute_binds.rb +28 -0
- data/lib/arel/compatibility/wheres.rb +1 -0
- data/lib/arel/crud.rb +1 -0
- data/lib/arel/delete_manager.rb +1 -0
- data/lib/arel/errors.rb +8 -0
- data/lib/arel/expressions.rb +1 -0
- data/lib/arel/factory_methods.rb +1 -0
- data/lib/arel/insert_manager.rb +6 -0
- data/lib/arel/math.rb +1 -0
- data/lib/arel/nodes/and.rb +1 -0
- data/lib/arel/nodes/ascending.rb +1 -0
- data/lib/arel/nodes/binary.rb +1 -0
- data/lib/arel/nodes/bind_param.rb +20 -2
- data/lib/arel/nodes/case.rb +1 -0
- data/lib/arel/nodes/casted.rb +2 -1
- data/lib/arel/nodes/count.rb +3 -0
- data/lib/arel/nodes/delete_statement.rb +1 -0
- data/lib/arel/nodes/descending.rb +1 -0
- data/lib/arel/nodes/equality.rb +1 -0
- data/lib/arel/nodes/extract.rb +1 -0
- data/lib/arel/nodes/false.rb +2 -0
- data/lib/arel/nodes/full_outer_join.rb +1 -0
- data/lib/arel/nodes/function.rb +3 -0
- data/lib/arel/nodes/grouping.rb +1 -0
- data/lib/arel/nodes/in.rb +1 -0
- data/lib/arel/nodes/infix_operation.rb +1 -0
- data/lib/arel/nodes/inner_join.rb +1 -0
- data/lib/arel/nodes/insert_statement.rb +1 -0
- data/lib/arel/nodes/join_source.rb +1 -0
- data/lib/arel/nodes/matches.rb +1 -0
- data/lib/arel/nodes/named_function.rb +1 -0
- data/lib/arel/nodes/node.rb +1 -0
- data/lib/arel/nodes/outer_join.rb +1 -0
- data/lib/arel/nodes/over.rb +1 -0
- data/lib/arel/nodes/regexp.rb +1 -0
- data/lib/arel/nodes/right_outer_join.rb +1 -0
- data/lib/arel/nodes/select_core.rb +1 -0
- data/lib/arel/nodes/select_statement.rb +1 -0
- data/lib/arel/nodes/sql_literal.rb +1 -0
- data/lib/arel/nodes/string_join.rb +1 -0
- data/lib/arel/nodes/table_alias.rb +1 -0
- data/lib/arel/nodes/terminal.rb +2 -0
- data/lib/arel/nodes/true.rb +2 -0
- data/lib/arel/nodes/unary.rb +1 -0
- data/lib/arel/nodes/unary_operation.rb +1 -0
- data/lib/arel/nodes/unqualified_column.rb +1 -0
- data/lib/arel/nodes/update_statement.rb +1 -0
- data/lib/arel/nodes/values.rb +1 -0
- data/lib/arel/nodes/values_list.rb +23 -0
- data/lib/arel/nodes/window.rb +2 -0
- data/lib/arel/nodes/with.rb +1 -0
- data/lib/arel/nodes.rb +2 -0
- data/lib/arel/order_predications.rb +1 -0
- data/lib/arel/predications.rb +1 -0
- data/lib/arel/select_manager.rb +2 -1
- data/lib/arel/table.rb +2 -13
- data/lib/arel/tree_manager.rb +3 -5
- data/lib/arel/update_manager.rb +1 -0
- data/lib/arel/visitors/depth_first.rb +1 -0
- data/lib/arel/visitors/dot.rb +2 -1
- data/lib/arel/visitors/ibm_db.rb +1 -0
- data/lib/arel/visitors/informix.rb +1 -2
- data/lib/arel/visitors/mssql.rb +1 -0
- data/lib/arel/visitors/mysql.rb +1 -0
- data/lib/arel/visitors/oracle.rb +7 -6
- data/lib/arel/visitors/oracle12.rb +2 -1
- data/lib/arel/visitors/postgresql.rb +2 -1
- data/lib/arel/visitors/reduce.rb +4 -2
- data/lib/arel/visitors/sqlite.rb +1 -0
- data/lib/arel/visitors/to_sql.rb +34 -49
- data/lib/arel/visitors/visitor.rb +4 -2
- data/lib/arel/visitors/where_sql.rb +1 -0
- data/lib/arel/visitors.rb +1 -0
- data/lib/arel/window_predications.rb +1 -0
- data/lib/arel.rb +4 -1
- metadata +22 -6
- data/lib/arel/visitors/bind_substitute.rb +0 -9
- data/lib/arel/visitors/bind_visitor.rb +0 -39
data/lib/arel/nodes/window.rb
CHANGED
data/lib/arel/nodes/with.rb
CHANGED
data/lib/arel/nodes.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# node
|
2
3
|
require 'arel/nodes/node'
|
3
4
|
require 'arel/nodes/select_statement'
|
@@ -43,6 +44,7 @@ require 'arel/nodes/function'
|
|
43
44
|
require 'arel/nodes/count'
|
44
45
|
require 'arel/nodes/extract'
|
45
46
|
require 'arel/nodes/values'
|
47
|
+
require 'arel/nodes/values_list'
|
46
48
|
require 'arel/nodes/named_function'
|
47
49
|
|
48
50
|
# windows
|
data/lib/arel/predications.rb
CHANGED
data/lib/arel/select_manager.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'arel/collectors/sql_string'
|
2
3
|
|
3
4
|
module Arel
|
@@ -106,7 +107,7 @@ module Arel
|
|
106
107
|
|
107
108
|
case relation
|
108
109
|
when String, Nodes::SqlLiteral
|
109
|
-
raise if relation.empty?
|
110
|
+
raise EmptyJoinError if relation.empty?
|
110
111
|
klass = Nodes::StringJoin
|
111
112
|
end
|
112
113
|
|
data/lib/arel/table.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
class Table
|
3
4
|
include Arel::Crud
|
@@ -13,7 +14,6 @@ module Arel
|
|
13
14
|
|
14
15
|
def initialize(name, as: nil, type_caster: nil)
|
15
16
|
@name = name.to_s
|
16
|
-
@columns = nil
|
17
17
|
@type_caster = type_caster
|
18
18
|
|
19
19
|
# Sometime AR sends an :as parameter to table, to let the table know
|
@@ -38,7 +38,7 @@ module Arel
|
|
38
38
|
|
39
39
|
case relation
|
40
40
|
when String, Nodes::SqlLiteral
|
41
|
-
raise if relation.empty?
|
41
|
+
raise EmptyJoinError if relation.empty?
|
42
42
|
klass = Nodes::StringJoin
|
43
43
|
end
|
44
44
|
|
@@ -106,16 +106,5 @@ module Arel
|
|
106
106
|
protected
|
107
107
|
|
108
108
|
attr_reader :type_caster
|
109
|
-
|
110
|
-
private
|
111
|
-
|
112
|
-
def attributes_for columns
|
113
|
-
return nil unless columns
|
114
|
-
|
115
|
-
columns.map do |column|
|
116
|
-
Attributes.for(column).new self, column.name.to_sym
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
109
|
end
|
121
110
|
end
|
data/lib/arel/tree_manager.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'arel/collectors/sql_string'
|
2
3
|
|
3
4
|
module Arel
|
4
5
|
class TreeManager
|
5
6
|
include Arel::FactoryMethods
|
6
7
|
|
7
|
-
attr_reader :ast
|
8
|
-
|
9
|
-
attr_accessor :bind_values
|
8
|
+
attr_reader :ast
|
10
9
|
|
11
10
|
def initialize
|
12
|
-
@ctx
|
13
|
-
@bind_values = []
|
11
|
+
@ctx = nil
|
14
12
|
end
|
15
13
|
|
16
14
|
def to_dot
|
data/lib/arel/update_manager.rb
CHANGED
data/lib/arel/visitors/dot.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class Dot < Arel::Visitors::Visitor
|
@@ -277,7 +278,7 @@ module Arel
|
|
277
278
|
label = "<f0>#{node.name}"
|
278
279
|
|
279
280
|
node.fields.each_with_index do |field, i|
|
280
|
-
label
|
281
|
+
label += "|<f#{i + 1}>#{quote field}"
|
281
282
|
end
|
282
283
|
|
283
284
|
"#{node.id} [label=\"#{label}\"];"
|
data/lib/arel/visitors/ibm_db.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class Informix < Arel::Visitors::ToSql
|
@@ -17,9 +18,7 @@ module Arel
|
|
17
18
|
end
|
18
19
|
def visit_Arel_Nodes_SelectCore o, collector
|
19
20
|
collector = inject_join o.projections, collector, ", "
|
20
|
-
froms = false
|
21
21
|
if o.source && !o.source.empty?
|
22
|
-
froms = true
|
23
22
|
collector << " FROM "
|
24
23
|
collector = visit o.source, collector
|
25
24
|
end
|
data/lib/arel/visitors/mssql.rb
CHANGED
data/lib/arel/visitors/mysql.rb
CHANGED
data/lib/arel/visitors/oracle.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class Oracle < Arel::Visitors::ToSql
|
@@ -28,12 +29,12 @@ module Arel
|
|
28
29
|
collector = super(o, collector)
|
29
30
|
|
30
31
|
if offset.expr.is_a? Nodes::BindParam
|
31
|
-
offset_bind = nil
|
32
32
|
collector << ') raw_sql_ WHERE rownum <= ('
|
33
|
-
collector
|
33
|
+
collector = visit offset.expr, collector
|
34
34
|
collector << ' + '
|
35
|
-
collector
|
36
|
-
collector << ") ) WHERE raw_rnum_ >
|
35
|
+
collector = visit limit, collector
|
36
|
+
collector << ") ) WHERE raw_rnum_ > "
|
37
|
+
collector = visit offset.expr, collector
|
37
38
|
return collector
|
38
39
|
else
|
39
40
|
collector << ") raw_sql_
|
@@ -136,7 +137,7 @@ module Arel
|
|
136
137
|
array[i] << ',' << part
|
137
138
|
else
|
138
139
|
# to ensure that array[i] will be String and not Arel::Nodes::SqlLiteral
|
139
|
-
array[i] =
|
140
|
+
array[i] = part.to_s
|
140
141
|
end
|
141
142
|
i += 1 if array[i].count('(') == array[i].count(')')
|
142
143
|
end
|
@@ -144,7 +145,7 @@ module Arel
|
|
144
145
|
end
|
145
146
|
|
146
147
|
def visit_Arel_Nodes_BindParam o, collector
|
147
|
-
collector.add_bind(o) { |i| ":a#{i}" }
|
148
|
+
collector.add_bind(o.value) { |i| ":a#{i}" }
|
148
149
|
end
|
149
150
|
|
150
151
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class Oracle12 < Arel::Visitors::ToSql
|
@@ -52,7 +53,7 @@ module Arel
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def visit_Arel_Nodes_BindParam o, collector
|
55
|
-
collector.add_bind(o) { |i| ":a#{i}" }
|
56
|
+
collector.add_bind(o.value) { |i| ":a#{i}" }
|
56
57
|
end
|
57
58
|
end
|
58
59
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class PostgreSQL < Arel::Visitors::ToSql
|
@@ -45,7 +46,7 @@ module Arel
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def visit_Arel_Nodes_BindParam o, collector
|
48
|
-
collector.add_bind(o) { |i| "$#{i}" }
|
49
|
+
collector.add_bind(o.value) { |i| "$#{i}" }
|
49
50
|
end
|
50
51
|
|
51
52
|
def visit_Arel_Nodes_GroupingElement o, collector
|
data/lib/arel/visitors/reduce.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'arel/visitors/visitor'
|
2
3
|
|
3
4
|
module Arel
|
@@ -10,9 +11,10 @@ module Arel
|
|
10
11
|
private
|
11
12
|
|
12
13
|
def visit object, collector
|
13
|
-
|
14
|
+
dispatch_method = dispatch[object.class]
|
15
|
+
send dispatch_method, object, collector
|
14
16
|
rescue NoMethodError => e
|
15
|
-
raise e if respond_to?(
|
17
|
+
raise e if respond_to?(dispatch_method, true)
|
16
18
|
superklass = object.class.ancestors.find { |klass|
|
17
19
|
respond_to?(dispatch[klass], true)
|
18
20
|
}
|
data/lib/arel/visitors/sqlite.rb
CHANGED
data/lib/arel/visitors/to_sql.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'bigdecimal'
|
2
3
|
require 'date'
|
3
4
|
require 'arel/visitors/reduce'
|
@@ -75,15 +76,11 @@ module Arel
|
|
75
76
|
|
76
77
|
private
|
77
78
|
|
78
|
-
def schema_cache
|
79
|
-
@connection.schema_cache
|
80
|
-
end
|
81
|
-
|
82
79
|
def visit_Arel_Nodes_DeleteStatement o, collector
|
83
80
|
collector << 'DELETE FROM '
|
84
81
|
collector = visit o.relation, collector
|
85
82
|
if o.wheres.any?
|
86
|
-
collector <<
|
83
|
+
collector << WHERE
|
87
84
|
collector = inject_join o.wheres, collector, AND
|
88
85
|
end
|
89
86
|
|
@@ -169,34 +166,38 @@ module Arel
|
|
169
166
|
collector << "FALSE"
|
170
167
|
end
|
171
168
|
|
172
|
-
def
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
169
|
+
def visit_Arel_Nodes_ValuesList o, collector
|
170
|
+
collector << "VALUES "
|
171
|
+
|
172
|
+
len = o.rows.length - 1
|
173
|
+
o.rows.each_with_index { |row, i|
|
174
|
+
collector << '('
|
175
|
+
row_len = row.length - 1
|
176
|
+
row.each_with_index do |value, k|
|
177
|
+
case value
|
178
|
+
when Nodes::SqlLiteral, Nodes::BindParam
|
179
|
+
collector = visit(value, collector)
|
180
|
+
else
|
181
|
+
collector << quote(value)
|
182
|
+
end
|
183
|
+
collector << COMMA unless k == row_len
|
184
|
+
end
|
185
|
+
collector << ')'
|
186
|
+
collector << COMMA unless i == len
|
187
|
+
}
|
188
|
+
collector
|
188
189
|
end
|
189
190
|
|
190
191
|
def visit_Arel_Nodes_Values o, collector
|
191
192
|
collector << "VALUES ("
|
192
193
|
|
193
194
|
len = o.expressions.length - 1
|
194
|
-
o.expressions.
|
195
|
+
o.expressions.each_with_index { |value, i|
|
195
196
|
case value
|
196
197
|
when Nodes::SqlLiteral, Nodes::BindParam
|
197
198
|
collector = visit value, collector
|
198
199
|
else
|
199
|
-
collector << quote(value
|
200
|
+
collector << quote(value).to_s
|
200
201
|
end
|
201
202
|
unless i == len
|
202
203
|
collector << COMMA
|
@@ -286,12 +287,12 @@ module Arel
|
|
286
287
|
|
287
288
|
def visit_Arel_Nodes_With o, collector
|
288
289
|
collector << "WITH "
|
289
|
-
inject_join o.children, collector,
|
290
|
+
inject_join o.children, collector, COMMA
|
290
291
|
end
|
291
292
|
|
292
293
|
def visit_Arel_Nodes_WithRecursive o, collector
|
293
294
|
collector << "WITH RECURSIVE "
|
294
|
-
inject_join o.children, collector,
|
295
|
+
inject_join o.children, collector, COMMA
|
295
296
|
end
|
296
297
|
|
297
298
|
def visit_Arel_Nodes_Union o, collector
|
@@ -426,7 +427,8 @@ module Arel
|
|
426
427
|
end
|
427
428
|
|
428
429
|
def visit_Arel_SelectManager o, collector
|
429
|
-
collector <<
|
430
|
+
collector << '('
|
431
|
+
visit(o.ast, collector) << ')'
|
430
432
|
end
|
431
433
|
|
432
434
|
def visit_Arel_Nodes_Ascending o, collector
|
@@ -545,7 +547,7 @@ module Arel
|
|
545
547
|
end
|
546
548
|
if o.right.any?
|
547
549
|
collector << SPACE if o.left
|
548
|
-
collector = inject_join o.right, collector,
|
550
|
+
collector = inject_join o.right, collector, SPACE
|
549
551
|
end
|
550
552
|
collector
|
551
553
|
end
|
@@ -652,7 +654,7 @@ module Arel
|
|
652
654
|
else
|
653
655
|
collector = visit o.left, collector
|
654
656
|
collector << " = "
|
655
|
-
collector << quote(o.right
|
657
|
+
collector << quote(o.right).to_s
|
656
658
|
end
|
657
659
|
end
|
658
660
|
|
@@ -736,7 +738,7 @@ module Arel
|
|
736
738
|
def literal o, collector; collector << o.to_s; end
|
737
739
|
|
738
740
|
def visit_Arel_Nodes_BindParam o, collector
|
739
|
-
collector.add_bind(o) { "?" }
|
741
|
+
collector.add_bind(o.value) { "?" }
|
740
742
|
end
|
741
743
|
|
742
744
|
alias :visit_Arel_Nodes_SqlLiteral :literal
|
@@ -748,7 +750,7 @@ module Arel
|
|
748
750
|
if a && a.able_to_type_cast?
|
749
751
|
quote(a.type_cast_for_database(o))
|
750
752
|
else
|
751
|
-
quote(o
|
753
|
+
quote(o)
|
752
754
|
end
|
753
755
|
end
|
754
756
|
|
@@ -792,12 +794,9 @@ module Arel
|
|
792
794
|
end
|
793
795
|
alias :visit_Set :visit_Array
|
794
796
|
|
795
|
-
def quote value
|
797
|
+
def quote value
|
796
798
|
return value if Arel::Nodes::SqlLiteral === value
|
797
|
-
|
798
|
-
print_type_cast_deprecation
|
799
|
-
end
|
800
|
-
@connection.quote value, column
|
799
|
+
@connection.quote value
|
801
800
|
end
|
802
801
|
|
803
802
|
def quote_table_name name
|
@@ -846,20 +845,6 @@ module Arel
|
|
846
845
|
collector
|
847
846
|
end
|
848
847
|
end
|
849
|
-
|
850
|
-
def print_type_cast_deprecation
|
851
|
-
unless defined?($arel_silence_type_casting_deprecation) && $arel_silence_type_casting_deprecation
|
852
|
-
warn <<-eowarn
|
853
|
-
Arel performing automatic type casting is deprecated, and will be removed in Arel 8.0. If you are seeing this, it is because you are manually passing a value to an Arel predicate, and the `Arel::Table` object was constructed manually. The easiest way to remove this warning is to use an `Arel::Table` object returned from calling `arel_table` on an ActiveRecord::Base subclass.
|
854
|
-
|
855
|
-
If you're certain the value is already of the right type, change `attribute.eq(value)` to `attribute.eq(Arel::Nodes::Quoted.new(value))` (you will be able to remove that in Arel 8.0, it is only required to silence this deprecation warning).
|
856
|
-
|
857
|
-
You can also silence this warning globally by setting `$arel_silence_type_casting_deprecation` to `true`. (Do NOT do this if you are a library author)
|
858
|
-
|
859
|
-
If you are passing user input to a predicate, you must either give an appropriate type caster object to the `Arel::Table`, or manually cast the value before passing it to Arel.
|
860
|
-
eowarn
|
861
|
-
end
|
862
|
-
end
|
863
848
|
end
|
864
849
|
end
|
865
850
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Arel
|
2
3
|
module Visitors
|
3
4
|
class Visitor
|
@@ -26,9 +27,10 @@ module Arel
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def visit object
|
29
|
-
|
30
|
+
dispatch_method = dispatch[object.class]
|
31
|
+
send dispatch_method, object
|
30
32
|
rescue NoMethodError => e
|
31
|
-
raise e if respond_to?(
|
33
|
+
raise e if respond_to?(dispatch_method, true)
|
32
34
|
superklass = object.class.ancestors.find { |klass|
|
33
35
|
respond_to?(dispatch[klass], true)
|
34
36
|
}
|
data/lib/arel/visitors.rb
CHANGED
data/lib/arel.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'arel/errors'
|
3
|
+
|
1
4
|
require 'arel/crud'
|
2
5
|
require 'arel/factory_methods'
|
3
6
|
|
@@ -21,7 +24,7 @@ require 'arel/delete_manager'
|
|
21
24
|
require 'arel/nodes'
|
22
25
|
|
23
26
|
module Arel
|
24
|
-
VERSION = '
|
27
|
+
VERSION = '9.0.0'
|
25
28
|
|
26
29
|
def self.sql raw_sql
|
27
30
|
Arel::Nodes::SqlLiteral.new raw_sql
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 9.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2017-11-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: minitest
|
@@ -55,6 +55,20 @@ dependencies:
|
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: concurrent-ruby
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '1.0'
|
65
|
+
type: :development
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.0'
|
58
72
|
description: |-
|
59
73
|
Arel Really Exasperates Logicians
|
60
74
|
|
@@ -85,11 +99,14 @@ files:
|
|
85
99
|
- lib/arel/attributes.rb
|
86
100
|
- lib/arel/attributes/attribute.rb
|
87
101
|
- lib/arel/collectors/bind.rb
|
102
|
+
- lib/arel/collectors/composite.rb
|
88
103
|
- lib/arel/collectors/plain_string.rb
|
89
104
|
- lib/arel/collectors/sql_string.rb
|
105
|
+
- lib/arel/collectors/substitute_binds.rb
|
90
106
|
- lib/arel/compatibility/wheres.rb
|
91
107
|
- lib/arel/crud.rb
|
92
108
|
- lib/arel/delete_manager.rb
|
109
|
+
- lib/arel/errors.rb
|
93
110
|
- lib/arel/expressions.rb
|
94
111
|
- lib/arel/factory_methods.rb
|
95
112
|
- lib/arel/insert_manager.rb
|
@@ -134,6 +151,7 @@ files:
|
|
134
151
|
- lib/arel/nodes/unqualified_column.rb
|
135
152
|
- lib/arel/nodes/update_statement.rb
|
136
153
|
- lib/arel/nodes/values.rb
|
154
|
+
- lib/arel/nodes/values_list.rb
|
137
155
|
- lib/arel/nodes/window.rb
|
138
156
|
- lib/arel/nodes/with.rb
|
139
157
|
- lib/arel/order_predications.rb
|
@@ -143,8 +161,6 @@ files:
|
|
143
161
|
- lib/arel/tree_manager.rb
|
144
162
|
- lib/arel/update_manager.rb
|
145
163
|
- lib/arel/visitors.rb
|
146
|
-
- lib/arel/visitors/bind_substitute.rb
|
147
|
-
- lib/arel/visitors/bind_visitor.rb
|
148
164
|
- lib/arel/visitors/depth_first.rb
|
149
165
|
- lib/arel/visitors/dot.rb
|
150
166
|
- lib/arel/visitors/ibm_db.rb
|
@@ -174,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
190
|
requirements:
|
175
191
|
- - ">="
|
176
192
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
193
|
+
version: 2.2.2
|
178
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
195
|
requirements:
|
180
196
|
- - ">="
|
@@ -182,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
198
|
version: '0'
|
183
199
|
requirements: []
|
184
200
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.6.12
|
186
202
|
signing_key:
|
187
203
|
specification_version: 4
|
188
204
|
summary: Arel Really Exasperates Logicians Arel is a SQL AST manager for Ruby
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module Arel
|
2
|
-
module Visitors
|
3
|
-
module BindVisitor
|
4
|
-
def initialize target
|
5
|
-
@block = nil
|
6
|
-
super
|
7
|
-
end
|
8
|
-
|
9
|
-
def accept node, collector, &block
|
10
|
-
@block = block if block_given?
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def visit_Arel_Nodes_Assignment o, collector
|
17
|
-
if o.right.is_a? Arel::Nodes::BindParam
|
18
|
-
collector = visit o.left, collector
|
19
|
-
collector << " = "
|
20
|
-
visit o.right, collector
|
21
|
-
else
|
22
|
-
super
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def visit_Arel_Nodes_BindParam o, collector
|
27
|
-
if @block
|
28
|
-
val = @block.call
|
29
|
-
if String === val
|
30
|
-
collector << val
|
31
|
-
end
|
32
|
-
else
|
33
|
-
super
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|