sequel 5.106.0 → 5.109.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 +4 -4
- data/bin/sequel +5 -5
- data/lib/sequel/adapters/ado.rb +1 -1
- data/lib/sequel/adapters/amalgalite.rb +34 -8
- data/lib/sequel/adapters/ibmdb.rb +2 -2
- data/lib/sequel/adapters/jdbc/hsqldb.rb +1 -1
- data/lib/sequel/adapters/jdbc/mssql.rb +28 -5
- data/lib/sequel/adapters/jdbc/mysql.rb +1 -1
- data/lib/sequel/adapters/jdbc/postgresql.rb +14 -3
- data/lib/sequel/adapters/jdbc.rb +4 -3
- data/lib/sequel/adapters/mock.rb +1 -1
- data/lib/sequel/adapters/mysql.rb +7 -2
- data/lib/sequel/adapters/mysql2.rb +5 -4
- data/lib/sequel/adapters/postgres.rb +42 -39
- data/lib/sequel/adapters/shared/db2.rb +5 -2
- data/lib/sequel/adapters/shared/mssql.rb +11 -5
- data/lib/sequel/adapters/shared/mysql.rb +2 -2
- data/lib/sequel/adapters/shared/postgres.rb +80 -92
- data/lib/sequel/adapters/shared/sqlanywhere.rb +0 -32
- data/lib/sequel/adapters/shared/sqlite.rb +8 -7
- data/lib/sequel/adapters/sqlite.rb +13 -9
- data/lib/sequel/adapters/trilogy.rb +2 -1
- data/lib/sequel/adapters/utils/emulate_offset_with_reverse_and_count.rb +1 -1
- data/lib/sequel/adapters/utils/mysql_mysql2.rb +11 -1
- data/lib/sequel/connection_pool/sharded_single.rb +1 -1
- data/lib/sequel/connection_pool/sharded_threaded.rb +7 -5
- data/lib/sequel/connection_pool/sharded_timed_queue.rb +3 -3
- data/lib/sequel/connection_pool/threaded.rb +9 -7
- data/lib/sequel/connection_pool/timed_queue.rb +2 -2
- data/lib/sequel/connection_pool.rb +3 -3
- data/lib/sequel/core.rb +44 -24
- data/lib/sequel/database/connecting.rb +1 -1
- data/lib/sequel/database/features.rb +1 -1
- data/lib/sequel/database/misc.rb +6 -11
- data/lib/sequel/database/query.rb +2 -2
- data/lib/sequel/database/schema_generator.rb +7 -5
- data/lib/sequel/database/schema_methods.rb +2 -2
- data/lib/sequel/database/transactions.rb +5 -7
- data/lib/sequel/dataset/actions.rb +2 -2
- data/lib/sequel/dataset/features.rb +4 -4
- data/lib/sequel/dataset/graph.rb +1 -1
- data/lib/sequel/dataset/misc.rb +3 -3
- data/lib/sequel/dataset/prepared_statements.rb +2 -2
- data/lib/sequel/dataset/query.rb +8 -8
- data/lib/sequel/dataset/sql.rb +32 -13
- data/lib/sequel/dataset.rb +2 -2
- data/lib/sequel/deprecated.rb +2 -2
- data/lib/sequel/exceptions.rb +2 -2
- data/lib/sequel/extensions/_pretty_table.rb +1 -1
- data/lib/sequel/extensions/async_thread_pool.rb +3 -3
- data/lib/sequel/extensions/auto_cast_date_and_time.rb +2 -2
- data/lib/sequel/extensions/blank.rb +2 -2
- data/lib/sequel/extensions/constraint_validations.rb +1 -1
- data/lib/sequel/extensions/core_refinements.rb +7 -10
- data/lib/sequel/extensions/date_arithmetic.rb +1 -1
- data/lib/sequel/extensions/datetime_parse_to_time.rb +2 -2
- data/lib/sequel/extensions/duplicate_columns_handler.rb +1 -3
- data/lib/sequel/extensions/graph_each.rb +1 -1
- data/lib/sequel/extensions/index_caching.rb +1 -1
- data/lib/sequel/extensions/inflector.rb +5 -5
- data/lib/sequel/extensions/is_distinct_from.rb +2 -2
- data/lib/sequel/extensions/lit_require_frozen.rb +20 -4
- data/lib/sequel/extensions/migration.rb +21 -7
- data/lib/sequel/extensions/named_timezones.rb +9 -9
- data/lib/sequel/extensions/pg_array.rb +10 -8
- data/lib/sequel/extensions/pg_array_ops.rb +69 -14
- data/lib/sequel/extensions/pg_auto_parameterize.rb +2 -2
- data/lib/sequel/extensions/pg_auto_parameterize_in_array.rb +3 -3
- data/lib/sequel/extensions/pg_enum.rb +2 -2
- data/lib/sequel/extensions/pg_extended_date_support.rb +5 -5
- data/lib/sequel/extensions/pg_extended_integer_support.rb +1 -1
- data/lib/sequel/extensions/pg_hstore.rb +2 -2
- data/lib/sequel/extensions/pg_hstore_ops.rb +5 -5
- data/lib/sequel/extensions/pg_inet.rb +2 -2
- data/lib/sequel/extensions/pg_inet_ops.rb +2 -2
- data/lib/sequel/extensions/pg_interval.rb +6 -6
- data/lib/sequel/extensions/pg_json.rb +4 -4
- data/lib/sequel/extensions/pg_json_ops.rb +15 -13
- data/lib/sequel/extensions/pg_range.rb +6 -6
- data/lib/sequel/extensions/pg_range_ops.rb +7 -7
- data/lib/sequel/extensions/pg_row.rb +4 -4
- data/lib/sequel/extensions/pg_row_ops.rb +6 -6
- data/lib/sequel/extensions/provenance.rb +2 -2
- data/lib/sequel/extensions/query.rb +2 -2
- data/lib/sequel/extensions/s.rb +6 -10
- data/lib/sequel/extensions/schema_dumper.rb +10 -6
- data/lib/sequel/extensions/sequel_4_dataset_methods.rb +2 -0
- data/lib/sequel/extensions/sql_comments.rb +1 -1
- data/lib/sequel/extensions/sql_log_normalizer.rb +1 -1
- data/lib/sequel/extensions/sqlite_json_ops.rb +2 -2
- data/lib/sequel/extensions/string_agg.rb +5 -5
- data/lib/sequel/extensions/symbol_aref.rb +12 -32
- data/lib/sequel/extensions/symbol_aref_refinement.rb +2 -5
- data/lib/sequel/extensions/symbol_as.rb +1 -2
- data/lib/sequel/extensions/symbol_as_refinement.rb +1 -5
- data/lib/sequel/extensions/transaction_connection_validator.rb +1 -1
- data/lib/sequel/model/associations.rb +17 -17
- data/lib/sequel/model/base.rb +18 -15
- data/lib/sequel/model/inflections.rb +1 -1
- data/lib/sequel/model/plugins.rb +2 -2
- data/lib/sequel/model.rb +2 -2
- data/lib/sequel/plugins/association_pks.rb +1 -1
- data/lib/sequel/plugins/association_proxies.rb +4 -4
- data/lib/sequel/plugins/auto_restrict_eager_graph.rb +2 -0
- data/lib/sequel/plugins/caching.rb +28 -3
- data/lib/sequel/plugins/class_table_inheritance.rb +1 -1
- data/lib/sequel/plugins/column_encryption.rb +10 -10
- data/lib/sequel/plugins/concurrent_eager_loading.rb +2 -2
- data/lib/sequel/plugins/csv_serializer.rb +9 -20
- data/lib/sequel/plugins/deprecated_associations.rb +2 -2
- data/lib/sequel/plugins/eager_each.rb +1 -1
- data/lib/sequel/plugins/finder.rb +1 -1
- data/lib/sequel/plugins/forbid_lazy_load.rb +3 -3
- data/lib/sequel/plugins/insert_conflict.rb +1 -1
- data/lib/sequel/plugins/insert_returning_select.rb +1 -1
- data/lib/sequel/plugins/instance_filters.rb +8 -0
- data/lib/sequel/plugins/instance_hooks.rb +19 -0
- data/lib/sequel/plugins/json_serializer.rb +4 -4
- data/lib/sequel/plugins/lazy_attributes.rb +1 -1
- data/lib/sequel/plugins/many_through_many.rb +1 -1
- data/lib/sequel/plugins/mssql_optimistic_locking.rb +9 -0
- data/lib/sequel/plugins/optimistic_locking.rb +12 -2
- data/lib/sequel/plugins/optimistic_locking_base.rb +14 -0
- data/lib/sequel/plugins/pg_array_associations.rb +4 -4
- data/lib/sequel/plugins/pg_auto_constraint_validations.rb +3 -3
- data/lib/sequel/plugins/pg_eager_any_typed_array.rb +2 -2
- data/lib/sequel/plugins/pg_xmin_optimistic_locking.rb +11 -2
- data/lib/sequel/plugins/prepared_statements.rb +2 -2
- data/lib/sequel/plugins/select_on_skipped_update.rb +63 -0
- data/lib/sequel/plugins/serialization.rb +1 -1
- data/lib/sequel/plugins/sharding.rb +1 -1
- data/lib/sequel/plugins/single_table_inheritance.rb +21 -3
- data/lib/sequel/plugins/skip_saving_columns.rb +2 -2
- data/lib/sequel/plugins/split_values.rb +1 -1
- data/lib/sequel/plugins/sql_comments.rb +8 -8
- data/lib/sequel/plugins/subclasses.rb +6 -6
- data/lib/sequel/plugins/subset_conditions.rb +5 -16
- data/lib/sequel/plugins/tactical_eager_loading.rb +1 -1
- data/lib/sequel/plugins/throw_failures.rb +3 -3
- data/lib/sequel/plugins/unused_associations.rb +5 -5
- data/lib/sequel/plugins/validate_associated.rb +7 -1
- data/lib/sequel/plugins/validate_associated_context.rb +52 -0
- data/lib/sequel/plugins/validation_helpers.rb +1 -1
- data/lib/sequel/plugins/xml_serializer.rb +2 -0
- data/lib/sequel/sql.rb +120 -116
- data/lib/sequel/version.rb +1 -1
- metadata +5 -3
data/lib/sequel/sql.rb
CHANGED
|
@@ -371,7 +371,7 @@ module Sequel
|
|
|
371
371
|
SQL::CaseExpression.new(*args)
|
|
372
372
|
end
|
|
373
373
|
|
|
374
|
-
# Cast the
|
|
374
|
+
# Cast the receiver to the given SQL type. You can specify a ruby class as a type,
|
|
375
375
|
# and it is handled similarly to using a database independent type in the schema methods.
|
|
376
376
|
#
|
|
377
377
|
# Sequel.cast(:a, :integer) # CAST(a AS integer)
|
|
@@ -380,7 +380,7 @@ module Sequel
|
|
|
380
380
|
SQL::Cast.new(arg, sql_type)
|
|
381
381
|
end
|
|
382
382
|
|
|
383
|
-
# Cast the
|
|
383
|
+
# Cast the receiver to the given SQL type (or the database's default Integer type if none given),
|
|
384
384
|
# and return the result as a +NumericExpression+, so you can use the bitwise operators
|
|
385
385
|
# on the result.
|
|
386
386
|
#
|
|
@@ -390,7 +390,7 @@ module Sequel
|
|
|
390
390
|
cast(arg, sql_type || Integer).sql_number
|
|
391
391
|
end
|
|
392
392
|
|
|
393
|
-
# Cast the
|
|
393
|
+
# Cast the receiver to the given SQL type (or the database's default String type if none given),
|
|
394
394
|
# and return the result as a +StringExpression+, so you can use +
|
|
395
395
|
# directly on the result for SQL string concatenation.
|
|
396
396
|
#
|
|
@@ -687,7 +687,7 @@ module Sequel
|
|
|
687
687
|
|
|
688
688
|
# Holds methods that are used to cast objects to different SQL types.
|
|
689
689
|
module CastMethods
|
|
690
|
-
# Cast the
|
|
690
|
+
# Cast the receiver to the given SQL type. You can specify a ruby class as a type,
|
|
691
691
|
# and it is handled similarly to using a database independent type in the schema methods.
|
|
692
692
|
#
|
|
693
693
|
# Sequel.function(:func).cast(:integer) # CAST(func() AS integer)
|
|
@@ -696,7 +696,7 @@ module Sequel
|
|
|
696
696
|
Cast.new(self, sql_type)
|
|
697
697
|
end
|
|
698
698
|
|
|
699
|
-
# Cast the
|
|
699
|
+
# Cast the receiver to the given SQL type (or the database's default Integer type if none given),
|
|
700
700
|
# and return the result as a +NumericExpression+, so you can use the bitwise operators
|
|
701
701
|
# on the result.
|
|
702
702
|
#
|
|
@@ -706,7 +706,7 @@ module Sequel
|
|
|
706
706
|
Cast.new(self, sql_type || Integer).sql_number
|
|
707
707
|
end
|
|
708
708
|
|
|
709
|
-
# Cast the
|
|
709
|
+
# Cast the receiver to the given SQL type (or the database's default String type if none given),
|
|
710
710
|
# and return the result as a +StringExpression+, so you can use +
|
|
711
711
|
# directly on the result for SQL string concatenation.
|
|
712
712
|
#
|
|
@@ -1060,123 +1060,127 @@ module Sequel
|
|
|
1060
1060
|
# in a boolean value in SQL.
|
|
1061
1061
|
class BooleanExpression < ComplexExpression
|
|
1062
1062
|
include BooleanMethods
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
if
|
|
1102
|
-
|
|
1063
|
+
|
|
1064
|
+
module ClassMethods
|
|
1065
|
+
# Take pairs of values (e.g. a hash or array of two element arrays)
|
|
1066
|
+
# and converts it to a +BooleanExpression+. The operator and args
|
|
1067
|
+
# used depends on the case of the right (2nd) argument:
|
|
1068
|
+
#
|
|
1069
|
+
# 0..10 :: left >= 0 AND left <= 10
|
|
1070
|
+
# [1,2] :: left IN (1,2)
|
|
1071
|
+
# nil :: left IS NULL
|
|
1072
|
+
# true :: left IS TRUE
|
|
1073
|
+
# false :: left IS FALSE
|
|
1074
|
+
# /as/ :: left ~ 'as'
|
|
1075
|
+
# :blah :: left = blah
|
|
1076
|
+
# 'blah' :: left = 'blah'
|
|
1077
|
+
#
|
|
1078
|
+
# If multiple arguments are given, they are joined with the op given (AND
|
|
1079
|
+
# by default, OR possible). If negate is set to true,
|
|
1080
|
+
# all subexpressions are inverted before used. Therefore, the following
|
|
1081
|
+
# expressions are equivalent:
|
|
1082
|
+
#
|
|
1083
|
+
# ~from_value_pairs(hash)
|
|
1084
|
+
# from_value_pairs(hash, :OR, true)
|
|
1085
|
+
def from_value_pairs(pairs, op=:AND, negate=false)
|
|
1086
|
+
pairs = pairs.map{|l,r| from_value_pair(l, r)}
|
|
1087
|
+
pairs.map!{|ce| invert(ce)} if negate
|
|
1088
|
+
pairs.length == 1 ? pairs[0] : new(op, *pairs)
|
|
1089
|
+
end
|
|
1090
|
+
|
|
1091
|
+
# Return a BooleanExpression based on the right side of the pair.
|
|
1092
|
+
def from_value_pair(l, r)
|
|
1093
|
+
case r
|
|
1094
|
+
when Range
|
|
1095
|
+
unless r.begin.nil?
|
|
1096
|
+
begin_expr = new(:>=, l, r.begin)
|
|
1097
|
+
end
|
|
1098
|
+
unless r.end.nil?
|
|
1099
|
+
end_expr = new(r.exclude_end? ? :< : :<=, l, r.end)
|
|
1100
|
+
end
|
|
1101
|
+
if begin_expr
|
|
1102
|
+
if end_expr
|
|
1103
|
+
new(:AND, begin_expr, end_expr)
|
|
1104
|
+
else
|
|
1105
|
+
begin_expr
|
|
1106
|
+
end
|
|
1107
|
+
elsif end_expr
|
|
1108
|
+
end_expr
|
|
1103
1109
|
else
|
|
1104
|
-
|
|
1110
|
+
new(:'=', 1, 1)
|
|
1105
1111
|
end
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
r.transform do |v|
|
|
1132
|
-
if prev_transform
|
|
1133
|
-
v = prev_transform.call(v)
|
|
1112
|
+
when ::Array, ::Set
|
|
1113
|
+
r = r.dup.freeze unless r.frozen?
|
|
1114
|
+
new(:IN, l, r)
|
|
1115
|
+
when ::String
|
|
1116
|
+
r = r.dup.freeze unless r.frozen?
|
|
1117
|
+
new(:'=', l, r)
|
|
1118
|
+
when ::Sequel::Dataset
|
|
1119
|
+
new(:IN, l, r)
|
|
1120
|
+
when NegativeBooleanConstant
|
|
1121
|
+
new(:"IS NOT", l, r.constant)
|
|
1122
|
+
when BooleanConstant
|
|
1123
|
+
new(:IS, l, r.constant)
|
|
1124
|
+
when NilClass, TrueClass, FalseClass
|
|
1125
|
+
new(:IS, l, r)
|
|
1126
|
+
when Regexp
|
|
1127
|
+
StringExpression.like(l, r)
|
|
1128
|
+
when DelayedEvaluation
|
|
1129
|
+
Sequel.delay{|ds| from_value_pair(l, r.call(ds))}
|
|
1130
|
+
when Dataset::PlaceholderLiteralizer::Argument
|
|
1131
|
+
prev_transform = r.instance_variable_get(:@transformer)
|
|
1132
|
+
r.transform do |v|
|
|
1133
|
+
if prev_transform
|
|
1134
|
+
v = prev_transform.call(v)
|
|
1135
|
+
end
|
|
1136
|
+
from_value_pair(l, v)
|
|
1134
1137
|
end
|
|
1135
|
-
|
|
1138
|
+
else
|
|
1139
|
+
new(:'=', l, r)
|
|
1136
1140
|
end
|
|
1137
|
-
else
|
|
1138
|
-
new(:'=', l, r)
|
|
1139
1141
|
end
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1142
|
+
private :from_value_pair
|
|
1143
|
+
|
|
1144
|
+
# Invert the expression, if possible. If the expression cannot
|
|
1145
|
+
# be inverted, raise an error. An inverted expression should match everything that the
|
|
1146
|
+
# uninverted expression did not match, and vice-versa, except for possible issues with
|
|
1147
|
+
# SQL NULL (i.e. 1 == NULL is NULL and 1 != NULL is also NULL).
|
|
1148
|
+
#
|
|
1149
|
+
# BooleanExpression.invert(:a) # NOT "a"
|
|
1150
|
+
def invert(ce)
|
|
1151
|
+
case ce
|
|
1152
|
+
when BooleanExpression
|
|
1153
|
+
case op = ce.op
|
|
1154
|
+
when :AND, :OR
|
|
1155
|
+
BooleanExpression.new(ComplexExpression::OPERATOR_INVERSIONS[op], *ce.args.map{|a| BooleanExpression.invert(a)})
|
|
1156
|
+
when :IN, :"NOT IN"
|
|
1157
|
+
BooleanExpression.new(ComplexExpression::OPERATOR_INVERSIONS[op], *ce.args.dup)
|
|
1158
|
+
else
|
|
1159
|
+
if ce.args.length == 2
|
|
1160
|
+
case ce.args[1]
|
|
1161
|
+
when Function, LiteralString, PlaceholderLiteralString
|
|
1162
|
+
# Special behavior to not push down inversion in this case because doing so
|
|
1163
|
+
# can result in incorrect behavior for ANY/SOME/ALL operators.
|
|
1164
|
+
BooleanExpression.new(:NOT, ce)
|
|
1165
|
+
else
|
|
1166
|
+
BooleanExpression.new(ComplexExpression::OPERATOR_INVERSIONS[op], *ce.args.dup)
|
|
1167
|
+
end
|
|
1164
1168
|
else
|
|
1165
|
-
BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.dup)
|
|
1169
|
+
BooleanExpression.new(ComplexExpression::OPERATOR_INVERSIONS[op], *ce.args.dup)
|
|
1166
1170
|
end
|
|
1167
|
-
else
|
|
1168
|
-
BooleanExpression.new(OPERATOR_INVERSIONS[op], *ce.args.dup)
|
|
1169
1171
|
end
|
|
1172
|
+
when StringExpression, NumericExpression
|
|
1173
|
+
raise(Sequel::Error, "cannot invert #{ce.inspect}")
|
|
1174
|
+
when Constant
|
|
1175
|
+
ComplexExpression::CONSTANT_INVERSIONS[ce] || raise(Sequel::Error, "cannot invert #{ce.inspect}")
|
|
1176
|
+
else
|
|
1177
|
+
BooleanExpression.new(:NOT, ce)
|
|
1170
1178
|
end
|
|
1171
|
-
when StringExpression, NumericExpression
|
|
1172
|
-
raise(Sequel::Error, "cannot invert #{ce.inspect}")
|
|
1173
|
-
when Constant
|
|
1174
|
-
CONSTANT_INVERSIONS[ce] || raise(Sequel::Error, "cannot invert #{ce.inspect}")
|
|
1175
|
-
else
|
|
1176
|
-
BooleanExpression.new(:NOT, ce)
|
|
1177
1179
|
end
|
|
1178
1180
|
end
|
|
1179
1181
|
|
|
1182
|
+
extend ClassMethods
|
|
1183
|
+
|
|
1180
1184
|
# Always use an AND operator for & on BooleanExpressions
|
|
1181
1185
|
def &(ce)
|
|
1182
1186
|
BooleanExpression.new(:AND, self, ce)
|
|
@@ -1620,13 +1624,13 @@ module Sequel
|
|
|
1620
1624
|
# of strings, where each arg in args goes between the string elements.
|
|
1621
1625
|
attr_reader :str
|
|
1622
1626
|
|
|
1623
|
-
# The arguments that will be
|
|
1627
|
+
# The arguments that will be substituted into the placeholders.
|
|
1624
1628
|
# Either an array of unnamed placeholders (which will be substituted in
|
|
1625
1629
|
# order for ? characters), or a hash of named placeholders (which will be
|
|
1626
1630
|
# substituted for :key phrases).
|
|
1627
1631
|
attr_reader :args
|
|
1628
1632
|
|
|
1629
|
-
# Whether to surround the expression with
|
|
1633
|
+
# Whether to surround the expression with parentheses
|
|
1630
1634
|
attr_reader :parens
|
|
1631
1635
|
|
|
1632
1636
|
# Create an object with the given string, placeholder arguments, and parens flag.
|
|
@@ -1637,7 +1641,7 @@ module Sequel
|
|
|
1637
1641
|
freeze
|
|
1638
1642
|
end
|
|
1639
1643
|
|
|
1640
|
-
# Return a copy of the that will be surrounded by
|
|
1644
|
+
# Return a copy of the that will be surrounded by parentheses.
|
|
1641
1645
|
def with_parens
|
|
1642
1646
|
@parens ? self : self.class.new(@str, @args, true)
|
|
1643
1647
|
end
|
|
@@ -1749,11 +1753,11 @@ module Sequel
|
|
|
1749
1753
|
include StringConcatenationMethods
|
|
1750
1754
|
include InequalityMethods
|
|
1751
1755
|
|
|
1752
|
-
# Map of [regexp,
|
|
1756
|
+
# Map of [regexp, case_insensitive] to +ComplexExpression+ operator symbol
|
|
1753
1757
|
LIKE_MAP = {[true, true]=>:'~*', [true, false]=>:~, [false, true]=>:ILIKE, [false, false]=>:LIKE}.freeze
|
|
1754
1758
|
LIKE_MAP.each_key(&:freeze)
|
|
1755
1759
|
|
|
1756
|
-
# Creates a SQL pattern match
|
|
1760
|
+
# Creates a SQL pattern match expression. left (l) is the SQL string we
|
|
1757
1761
|
# are matching against, and ces are the patterns we are matching.
|
|
1758
1762
|
# The match succeeds if any of the patterns match (SQL OR).
|
|
1759
1763
|
#
|
data/lib/sequel/version.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Sequel
|
|
|
6
6
|
|
|
7
7
|
# The minor version of Sequel. Bumped for every non-patch level
|
|
8
8
|
# release, generally around once a month.
|
|
9
|
-
MINOR =
|
|
9
|
+
MINOR = 109
|
|
10
10
|
|
|
11
11
|
# The tiny version of Sequel. Usually 0, only bumped for bugfix
|
|
12
12
|
# releases that fix regressions from previous versions.
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sequel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.109.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
@@ -386,6 +386,7 @@ files:
|
|
|
386
386
|
- lib/sequel/plugins/primary_key_lookup_check_values.rb
|
|
387
387
|
- lib/sequel/plugins/rcte_tree.rb
|
|
388
388
|
- lib/sequel/plugins/require_valid_schema.rb
|
|
389
|
+
- lib/sequel/plugins/select_on_skipped_update.rb
|
|
389
390
|
- lib/sequel/plugins/serialization.rb
|
|
390
391
|
- lib/sequel/plugins/serialization_modification_detection.rb
|
|
391
392
|
- lib/sequel/plugins/sharding.rb
|
|
@@ -416,6 +417,7 @@ files:
|
|
|
416
417
|
- lib/sequel/plugins/update_refresh.rb
|
|
417
418
|
- lib/sequel/plugins/uuid.rb
|
|
418
419
|
- lib/sequel/plugins/validate_associated.rb
|
|
420
|
+
- lib/sequel/plugins/validate_associated_context.rb
|
|
419
421
|
- lib/sequel/plugins/validation_class_methods.rb
|
|
420
422
|
- lib/sequel/plugins/validation_contexts.rb
|
|
421
423
|
- lib/sequel/plugins/validation_helpers.rb
|
|
@@ -448,14 +450,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
448
450
|
requirements:
|
|
449
451
|
- - ">="
|
|
450
452
|
- !ruby/object:Gem::Version
|
|
451
|
-
version:
|
|
453
|
+
version: '2.0'
|
|
452
454
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
453
455
|
requirements:
|
|
454
456
|
- - ">="
|
|
455
457
|
- !ruby/object:Gem::Version
|
|
456
458
|
version: '0'
|
|
457
459
|
requirements: []
|
|
458
|
-
rubygems_version: 4.0.
|
|
460
|
+
rubygems_version: 4.0.20
|
|
459
461
|
specification_version: 4
|
|
460
462
|
summary: The Database Toolkit for Ruby
|
|
461
463
|
test_files: []
|