rom-sql 3.5.0 → 3.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/rom/sql/extensions/postgres/type_builder.rb +1 -1
- data/lib/rom/sql/extensions/postgres/type_serializer.rb +1 -0
- data/lib/rom/sql/extensions/postgres/types/network.rb +15 -2
- data/lib/rom/sql/function.rb +6 -1
- data/lib/rom/sql/tasks/migration_tasks.rake +9 -1
- data/lib/rom/sql/version.rb +1 -1
- data/lib/rom/sql.rb +0 -2
- metadata +6 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc51c9abdc25fa792a3115391e4dbb169d8c7dba6bac5553810140013d097836
|
4
|
+
data.tar.gz: 9b96d61a4dbdb7fa422f66e04933f89c513e429d5576cb6ce5c3c41acec96649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 185d71f20d84f614f47511bd1f5f21fd03cfd5d6f0734431464cfa895bb5a1b263798becd891c26b54498c50970d73dcb43cda8c34b2a90a25ca5e164a3921e9
|
7
|
+
data.tar.gz: 57926f14bd364b7abbab21c5bb6d89a53989029e84540e88e9b3b4695abc60509d741884e52313e329f676cfb787ce53eeaf8519794672e75d60f66162bbfb9a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 3.6.1 2022-11-22
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Mapping of cidr types in PostgreSQL to IPAddr values (@flash-gordon)
|
8
|
+
|
9
|
+
## 3.6.0 2022-11-11
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Add ROM::SQL::RakeSupport.migration_options for passing custom options to migrator (@wuarmin)
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- Upgraded to the latest versions of dry-rb dependencies, compatible with rom 5.3 (@flash-gordon)
|
18
|
+
|
19
|
+
[Compare v3.5.0...v3.6.0](https://github.com/rom-rb/rom-sql/compare/v3.5.0...v3.6.0)
|
20
|
+
|
3
21
|
## 3.5.0 2021-03-26
|
4
22
|
|
5
23
|
|
@@ -7,9 +7,22 @@ module ROM
|
|
7
7
|
module Postgres
|
8
8
|
module Types
|
9
9
|
IPAddress = Type('inet') do
|
10
|
-
read = SQL::Types.Constructor(IPAddr) { |ip| IPAddr.new(ip.to_s) }
|
10
|
+
read = SQL::Types.Constructor(IPAddr) { |ip| ::IPAddr.new(ip.to_s) }
|
11
11
|
|
12
|
-
SQL::Types.Constructor(IPAddr, &:to_s).meta(read: read)
|
12
|
+
SQL::Types.Constructor(::IPAddr, &:to_s).meta(read: read)
|
13
|
+
end
|
14
|
+
|
15
|
+
IPNetwork = Type('cidr') do
|
16
|
+
read = SQL::Types.Constructor(IPAddr) do |ip|
|
17
|
+
case ip
|
18
|
+
when ::IPAddr
|
19
|
+
ip
|
20
|
+
when String
|
21
|
+
::IPAddr.new(ip)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
SQL::Types.Constructor(::IPAddr) { |ip| "#{ip}/#{ip.prefix}" }.meta(read: read)
|
13
26
|
end
|
14
27
|
end
|
15
28
|
end
|
data/lib/rom/sql/function.rb
CHANGED
@@ -89,7 +89,12 @@ module ROM
|
|
89
89
|
|
90
90
|
# @api private
|
91
91
|
def new(&block)
|
92
|
-
|
92
|
+
case func
|
93
|
+
when ::Sequel::SQL::Function
|
94
|
+
meta(func: ::Sequel::SQL::Function.new!(func.name, func.args.map(&block), func.opts))
|
95
|
+
else
|
96
|
+
meta(func: func)
|
97
|
+
end
|
93
98
|
end
|
94
99
|
|
95
100
|
# @see Attribute#qualified?
|
@@ -10,7 +10,7 @@ module ROM
|
|
10
10
|
|
11
11
|
class << self
|
12
12
|
def run_migrations(options = {})
|
13
|
-
gateway.run_migrations(options)
|
13
|
+
gateway.run_migrations(migration_options.merge(options))
|
14
14
|
end
|
15
15
|
|
16
16
|
def create_migration(*args)
|
@@ -24,6 +24,13 @@ module ROM
|
|
24
24
|
# @api public
|
25
25
|
attr_accessor :env
|
26
26
|
|
27
|
+
|
28
|
+
# Migration options, which are passed to `ROM::SQL::RakeSupport.run_migrations`. You can
|
29
|
+
# set them in the `db:setup` task with `ROM::SQL::RakeSupport.migration_options = { ... }`
|
30
|
+
#
|
31
|
+
# @api public
|
32
|
+
attr_accessor :migration_options
|
33
|
+
|
27
34
|
private
|
28
35
|
|
29
36
|
def gateway
|
@@ -40,6 +47,7 @@ module ROM
|
|
40
47
|
end
|
41
48
|
|
42
49
|
@env = nil
|
50
|
+
@migration_options = {}
|
43
51
|
end
|
44
52
|
end
|
45
53
|
end
|
data/lib/rom/sql/version.rb
CHANGED
data/lib/rom/sql.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -44,20 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '0.5'
|
47
|
+
version: '1.0'
|
51
48
|
type: :runtime
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
54
51
|
requirements:
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0.5'
|
54
|
+
version: '1.0'
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rom
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,14 +228,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
228
|
requirements:
|
235
229
|
- - ">="
|
236
230
|
- !ruby/object:Gem::Version
|
237
|
-
version: 2.
|
231
|
+
version: 2.7.0
|
238
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
233
|
requirements:
|
240
234
|
- - ">="
|
241
235
|
- !ruby/object:Gem::Version
|
242
236
|
version: '0'
|
243
237
|
requirements: []
|
244
|
-
rubygems_version: 3.
|
238
|
+
rubygems_version: 3.3.7
|
245
239
|
signing_key:
|
246
240
|
specification_version: 4
|
247
241
|
summary: SQL databases support for ROM
|