pg_graph 0.1.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 +7 -0
- data/.gitignore +18 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/TODO +8 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/diagram.drawio +1 -0
- data/exe/pg_graph +152 -0
- data/lib/data/association.rb +98 -0
- data/lib/data/data.rb +551 -0
- data/lib/data/dimension.rb +51 -0
- data/lib/data/read.rb +44 -0
- data/lib/data/render.rb +237 -0
- data/lib/data/value.rb +96 -0
- data/lib/ext/meta.rb +56 -0
- data/lib/ext/module.rb +18 -0
- data/lib/pg_graph/inflector.rb +105 -0
- data/lib/pg_graph/reflector.rb +187 -0
- data/lib/pg_graph/timer.rb +119 -0
- data/lib/pg_graph/version.rb +3 -0
- data/lib/pg_graph.rb +124 -0
- data/lib/type/dump_type.rb +69 -0
- data/lib/type/read.rb +269 -0
- data/lib/type/type.rb +617 -0
- data/pg_graph.gemspec +40 -0
- data/snippets/1-1.sql +19 -0
- data/snippets/N-M.sql +24 -0
- data/snippets/dag.sql +19 -0
- data/snippets/db.sql +52 -0
- data/snippets/kind.sql +19 -0
- data/snippets/recur.sql +14 -0
- metadata +205 -0
data/snippets/dag.sql
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
\connect postgres
|
3
|
+
|
4
|
+
drop database if exists pg_graph;
|
5
|
+
create database pg_graph;
|
6
|
+
|
7
|
+
\connect pg_graph
|
8
|
+
|
9
|
+
create table roles (
|
10
|
+
id integer generated by default as identity primary key,
|
11
|
+
name text not null
|
12
|
+
);
|
13
|
+
|
14
|
+
create table role_groups (
|
15
|
+
id integer generated by default as identity primary key,
|
16
|
+
child_role_id integer not null references roles(id),
|
17
|
+
parent_role_id integer not null references roles(id)
|
18
|
+
);
|
19
|
+
|
data/snippets/db.sql
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
|
2
|
+
\connect postgres
|
3
|
+
|
4
|
+
drop database if exists pg_graph;
|
5
|
+
create database pg_graph;
|
6
|
+
|
7
|
+
\connect pg_graph
|
8
|
+
|
9
|
+
create table roles (
|
10
|
+
id integer generated by default as identity primary key,
|
11
|
+
name text not null,
|
12
|
+
active boolean not null default true
|
13
|
+
);
|
14
|
+
|
15
|
+
create table pictures (
|
16
|
+
id integer generated by default as identity primary key,
|
17
|
+
title text not null,
|
18
|
+
blob text not null
|
19
|
+
);
|
20
|
+
|
21
|
+
create table users (
|
22
|
+
id integer generated by default as identity primary key,
|
23
|
+
name text not null,
|
24
|
+
age integer,
|
25
|
+
role_id integer not null references roles(id),
|
26
|
+
picture_id integer unique references pictures(id)
|
27
|
+
);
|
28
|
+
|
29
|
+
create table blogs (
|
30
|
+
id integer generated by default as identity primary key,
|
31
|
+
user_id integer not null references users(id),
|
32
|
+
title text not null
|
33
|
+
);
|
34
|
+
|
35
|
+
create table posts (
|
36
|
+
id integer generated by default as identity primary key,
|
37
|
+
blog_id integer not null references blogs(id),
|
38
|
+
head text not null,
|
39
|
+
body text not null,
|
40
|
+
created_at timestamp without time zone default (now() at time zone 'UTC')
|
41
|
+
);
|
42
|
+
|
43
|
+
create table comments (
|
44
|
+
id integer generated by default as identity primary key,
|
45
|
+
post_id integer not null references posts(id),
|
46
|
+
author_id integer not null references users(id),
|
47
|
+
head text not null,
|
48
|
+
body text not null,
|
49
|
+
created_at timestamp without time zone default (now() at time zone 'UTC')
|
50
|
+
);
|
51
|
+
|
52
|
+
alter table users add column last_post_id integer unique references posts(id);
|
data/snippets/kind.sql
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
\connect postgres
|
3
|
+
|
4
|
+
drop database if exists pg_graph;
|
5
|
+
create database pg_graph;
|
6
|
+
|
7
|
+
\connect pg_graph
|
8
|
+
|
9
|
+
create table picture_kinds (
|
10
|
+
id integer generated by default as identity primary key,
|
11
|
+
kind varchar not null unique
|
12
|
+
);
|
13
|
+
|
14
|
+
create table pictures (
|
15
|
+
id integer generated by default as identity primary key,
|
16
|
+
title text not null,
|
17
|
+
kind varchar not null references picture_kinds(kind)
|
18
|
+
);
|
19
|
+
|
data/snippets/recur.sql
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
\connect postgres
|
3
|
+
|
4
|
+
drop database if exists pg_graph;
|
5
|
+
create database pg_graph;
|
6
|
+
|
7
|
+
\connect pg_graph
|
8
|
+
|
9
|
+
create table users (
|
10
|
+
id integer generated by default as identity primary key,
|
11
|
+
parent_id integer not null references users(id),
|
12
|
+
name varchar
|
13
|
+
);
|
14
|
+
|
metadata
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pg_graph
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Claus Rasmussen
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-03-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: boolean
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: constrain
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: developer_exceptions
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: dry-inflector
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: hash_tree
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.1.1
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.1.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: indented_io
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: shellopts
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.6
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.6
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pg_conn
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.2.1
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.2.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pg_meta
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.1.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.1.0
|
139
|
+
description: dwpg_graph gem
|
140
|
+
email:
|
141
|
+
- claus.l.rasmussen@gmail.com
|
142
|
+
executables:
|
143
|
+
- pg_graph
|
144
|
+
extensions: []
|
145
|
+
extra_rdoc_files: []
|
146
|
+
files:
|
147
|
+
- ".gitignore"
|
148
|
+
- ".rspec"
|
149
|
+
- ".ruby-version"
|
150
|
+
- ".travis.yml"
|
151
|
+
- Gemfile
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- TODO
|
155
|
+
- bin/console
|
156
|
+
- bin/setup
|
157
|
+
- doc/diagram.drawio
|
158
|
+
- exe/pg_graph
|
159
|
+
- lib/data/association.rb
|
160
|
+
- lib/data/data.rb
|
161
|
+
- lib/data/dimension.rb
|
162
|
+
- lib/data/read.rb
|
163
|
+
- lib/data/render.rb
|
164
|
+
- lib/data/value.rb
|
165
|
+
- lib/ext/meta.rb
|
166
|
+
- lib/ext/module.rb
|
167
|
+
- lib/pg_graph.rb
|
168
|
+
- lib/pg_graph/inflector.rb
|
169
|
+
- lib/pg_graph/reflector.rb
|
170
|
+
- lib/pg_graph/timer.rb
|
171
|
+
- lib/pg_graph/version.rb
|
172
|
+
- lib/type/dump_type.rb
|
173
|
+
- lib/type/read.rb
|
174
|
+
- lib/type/type.rb
|
175
|
+
- pg_graph.gemspec
|
176
|
+
- snippets/1-1.sql
|
177
|
+
- snippets/N-M.sql
|
178
|
+
- snippets/dag.sql
|
179
|
+
- snippets/db.sql
|
180
|
+
- snippets/kind.sql
|
181
|
+
- snippets/recur.sql
|
182
|
+
homepage: http://www.nowhere.com/
|
183
|
+
licenses: []
|
184
|
+
metadata:
|
185
|
+
homepage_uri: http://www.nowhere.com/
|
186
|
+
post_install_message:
|
187
|
+
rdoc_options: []
|
188
|
+
require_paths:
|
189
|
+
- lib
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 2.3.0
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
requirements: []
|
201
|
+
rubygems_version: 3.2.26
|
202
|
+
signing_key:
|
203
|
+
specification_version: 4
|
204
|
+
summary: Create graph type model of database
|
205
|
+
test_files: []
|