pg_graph 0.1.7 → 0.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: 136ce8c4b3c16482350810101783e0f2ed45efd775d49da517a686c97dba041f
4
- data.tar.gz: c6a2371d4b1dc9344eb05438cb12c59b7afe4ea632229500604cf83a517996cc
3
+ metadata.gz: 2a4bdf79631cb9f6b48b889927d4d41e0fcf65a6ec8d828e2cc045b9abbfd06d
4
+ data.tar.gz: 95b3731cf522ccb6673c6cad5df466da9b6391c5fe6ea247142244ad98ca4e4b
5
5
  SHA512:
6
- metadata.gz: 6301004fc3fd68f2a6cdb24d52623fc3bcf8f68d0873e99a8c26f43077ff4ea681f63e932ed2a899c36e528b0e5bf86fa684861afa9adfcc5d72234e346c6420
7
- data.tar.gz: afbea163f01b28362c5cf3f8f70b74772cb97122c6ee1dd4b86cf26ed953b83b44a5d4efb458db97b158291daa54a9daaa9f3c3afed19128a416d2b58812a89f
6
+ metadata.gz: 209100afcbd85ca114196204a68055c33eed183f6a044418e50c8f85dcc4af0881e3a70b605869faf73eb8ccab9e54e00a129c561832dbd28d3f1a5bc51747cf
7
+ data.tar.gz: 82b3592be19b8cdee178eca1f2ab506c88886c4d679f5ca8cb5c86b27ca7ab4c24a78ff231ef87f5556911cf37d700a9580613c8254cf08df4ac8fff0e1f2299
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-3.1.2
@@ -43,7 +43,7 @@ module PgGraph
43
43
  def table_type2table(name)
44
44
  record_type2table(table_type2record_type(name))
45
45
  end
46
-
46
+
47
47
  def table_type2record_type(name)
48
48
  name[1..-2]
49
49
  end
@@ -82,19 +82,74 @@ module PgGraph
82
82
  end
83
83
 
84
84
  # Types are both native postgres type and types from the information_schema
85
+ #
86
+ # Unsupported types: box, circle, interval, line, lseg, money, path, pg_lsn, pg_snapshot, point, polygon
87
+ #
85
88
  def postgres_type2ruby_class(name)
86
89
  case name
87
- when "character varying", "varchar", "text", "uuid", "xml"; String
88
- when "smallint", "integer", "int8", "int4", "int2"; Integer
89
- when "double precision", "real", "float8"; Float
90
- when "numeric", "decimal"; BigDecimal
90
+ # Boolean
91
91
  when "bool", "boolean"; Boolean
92
- when "json"; Hash
93
- when "bytea"; String
94
- when "timestamp", "timestamp without time zone"; Time
92
+
93
+ # Character types
94
+ when
95
+ "character", "char",
96
+ "character varying", "varchar",
97
+ "text"; String
98
+
99
+ # Binary data
100
+ when
101
+ "bit", "bit varying", "varbit",
102
+ "bytea"; String
103
+
104
+ # Integer types
105
+ when
106
+ "bigint", "int8",
107
+ "integer", "int", "int4",
108
+ "smallint", "int2"; Integer
109
+
110
+ # Float types
111
+ when
112
+ "double precision", "float8",
113
+ "real", "float4",
114
+ "float" ; Float
115
+
116
+ # Decimal types
117
+ when "numeric", "decimal"; BigDecimal
118
+
119
+ # Temporal
120
+ when
121
+ "time", "time with time zone", "timetz", "time without time zone",
122
+ "timestamp", "timestamp with time zone", "timestamptz", "timestamp without time zone"; Time
123
+
124
+ when
125
+ "date"; Date
126
+
127
+ # Array
95
128
  when /^_/; Array
129
+
130
+ # Serials
131
+ when
132
+ "bigserial", "serial8",
133
+ "serial", "serial4",
134
+ "smallserial", "serial2"; Integer
135
+
136
+ # UUIDS
137
+ when "uuid"; String
138
+
139
+ # JSON
140
+ when "json", "jsonb"; Hash
141
+
142
+ # XML
143
+ when "xml"; String
144
+
145
+ # Special types
146
+ when "cidr"; String
147
+ when "inet"; String
148
+ when "macaddr", "macaddr8"; String
149
+ when "tsquery", "tsvector"; String
150
+
96
151
  else
97
- raise "Unsupported postgres type: #{name.inspect} (FIXIT!)"
152
+ raise "PgGraph doesn't support the '#{name.inspect}' postgres type"
98
153
  end
99
154
  end
100
155
 
@@ -1,3 +1,3 @@
1
1
  module PgGraph
2
- VERSION = "0.1.7"
2
+ VERSION = "0.2.0"
3
3
  end
data/pg_graph.gemspec CHANGED
@@ -9,8 +9,6 @@ Gem::Specification.new do |spec|
9
9
  spec.summary = %q{Create graph type model of database}
10
10
  spec.description = %q{dwpg_graph gem}
11
11
  spec.homepage = "http://www.nowhere.com/"
12
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
-
14
12
 
15
13
  spec.metadata["homepage_uri"] = spec.homepage
16
14
 
@@ -31,7 +29,7 @@ Gem::Specification.new do |spec|
31
29
  spec.add_dependency "indented_io"
32
30
 
33
31
  spec.add_dependency "hash_tree"
34
- spec.add_dependency "shellopts", "~> 2.0.9"
32
+ spec.add_dependency "shellopts", "~> 2.1"
35
33
  spec.add_dependency "pg_conn"
36
34
  spec.add_dependency "pg_meta"
37
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: boolean
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.0.9
103
+ version: '2.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.0.9
110
+ version: '2.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pg_conn
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -225,7 +225,7 @@ homepage: http://www.nowhere.com/
225
225
  licenses: []
226
226
  metadata:
227
227
  homepage_uri: http://www.nowhere.com/
228
- post_install_message:
228
+ post_install_message:
229
229
  rdoc_options: []
230
230
  require_paths:
231
231
  - lib
@@ -233,15 +233,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - ">="
235
235
  - !ruby/object:Gem::Version
236
- version: 2.3.0
236
+ version: '0'
237
237
  required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  requirements:
239
239
  - - ">="
240
240
  - !ruby/object:Gem::Version
241
241
  version: '0'
242
242
  requirements: []
243
- rubygems_version: 3.1.4
244
- signing_key:
243
+ rubygems_version: 3.3.18
244
+ signing_key:
245
245
  specification_version: 4
246
246
  summary: Create graph type model of database
247
247
  test_files: []