rom-sql 3.6.4 → 3.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/rom/sql/function.rb +1 -1
- data/lib/rom/sql/schema/type_builder.rb +14 -1
- data/lib/rom/sql/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbc16afacec4f00a9b508c4bed68298b6761644be79903b69835531a0ec91141
|
4
|
+
data.tar.gz: 78e3d647bee05b90821261073034ee7d6bd18f12dd240c32e92068b873bd37d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd5ba27726315fa0dcf547c98aee77790e361830060054bdccbcfaf0c114a49d0ab4c22036dee0b77118f5a87ccbad939caafa6d1e2f1a7e723e44550c5fd90e
|
7
|
+
data.tar.gz: 2dec52f75e5eb999618515c841af58e4af76595a2222a29087f5c9f823c7769d0e2acbf6ff5f1696fe6f8bfcd123ebf789fc7c1c181aaa5aee8fd1c97ac311c1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 3.6.5 2024-12-25
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Fix syntax error under Ruby 3.4 (@flash-gordon)
|
9
|
+
|
10
|
+
[Compare v3.6.4...v3.6.5](https://github.com/rom-rb/rom-sql/compare/v3.6.4...v3.6.5)
|
11
|
+
|
3
12
|
## 3.6.4 2024-07-01
|
4
13
|
|
5
14
|
|
data/lib/rom/sql/function.rb
CHANGED
@@ -40,7 +40,7 @@ module ROM
|
|
40
40
|
WINDOW_FRAMES[nil] = nil
|
41
41
|
WINDOW_FRAMES[:all] = WINDOW_FRAMES[rows: [:start, :end]]
|
42
42
|
WINDOW_FRAMES[:rows] = WINDOW_FRAMES[rows: [:start, :current]]
|
43
|
-
WINDOW_FRAMES[range: :current] = WINDOW_FRAMES[range: [:current, :current]]
|
43
|
+
WINDOW_FRAMES[{ range: :current }] = WINDOW_FRAMES[range: [:current, :current]]
|
44
44
|
|
45
45
|
# Return a new attribute with an alias
|
46
46
|
#
|
@@ -37,6 +37,10 @@ module ROM
|
|
37
37
|
|
38
38
|
numeric_pk_type Types::Serial
|
39
39
|
|
40
|
+
TYPE_GUESSES = {
|
41
|
+
/datetime\((\d+)\)/ => :datetime
|
42
|
+
}.freeze
|
43
|
+
|
40
44
|
def call(primary_key:, db_type:, type:, allow_null:, **rest)
|
41
45
|
if primary_key
|
42
46
|
map_pk_type(type, db_type, **rest)
|
@@ -64,7 +68,7 @@ module ROM
|
|
64
68
|
|
65
69
|
# @api private
|
66
70
|
def map_type(ruby_type, db_type, **kw)
|
67
|
-
type = self.class.ruby_type_mapping[ruby_type]
|
71
|
+
type = self.class.ruby_type_mapping[ruby_type || guess_type(db_type)]
|
68
72
|
|
69
73
|
if db_type.is_a?(String) && db_type.include?('numeric') || db_type.include?('decimal')
|
70
74
|
map_decimal_type(db_type)
|
@@ -75,6 +79,15 @@ module ROM
|
|
75
79
|
end
|
76
80
|
end
|
77
81
|
|
82
|
+
# @api private
|
83
|
+
def guess_type(db_type)
|
84
|
+
TYPE_GUESSES.find do |regex, type|
|
85
|
+
if db_type.is_a?(String) && db_type.match(regex)
|
86
|
+
break type
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
78
91
|
# @api private
|
79
92
|
def map_decimal_type(type)
|
80
93
|
precision = DECIMAL_REGEX.match(type)
|
data/lib/rom/sql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-25 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: sequel
|
@@ -220,7 +219,6 @@ metadata:
|
|
220
219
|
documentation_uri: https://api.rom-rb.org/rom-sql/
|
221
220
|
mailing_list_uri: https://discourse.rom-rb.org/
|
222
221
|
bug_tracker_uri: https://github.com/rom-rb/rom-sql/issues
|
223
|
-
post_install_message:
|
224
222
|
rdoc_options: []
|
225
223
|
require_paths:
|
226
224
|
- lib
|
@@ -235,8 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
233
|
- !ruby/object:Gem::Version
|
236
234
|
version: '0'
|
237
235
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
239
|
-
signing_key:
|
236
|
+
rubygems_version: 3.6.2
|
240
237
|
specification_version: 4
|
241
238
|
summary: SQL databases support for ROM
|
242
239
|
test_files: []
|