gadget 0.5.0 → 0.5.1

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
  SHA1:
3
- metadata.gz: f09c3a81dfcb53cd77fcb8e4424cd499090a70d1
4
- data.tar.gz: 0d825ead338e99f9e4b943ed68e61007211ef665
3
+ metadata.gz: 9a5f64881f5f94dec9288e36c441eceead62e545
4
+ data.tar.gz: 3c9250f58beb61cafff7ecbe868c2a6936aa7091
5
5
  SHA512:
6
- metadata.gz: 4eab0f6694c28afd497ccb1b877577f85b8880adb82815944ed710c5b3196146e29e39ff617b6640262ff6e9201d3742212f7a7f3dead92151c6ab6d843e0c8f
7
- data.tar.gz: 74c61f5c790d09e455d7c414431d3bab81f9d73132c4342e1de8ae6f5ee57667d9a79578d99fe7782b2b40864e0d784bb4004ea5c78e7fd41355bc0929fe5735
6
+ metadata.gz: bc4653a8f3689dde13c0d1b232214ae01bd8b7f39a9eb6484986371e031e2e4b9158c485f190fe9bf2dde4a0f08cf7af30ec47adf5e285289915f1f474e82992
7
+ data.tar.gz: ff59a168e4e9fa4fd0406bbf74269c8a13f9bf6282dc08e63eb16afa2993cc4b5402792fdd5007db90bbddc4ee24a4343af08352137593f630a265939f4c2182
data/README.md CHANGED
@@ -32,13 +32,10 @@ If `tablename` is given, returns the columns in only that table.
32
32
  Returns a list of all foreign keys in the schema reachable through `conn`.
33
33
  If `tablename` is given, returns the foreign keys in only that table.
34
34
 
35
- `#functions(conn)`
36
-
37
- Returns a list of all functions in the schema reachable through `conn`.
38
-
39
- `#triggers(conn)`
35
+ `#constraints(conn, tablename=nil)`
40
36
 
41
- Returns a list of all triggers in the schema reachable through `conn`.
37
+ Returns a list of all constraints in the schema reachable through `conn`.
38
+ If `tablename` is given, returns the constraints in only that table.
42
39
 
43
40
  `#dependencies(conn)`
44
41
 
@@ -50,6 +47,26 @@ Table A is defined as dependent on table B if A contains a foreign key reference
50
47
  Returns a list of all tables in the schema reachable through `conn`, ordered such that any given table
51
48
  appears later in the list than all of its dependencies.
52
49
 
50
+ `#dependency_graph(conn)`
51
+
52
+ Returns `.dot` script (suitable for feeding into Graphviz) describing the table dependency graph.
53
+
54
+ `#functions(conn)`
55
+
56
+ Returns a list of all functions in the schema reachable through `conn`.
57
+
58
+ `#sequences(conn)`
59
+
60
+ Returns a list of all sequences in the schema reachable through `conn`.
61
+
62
+ `#triggers(conn)`
63
+
64
+ Returns a list of all triggers in the schema reachable through `conn`.
65
+
66
+ `#types(conn)`
67
+
68
+ Returns a list of all types in the schema reachable through `conn`.
69
+
53
70
  ## Contributing
54
71
 
55
72
  1. Fork it
data/bin/gadget CHANGED
@@ -23,6 +23,8 @@ when 'foreign-keys', 'fks'
23
23
  result = Gadget.foreign_keys(conn, cmdargs.shift)
24
24
  when 'functions'
25
25
  result = Gadget.functions(conn)
26
+ when 'sequences'
27
+ result = Gadget.sequences(conn)
26
28
  when 'tables'
27
29
  result = Gadget.tables(conn)
28
30
  when 'triggers'
data/lib/gadget.rb CHANGED
@@ -21,7 +21,6 @@ SELECT c.oid, t.tablename
21
21
  FROM pg_catalog.pg_tables t
22
22
  INNER JOIN pg_catalog.pg_class c ON c.relname=t.tablename
23
23
  WHERE t.schemaname='public'
24
- ORDER BY t.tablename
25
24
  END_OF_SQL
26
25
  rs = conn.exec("")
27
26
  tuples = rs.reduce({}) do | h, row |
@@ -1,3 +1,3 @@
1
1
  module Gadget
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gadget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig S. Cottingham
@@ -87,13 +87,10 @@ description: |
87
87
  Returns a list of all foreign keys in the schema reachable through `conn`.
88
88
  If `tablename` is given, returns the foreign keys in only that table.
89
89
 
90
- `#functions(conn)`
91
-
92
- Returns a list of all functions in the schema reachable through `conn`.
93
-
94
- `#triggers(conn)`
90
+ `#constraints(conn, tablename=nil)`
95
91
 
96
- Returns a list of all triggers in the schema reachable through `conn`.
92
+ Returns a list of all constraints in the schema reachable through `conn`.
93
+ If `tablename` is given, returns the constraints in only that table.
97
94
 
98
95
  `#dependencies(conn)`
99
96
 
@@ -105,6 +102,26 @@ description: |
105
102
  Returns a list of all tables in the schema reachable through `conn`, ordered such that any given table
106
103
  appears later in the list than all of its dependencies.
107
104
 
105
+ `#dependency_graph(conn)`
106
+
107
+ Returns `.dot` script (suitable for feeding into Graphviz) describing the table dependency graph.
108
+
109
+ `#functions(conn)`
110
+
111
+ Returns a list of all functions in the schema reachable through `conn`.
112
+
113
+ `#sequences(conn)`
114
+
115
+ Returns a list of all sequences in the schema reachable through `conn`.
116
+
117
+ `#triggers(conn)`
118
+
119
+ Returns a list of all triggers in the schema reachable through `conn`.
120
+
121
+ `#types(conn)`
122
+
123
+ Returns a list of all types in the schema reachable through `conn`.
124
+
108
125
  ## Contributing
109
126
 
110
127
  1. Fork it