gadget 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gadget/version.rb +1 -1
- data/lib/gadget.rb +27 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f09c3a81dfcb53cd77fcb8e4424cd499090a70d1
|
4
|
+
data.tar.gz: 0d825ead338e99f9e4b943ed68e61007211ef665
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eab0f6694c28afd497ccb1b877577f85b8880adb82815944ed710c5b3196146e29e39ff617b6640262ff6e9201d3742212f7a7f3dead92151c6ab6d843e0c8f
|
7
|
+
data.tar.gz: 74c61f5c790d09e455d7c414431d3bab81f9d73132c4342e1de8ae6f5ee57667d9a79578d99fe7782b2b40864e0d784bb4004ea5c78e7fd41355bc0929fe5735
|
data/lib/gadget/version.rb
CHANGED
data/lib/gadget.rb
CHANGED
@@ -16,7 +16,14 @@ module Gadget
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def self.tables(conn)
|
19
|
-
|
19
|
+
sql = <<-END_OF_SQL
|
20
|
+
SELECT c.oid, t.tablename
|
21
|
+
FROM pg_catalog.pg_tables t
|
22
|
+
INNER JOIN pg_catalog.pg_class c ON c.relname=t.tablename
|
23
|
+
WHERE t.schemaname='public'
|
24
|
+
ORDER BY t.tablename
|
25
|
+
END_OF_SQL
|
26
|
+
rs = conn.exec("")
|
20
27
|
tuples = rs.reduce({}) do | h, row |
|
21
28
|
h[row['tablename']] = {
|
22
29
|
:oid => row['oid'].to_i,
|
@@ -181,6 +188,25 @@ WHERE n.nspname = 'public'
|
|
181
188
|
tuples
|
182
189
|
end
|
183
190
|
|
191
|
+
def self.sequences(conn)
|
192
|
+
sql = <<-END_OF_SQL
|
193
|
+
SELECT c.oid, c.relname
|
194
|
+
FROM pg_catalog.pg_class c
|
195
|
+
INNER JOIN pg_catalog.pg_namespace n on c.relnamespace = n.oid
|
196
|
+
WHERE c.relkind = 'S'
|
197
|
+
AND n.nspname = 'public'
|
198
|
+
END_OF_SQL
|
199
|
+
rs = conn.exec(sql)
|
200
|
+
tuples = rs.reduce({}) do | h, row |
|
201
|
+
h[row['relname']] = {
|
202
|
+
:oid => row['oid'].to_i,
|
203
|
+
}
|
204
|
+
h
|
205
|
+
end
|
206
|
+
rs.clear
|
207
|
+
tuples
|
208
|
+
end
|
209
|
+
|
184
210
|
def self.triggers(conn)
|
185
211
|
rs = conn.exec(<<-END_OF_SQL)
|
186
212
|
SELECT tg.oid, tg.tgname, t.tablename, p.proname
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gadget
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig S. Cottingham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|